mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-19 17:52:45 +02:00
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { render } from '../../../../utils/testRenderer';
|
|
import { screen } from '@testing-library/react';
|
|
import React from 'react';
|
|
import { testServerRoute, testServerSetup } from '../../../../utils/testServer';
|
|
import { UIProviderContainer } from 'component/providers/UIProvider/UIProviderContainer';
|
|
import ContextList from './ContextList';
|
|
|
|
const server = testServerSetup();
|
|
|
|
const setupRoutes = () => {
|
|
testServerRoute(server, 'api/admin/context', [
|
|
{
|
|
description: 'Allows you to constrain on application name',
|
|
legalValues: [],
|
|
name: 'appName',
|
|
sortOrder: 2,
|
|
stickiness: false,
|
|
usedInProjects: 3,
|
|
usedInFeatures: 2,
|
|
createdAt: '2023-05-24T06:23:07.797Z',
|
|
},
|
|
]);
|
|
};
|
|
|
|
test('should show the count of projects and features used in', async () => {
|
|
setupRoutes();
|
|
|
|
render(
|
|
<UIProviderContainer>
|
|
<ContextList />
|
|
</UIProviderContainer>
|
|
);
|
|
|
|
await screen.findByText('2 feature toggles');
|
|
await screen.findByText('3 projects');
|
|
});
|