Skip to content

Commit

Permalink
test: flaky flag type selection
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Nov 6, 2024
1 parent 1b568d1 commit df2fc02
Showing 1 changed file with 27 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit df2fc02

Please sign in to comment.