mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	test: playground env table display (#3989)
This commit is contained in:
		
							parent
							
								
									ce6ff2578a
								
							
						
					
					
						commit
						4035327d56
					
				| @ -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(); | ||||||
|  | }); | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user