generated from DFE-Digital/govuk-dotnet-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update resources menu item & feature control the whole of resou…
…rces Merge pull request #312 from DFE-Digital/feat/update-resources-menu-item
- Loading branch information
Showing
11 changed files
with
106 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
browser-tests/content-regression-tests/tests/resources-learning/search.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
test.describe('Resources and learning', () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/resources-learning') | ||
}) | ||
|
||
test.describe('Filter accordian @accordian', () => { | ||
test('All sections are collapsed when you arrive on page' , async ({ page }) => { | ||
const sections = await page.locator('.govuk-accordion__section-content').all() | ||
expect(sections.length).toBeGreaterThan(1) | ||
for (const section of sections) | ||
{ | ||
await expect(section).toHaveAttribute('hidden', 'until-found') | ||
} | ||
}) | ||
|
||
test('Clicking expand all, expands the sections' , async ({ page }) => { | ||
await page.getByRole('button', { name: 'Show all sections', exact: true }).click() | ||
|
||
const sections = await page.locator('.govuk-accordion__section-content').all() | ||
expect(sections.length).toBeGreaterThan(1) | ||
for (const section of sections) | ||
{ | ||
await expect(section).not.toHaveAttribute('hidden', 'until-found') | ||
} | ||
}) | ||
}) | ||
|
||
test('Filter by tags performs search' , async ({ page }) => { | ||
await page.getByRole('button', { name: 'Show all sections', exact: true }).click() | ||
const beforeText = await page.getByTestId("results-count").textContent() | ||
await page.locator('.govuk-checkboxes__label').first().click() | ||
await page.getByRole('button', { name: 'Apply filter', exact: true }).click() | ||
const afterText = await page.getByTestId("results-count").textContent() | ||
expect(beforeText).not.toEqual(afterText) | ||
}) | ||
}) |