mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	test: flaky flag type selection (#8677)
This commit is contained in:
		
							parent
							
								
									2615a71474
								
							
						
					
					
						commit
						730200c05b
					
				| @ -40,6 +40,33 @@ const setupApi = () => { | |||||||
|     ]); |     ]); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | test('filters by flag type', async () => { | ||||||
|  |     setupApi(); | ||||||
|  | 
 | ||||||
|  |     render( | ||||||
|  |         <Routes> | ||||||
|  |             <Route | ||||||
|  |                 path={'/projects/:projectId'} | ||||||
|  |                 element={ | ||||||
|  |                     <ProjectFeatureToggles | ||||||
|  |                         environments={['development', 'production']} | ||||||
|  |                     /> | ||||||
|  |                 } | ||||||
|  |             /> | ||||||
|  |         </Routes>, | ||||||
|  |         { | ||||||
|  |             route: '/projects/default', | ||||||
|  |         }, | ||||||
|  |     ); | ||||||
|  |     await screen.findByText('featureA'); | ||||||
|  |     const [icon] = await screen.findAllByTestId('feature-type-icon'); | ||||||
|  | 
 | ||||||
|  |     fireEvent.click(icon); | ||||||
|  | 
 | ||||||
|  |     await screen.findByText('Flag type'); | ||||||
|  |     await screen.findByText('Operational'); | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| test('selects project features', async () => { | test('selects project features', async () => { | ||||||
|     setupApi(); |     setupApi(); | ||||||
|     render( |     render( | ||||||
| @ -107,32 +134,6 @@ test('filters by tag', async () => { | |||||||
|     expect(await screen.findAllByText('backend:sdk')).toHaveLength(2); |     expect(await screen.findAllByText('backend:sdk')).toHaveLength(2); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| test('filters by flag type', async () => { |  | ||||||
|     setupApi(); |  | ||||||
|     render( |  | ||||||
|         <Routes> |  | ||||||
|             <Route |  | ||||||
|                 path={'/projects/:projectId'} |  | ||||||
|                 element={ |  | ||||||
|                     <ProjectFeatureToggles |  | ||||||
|                         environments={['development', 'production']} |  | ||||||
|                     /> |  | ||||||
|                 } |  | ||||||
|             /> |  | ||||||
|         </Routes>, |  | ||||||
|         { |  | ||||||
|             route: '/projects/default', |  | ||||||
|         }, |  | ||||||
|     ); |  | ||||||
|     await screen.findByText('featureA'); |  | ||||||
|     const [icon] = await screen.findAllByTestId('feature-type-icon'); |  | ||||||
| 
 |  | ||||||
|     fireEvent.click(icon); |  | ||||||
| 
 |  | ||||||
|     await screen.findByText('Flag type'); |  | ||||||
|     await screen.findByText('Operational'); |  | ||||||
| }); |  | ||||||
| 
 |  | ||||||
| test('filters by flag author', async () => { | test('filters by flag author', async () => { | ||||||
|     setupApi(); |     setupApi(); | ||||||
|     render( |     render( | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user