chore: cleanup and remove hello world test case

This commit is contained in:
Christel Westerberg
2024-06-05 08:04:29 +02:00
parent e4992f1111
commit 512738428e
11 changed files with 101 additions and 47 deletions

View File

@@ -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({

View File

@@ -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<LayoutArgs<LangParams>>) {
return (
<html lang={params.lang}>
<body>{children}</body>
</html>
)
}

View File

@@ -1,15 +0,0 @@
import type { Metadata } from "next"
export const metadata: Metadata = {
title: "Hello World",
}
export default function HelloWorldTestPage() {
return (
<main>
<header>
<h1>Hello World!</h1>
</header>
</main>
)
}

View File

@@ -1,6 +0,0 @@
describe("Hello World", () => {
it("should have an h1 tag", () => {
cy.visit("/en/test")
cy.get("h1").contains("Hello World")
})
})

View File

@@ -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")
})
})

View File

@@ -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")
})
})

View File

@@ -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")
})
})

View File

@@ -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
}
})

View File

@@ -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]

View File

@@ -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"

View File

@@ -13,7 +13,7 @@ export enum Section {
type ExtraInfo = Typename<
{
extra_info: {
text: string
text: string[]
}
},
Section.ContactBlockSectionsExtraInfo