Skip to content

Commit

Permalink
feat: add freebsd as an OS filter (#407)
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Rabson <[email protected]>
  • Loading branch information
dfr committed Dec 25, 2023
1 parent f4600b8 commit b08c9c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/Explore/FilterCard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const StateFilterCardWrapper = () => {
describe('Filters components', () => {
it('renders the filters cards', async () => {
render(<StateFilterCardWrapper />);
expect(screen.getAllByRole('checkbox')).toHaveLength(2);
expect(screen.getAllByRole('checkbox')).toHaveLength(3);

const checkbox = screen.getAllByRole('checkbox');
expect(checkbox[0]).not.toBeChecked();
Expand Down
4 changes: 4 additions & 0 deletions src/utilities/filterConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const osFilters = [
{
label: 'linux',
value: 'linux'
},
{
label: 'freebsd',
value: 'freebsd'
}
];

Expand Down
8 changes: 7 additions & 1 deletion tests/explore.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,14 @@ test.describe('explore page test', () => {

await expect(exploreFirst).toBeVisible({ timeout: 250000 });

const windowsFilter = page.getByRole('checkbox', { name: 'windows' });
await linuxFilter.uncheck();
await page.getByRole('checkbox', { name: 'windows' }).check();
await windowsFilter.check();
await expect(exploreFirst).not.toBeVisible({ timeout: 250000 });

const freebsdFilter = page.getByRole('checkbox', { name: 'freebsd' });
await windowsFilter.uncheck();
await freebsdFilter.check();
await expect(exploreFirst).not.toBeVisible({ timeout: 250000 });
});
});

0 comments on commit b08c9c4

Please sign in to comment.