From a9db66bd343eb13c8b1d0c34555c49f24abbb2f0 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Thu, 28 Dec 2023 12:52:27 +0000 Subject: [PATCH] feat: add freebsd as an OS filter (#407) (#408) Signed-off-by: Doug Rabson --- src/__tests__/Explore/FilterCard.test.js | 2 +- src/utilities/filterConstants.js | 4 ++++ tests/explore.spec.js | 8 +++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/__tests__/Explore/FilterCard.test.js b/src/__tests__/Explore/FilterCard.test.js index 5b1eb464..c4a7eb3c 100644 --- a/src/__tests__/Explore/FilterCard.test.js +++ b/src/__tests__/Explore/FilterCard.test.js @@ -21,7 +21,7 @@ const StateFilterCardWrapper = () => { describe('Filters components', () => { it('renders the filters cards', async () => { render(); - expect(screen.getAllByRole('checkbox')).toHaveLength(2); + expect(screen.getAllByRole('checkbox')).toHaveLength(3); const checkbox = screen.getAllByRole('checkbox'); expect(checkbox[0]).not.toBeChecked(); diff --git a/src/utilities/filterConstants.js b/src/utilities/filterConstants.js index 8eb4a321..8a95591f 100644 --- a/src/utilities/filterConstants.js +++ b/src/utilities/filterConstants.js @@ -6,6 +6,10 @@ const osFilters = [ { label: 'linux', value: 'linux' + }, + { + label: 'freebsd', + value: 'freebsd' } ]; diff --git a/tests/explore.spec.js b/tests/explore.spec.js index 0e56b777..20d08b7a 100644 --- a/tests/explore.spec.js +++ b/tests/explore.spec.js @@ -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 }); }); });