Merged in monorepo-step-1 (pull request #1080)
Migrate to a monorepo setup - step 1 * Move web to subfolder /apps/scandic-web * Yarn + transitive deps - Move to yarn - design-system package removed for now since yarn doesn't support the parameter for token (ie project currently broken) - Add missing transitive dependencies as Yarn otherwise prevents these imports - VS Code doesn't pick up TS path aliases unless you open /apps/scandic-web instead of root (will be fixed with monorepo) * Pin framer-motion to temporarily fix typing issue https://github.com/adobe/react-spectrum/issues/7494 * Pin zod to avoid typ error There seems to have been a breaking change in the types returned by zod where error is now returned as undefined instead of missing in the type. We should just handle this but to avoid merge conflicts just pin the dependency for now. * Pin react-intl version Pin version of react-intl to avoid tiny type issue where formatMessage does not accept a generic any more. This will be fixed in a future commit, but to avoid merge conflicts just pin for now. * Pin typescript version Temporarily pin version as newer versions as stricter and results in a type error. Will be fixed in future commit after merge. * Setup workspaces * Add design-system as a monorepo package * Remove unused env var DESIGN_SYSTEM_ACCESS_TOKEN * Fix husky for monorepo setup * Update netlify.toml * Add lint script to root package.json * Add stub readme * Fix react-intl formatMessage types * Test netlify.toml in root * Remove root toml * Update netlify.toml publish path * Remove package-lock.json * Update build for branch/preview builds Approved-by: Linus Flood
This commit is contained in:
committed by
Linus Flood
parent
667cab6fb6
commit
80100e7631
32
apps/scandic-web/cypress/e2e/static-pages/about.cy.ts
Normal file
32
apps/scandic-web/cypress/e2e/static-pages/about.cy.ts
Normal 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")
|
||||
})
|
||||
})
|
||||
26
apps/scandic-web/cypress/e2e/static-pages/sponsoring.cy.ts
Normal file
26
apps/scandic-web/cypress/e2e/static-pages/sponsoring.cy.ts
Normal 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")
|
||||
})
|
||||
})
|
||||
26
apps/scandic-web/cypress/e2e/static-pages/wifi.cy.ts
Normal file
26
apps/scandic-web/cypress/e2e/static-pages/wifi.cy.ts
Normal 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")
|
||||
})
|
||||
})
|
||||
5
apps/scandic-web/cypress/fixtures/example.json
Normal file
5
apps/scandic-web/cypress/fixtures/example.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "Using fixtures to represent data",
|
||||
"email": "hello@cypress.io",
|
||||
"body": "Fixtures are a great way to mock data for responses to routes"
|
||||
}
|
||||
37
apps/scandic-web/cypress/support/commands.ts
Normal file
37
apps/scandic-web/cypress/support/commands.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
/// <reference types="cypress" />
|
||||
// ***********************************************
|
||||
// This example commands.ts shows you how to
|
||||
// create various custom commands and overwrite
|
||||
// existing commands.
|
||||
//
|
||||
// For more comprehensive examples of custom
|
||||
// commands please read more here:
|
||||
// https://on.cypress.io/custom-commands
|
||||
// ***********************************************
|
||||
//
|
||||
//
|
||||
// -- This is a parent command --
|
||||
// Cypress.Commands.add('login', (email, password) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a child command --
|
||||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a dual command --
|
||||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
||||
//
|
||||
// declare global {
|
||||
// namespace Cypress {
|
||||
// interface Chainable {
|
||||
// login(email: string, password: string): Chainable<void>
|
||||
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
|
||||
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
|
||||
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
14
apps/scandic-web/cypress/support/component-index.html
Normal file
14
apps/scandic-web/cypress/support/component-index.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<title>Components App</title>
|
||||
<!-- Used by Next.js to inject CSS. -->
|
||||
<div id="__next_css__DO_NOT_USE__"></div>
|
||||
</head>
|
||||
<body>
|
||||
<div data-cy-root></div>
|
||||
</body>
|
||||
</html>
|
||||
38
apps/scandic-web/cypress/support/component.ts
Normal file
38
apps/scandic-web/cypress/support/component.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
// ***********************************************************
|
||||
// This example support/component.ts is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import "./commands"
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
import { mount } from "cypress/react18"
|
||||
|
||||
// Augment the Cypress namespace to include type definitions for
|
||||
// your custom command.
|
||||
// Alternatively, can be defined in cypress/support/component.d.ts
|
||||
// with a <reference path="./component" /> at the top of your spec.
|
||||
declare global {
|
||||
namespace Cypress {
|
||||
interface Chainable {
|
||||
mount: typeof mount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Cypress.Commands.add("mount", mount)
|
||||
|
||||
// Example use:
|
||||
// cy.mount(<MyComponent />)
|
||||
30
apps/scandic-web/cypress/support/e2e.ts
Normal file
30
apps/scandic-web/cypress/support/e2e.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
// ***********************************************************
|
||||
// This example support/e2e.ts is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
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
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user