1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

test: flaky flag type selection (#8677)

This commit is contained in:
Mateusz Kwasniewski 2024-11-06 14:51:43 +01:00 committed by GitHub
parent 2615a71474
commit 730200c05b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 () => {
setupApi();
render(
@ -107,32 +134,6 @@ test('filters by tag', async () => {
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 () => {
setupApi();
render(