From c602cf6444755b04971f4177345143c3b9e18a99 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Fri, 1 Sep 2023 16:42:28 +0100 Subject: [PATCH] Update smoke test to use GOV.UK Frontend paths --- cypress/e2e/smoke/0-smoke-tests/index-page.cypress.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/smoke/0-smoke-tests/index-page.cypress.js b/cypress/e2e/smoke/0-smoke-tests/index-page.cypress.js index 5de33e60cd..8b01daa2c3 100644 --- a/cypress/e2e/smoke/0-smoke-tests/index-page.cypress.js +++ b/cypress/e2e/smoke/0-smoke-tests/index-page.cypress.js @@ -1,3 +1,5 @@ +const path = require('path') + const { waitForApplication, restoreStarterFiles } = require('../../utils') describe('smoke test', () => { @@ -11,7 +13,8 @@ describe('smoke test', () => { it('GOV.UK Frontend fonts loaded', () => { waitForApplication('/') - const fontUrl = '/plugin-assets/govuk-frontend/govuk/assets/fonts/bold-b542beb274-v2.woff2' + const includePath = path.dirname(require.resolve('govuk-frontend')).split('node_modules/govuk-frontend')[1].split('\\').join('/') + const fontUrl = `/plugin-assets/govuk-frontend${includePath}/assets/fonts/bold-b542beb274-v2.woff2` cy.task('log', 'Requesting govuk-frontend font') cy.request(`/${fontUrl}`, { retryOnStatusCodeFailure: true })