diff --git a/app/[lang]/(live-current)/layout.tsx b/app/[lang]/(live-current)/layout.tsx index 5e940e33e..7ce285b88 100644 --- a/app/[lang]/(live-current)/layout.tsx +++ b/app/[lang]/(live-current)/layout.tsx @@ -17,8 +17,7 @@ import type { LangParams, LayoutArgs } from "@/types/params" export const fetchCache = "default-no-store" export const metadata: Metadata = { - description: "New web", - title: "Scandic Hotels New Web", + title: "Scandic Hotels", } export default async function RootLayout({ diff --git a/app/[lang]/(test)/layout.tsx b/app/[lang]/(test)/layout.tsx deleted file mode 100644 index f75ab046d..000000000 --- a/app/[lang]/(test)/layout.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import type { Metadata } from "next" - -import type { LangParams, LayoutArgs } from "@/types/params" - -export const metadata: Metadata = { - title: "Test Site", -} - -export default function RootLayout({ - children, - params, -}: React.PropsWithChildren>) { - return ( - - {children} - - ) -} diff --git a/app/[lang]/(test)/test/page.tsx b/app/[lang]/(test)/test/page.tsx deleted file mode 100644 index 140c6b184..000000000 --- a/app/[lang]/(test)/test/page.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import type { Metadata } from "next" - -export const metadata: Metadata = { - title: "Hello World", -} - -export default function HelloWorldTestPage() { - return ( -
-
-

Hello World!

-
-
- ) -} diff --git a/cypress/e2e/hello-world.cy.js b/cypress/e2e/hello-world.cy.js deleted file mode 100644 index bc1745eea..000000000 --- a/cypress/e2e/hello-world.cy.js +++ /dev/null @@ -1,6 +0,0 @@ -describe("Hello World", () => { - it("should have an h1 tag", () => { - cy.visit("/en/test") - cy.get("h1").contains("Hello World") - }) -}) diff --git a/cypress/e2e/static-pages/about.cy.ts b/cypress/e2e/static-pages/about.cy.ts new file mode 100644 index 000000000..41a4bc450 --- /dev/null +++ b/cypress/e2e/static-pages/about.cy.ts @@ -0,0 +1,32 @@ +describe("About page", () => { + it("should load in Danish", () => { + cy.visit("/da/kundeservice/sporgsmal-og-svar/om-scandics-website") + cy.get("h1").contains("SCANDICS WEBSITE – SPØRGSMÅL OG SVAR") + }) + it("should load in German", () => { + cy.visit( + "/de/kundenbetreuung/haufig-gestellte-fragen/nutzung-der-internetseite" + ) + cy.get("h1").contains("SCANDICS WEBSEITE – FRAGEN UND ANTWORTEN") + }) + it("should load in English", () => { + cy.visit( + "/en/customer-service/frequently-asked-questions/using-the-website" + ) + cy.get("h1").contains("SCANDIC WEBSITE – QUESTIONS AND ANSWERS") + }) + it("should load in Finnish", () => { + cy.visit( + "/fi/asiakaspalvelu/usein-kysytyt-kysymykset/tietoja-internetsivuista" + ) + cy.get("h1").contains("SCANDIC-VERKKOSIVUT – KYSYMYKSIÄ JA VASTAUKSIA") + }) + it("should load in Norwegian", () => { + cy.visit("/no/kundeservice/sporsmal-og-svar/bruk-av-nettsiden") + cy.get("h1").contains("SCANDIC-NETTSTEDET – SPØRSMÅL OG SVAR") + }) + it("should load in Swedish", () => { + cy.visit("/sv/kundservice/fragor-och-svar/om-scandics-webbplats") + cy.get("h1").contains("SCANDICS WEBBPLATS - FRÅGOR OCH SVAR") + }) +}) diff --git a/cypress/e2e/static-pages/sponsoring.cy.ts b/cypress/e2e/static-pages/sponsoring.cy.ts new file mode 100644 index 000000000..3ef7fa3cd --- /dev/null +++ b/cypress/e2e/static-pages/sponsoring.cy.ts @@ -0,0 +1,26 @@ +describe("Sponsoring page", () => { + it("should load in Danish", () => { + cy.visit("/da/sponsorering") + cy.get("h1").contains("SCANDICS SYN PÅ SPONSORATER") + }) + it("should load in German", () => { + cy.visit("/de/sponsoring") + cy.get("h1").contains("SPONSORING BEI SCANDIC") + }) + it("should load in English", () => { + cy.visit("/en/sponsoring") + cy.get("h1").contains("SCANDIC'S TAKE ON SPONSORSHIP") + }) + it("should load in Finnish", () => { + cy.visit("/fi/sponsorointi") + cy.get("h1").contains("SCANDIC JA SPONSOROINTI") + }) + it("should load in Norwegian", () => { + cy.visit("/no/vi-sponser") + cy.get("h1").contains("SCANDICS SYN PÅ SPONSING") + }) + it("should load in Swedish", () => { + cy.visit("/sv/vi-sponsrar") + cy.get("h1").contains("SÅ SER SCANDIC PÅ SPONSRING") + }) +}) diff --git a/cypress/e2e/static-pages/wifi.cy.ts b/cypress/e2e/static-pages/wifi.cy.ts new file mode 100644 index 000000000..b88eeea71 --- /dev/null +++ b/cypress/e2e/static-pages/wifi.cy.ts @@ -0,0 +1,26 @@ +describe("Wifi page", () => { + it("should load in Danish", () => { + cy.visit("/da/oplev-scandic/wifi") + cy.get("h1").contains("FRI WIFI ER EN SELVFØLGE") + }) + it("should load in German", () => { + cy.visit("/de/scandic-entdecken/wlan") + cy.get("h1").contains("GRATIS WLAN IST EINE SELBSTVERSTÄNDLICHKEIT") + }) + it("should load in English", () => { + cy.visit("/en/explore-scandic/wifi") + cy.get("h1").contains("FREE WI-FI GOES WITHOUT SAYING") + }) + it("should load in Finnish", () => { + cy.visit("/fi/koe-scandic/maksuton-internetyhteys") + cy.get("h1").contains("MAKSUTON WI-FI") + }) + it("should load in Norwegian", () => { + cy.visit("/no/utforsk-scandic/wifi") + cy.get("h1").contains("SELVFØLGELIG HAR VI GRATIS WIFI") + }) + it("should load in Swedish", () => { + cy.visit("/sv/utforska-scandic/wi-fi") + cy.get("h1").contains("FRITT WIFI, SÅ KLART") + }) +}) diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index b6eca7540..1e022e1fd 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -18,3 +18,13 @@ import "./commands" // Alternatively you can use CommonJS syntax: // require('./commands') +Cypress.on("uncaught:exception", (err) => { + // https://github.com/cypress-io/cypress/issues/27204 + // Cypress and React Hydrating the document don't get along + // for some unknown reason. Hopefully, we figure out why eventually + // so we can remove this. + // Maybe React 19 (that has changes to hydration logic) might solve this. + if (/hydration|hydrating/i.test(err.message)) { + return false + } +}) diff --git a/netlify.toml b/netlify.toml index b9b7e9a07..ce2835057 100644 --- a/netlify.toml +++ b/netlify.toml @@ -13,9 +13,9 @@ package = "netlify-plugin-cypress" [plugins.inputs] configFile = "cypress.config.ts" [plugins.inputs.postBuild] -enable = true -start = "npm start" -wait-on = "http://127.0.0.1:3000/en/test" +enable = true +start = "npm start" +wait-on = "http://127.0.0.1:3000/en/sponsoring" wait-on-timeout = "30" # seconds [build.environment] diff --git a/package.json b/package.json index 8c1a6f634..42332ac75 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "start": "node .next/standalone/server.js", "test:component": "cypress open --component", "test:component:headless": "cypress run --component", - "test:e2e": "start-server-and-test test:setup http://127.0.0.1:3000/en/test \"cypress open --e2e\"", - "test:e2e:headless": "start-server-and-test test:setup http://127.0.0.1:3000/en/test \"cypress run --e2e\"", + "test:e2e": "start-server-and-test test:setup http://127.0.0.1:3000/en/sponsoring \"cypress open --e2e\"", + "test:e2e:headless": "start-server-and-test test:setup http://127.0.0.1:3000/en/sponsoring \"cypress run --e2e\"", "test:setup": "npm run build && npm run start", "preinstall": "export $(cat .env.local | grep -v '^#' | xargs)", "update-dotenv": "node update-dotenv.mjs" diff --git a/types/requests/asides/contact.ts b/types/requests/asides/contact.ts index 1993c95de..dafc5564c 100644 --- a/types/requests/asides/contact.ts +++ b/types/requests/asides/contact.ts @@ -13,7 +13,7 @@ export enum Section { type ExtraInfo = Typename< { extra_info: { - text: string + text: string[] } }, Section.ContactBlockSectionsExtraInfo