Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GOV.UK Frontend v5 on management pages and tests #2327

Merged
merged 5 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixes

- [#2327: Use GOV.UK Frontend v5 on management pages and tests](https://github.com/alphagov/govuk-prototype-kit/pull/2327)

## 13.16.0

### New features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ describe('clear data page', () => {

cy.task('log', 'Add some data')
cy.visit(`/question-check?most-impressive-trick=${encodeURIComponent(answer)}`)
cy.get('.govuk-header__logotype-text')
cy.get('.govuk-header__logotype')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the logo to use the parent .govuk-header__logotype

This way they'll work with both v4 and v5 should we need to switch

cy.visit('/manage-prototype/plugins?abc=def')
cy.get('.govuk-header__logotype-text')
cy.get('.govuk-header__logotype')

cy.task('log', 'Check data has been saved')
cy.visit('/question-check')
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/smoke/0-smoke-tests/index-page.cypress.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ describe('smoke test', () => {
})

it('GOV.UK Frontend fonts loaded', () => {
waitForApplication('/')
waitForApplication('/manage-prototype')

const fontUrl = '/plugin-assets/govuk-frontend/govuk/assets/fonts/bold-b542beb274-v2.woff2'
const fontUrl = '/manage-prototype/dependencies/govuk-frontend/dist/govuk/assets/fonts/bold-b542beb274-v2.woff2'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since plugins can use a different GOV.UK Frontend version, let's test the internal version


cy.task('log', 'Requesting govuk-frontend font')
cy.request(`/${fontUrl}`, { retryOnStatusCodeFailure: true })
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const waitForApplication = async (path = '/index') => {
log(`Waiting for app to restart and load ${path} page`)
cy.task('waitUntilAppRestarts')
cy.visit(path)
cy.get('.govuk-header__logotype-text')
cy.get('.govuk-header__logotype')
.contains('GOV.UK')
}

Expand Down
4 changes: 2 additions & 2 deletions lib/nunjucks/views/manage-prototype/scripts.njk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<script src="/plugin-assets/govuk-prototype-kit/lib/assets/javascripts/kit.js"></script>
<script src="/manage-prototype/dependencies/govuk-frontend/govuk/all.js"></script>
<script src="/manage-prototype/dependencies/govuk-frontend/govuk-prototype-kit/init.js"></script>
<script src="/manage-prototype/dependencies/govuk-frontend/dist/govuk/govuk-frontend.min.js" type="module"></script>
<script src="/manage-prototype/dependencies/govuk-frontend/dist/govuk-prototype-kit/init.js" type="module"></script>
14 changes: 7 additions & 7 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"express": "^4.18.2",
"express-session": "^1.17.3",
"fs-extra": "^11.1.1",
"govuk-frontend": "4.7.0",
"govuk-frontend": "5.0.0",
"inquirer": "^8.2.6",
"lodash": "^4.17.21",
"marked": "^4.3.0",
Expand Down