1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-23 00:22:19 +01:00

test: playground env table display (#3989)

This commit is contained in:
Mateusz Kwasniewski 2023-06-16 13:49:17 +02:00 committed by GitHub
parent ce6ff2578a
commit 4035327d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,46 @@
import { screen } from '@testing-library/react';
import { render } from 'utils/testRenderer';
import { PlaygroundEnvironmentTable } from './PlaygroundEnvironmentTable';
import { UIProviderContainer } from '../../../providers/UIProvider/UIProviderContainer';
test('should render environment table', async () => {
render(
<UIProviderContainer>
<PlaygroundEnvironmentTable
features={[
{
name: 'featureA',
strategies: {
data: [],
result: false,
},
isEnabled: false,
isEnabledInCurrentEnvironment: false,
variants: [],
projectId: 'projectA',
variant: {
name: 'variantName',
enabled: true,
payload: {
type: 'string',
value: 'variantValue',
},
},
environment: 'dev',
context: {
channel: 'web',
client: 'clientA',
appName: 'myapp',
},
},
]}
/>
</UIProviderContainer>
);
expect(screen.getByText('web')).toBeInTheDocument();
expect(screen.getByText('clientA')).toBeInTheDocument();
expect(screen.getByText('variantName')).toBeInTheDocument();
expect(screen.getByText('False')).toBeInTheDocument();
expect(screen.queryByText('myapp')).not.toBeInTheDocument();
});