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: Add optional Content item page banners
Merge pull request #258 from DFE-Digital/feat/page-banners
- Loading branch information
Showing
14 changed files
with
82 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
npm ci | ||
npx sass --style=expanded --charset --source-map-urls=relative .\styles\scss\application.scss .\wwwroot\css\application.css | ||
npx sass --style=compressed --charset --source-map-urls=relative .\styles\scss\application.scss .\wwwroot\css\application.min.css |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
|
||
.js-enabled .back-link { | ||
display: block !important; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
browser-tests/dev-integration-tests/tests/page-banner.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,29 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
test.describe('Page banner', () => { | ||
|
||
test.describe('When enabled', () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('content-with-page-banner') | ||
}) | ||
|
||
test('Title is visible', async ({ page }) => { | ||
const title = await page.locator('#content-banner-title') | ||
await expect(title).toBeVisible() | ||
await expect(title).toHaveClass(/govuk-heading-xl/) | ||
}) | ||
|
||
test('Subtitle is visible', async ({ page }) => { | ||
const subtitle = await page.locator('#content-banner-subtitle') | ||
await expect(subtitle).toBeVisible() | ||
await expect(subtitle).toHaveClass(/govuk-body-l/) | ||
}) | ||
}) | ||
|
||
test.describe('When not enabled', () => { | ||
test('Is not visible', async ({ page }) => { | ||
await page.goto('/') | ||
await expect(page.locator('#content-banner')).not.toBeAttached() | ||
}) | ||
}) | ||
}) |