mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 04:26:57 +00:00
Localisation (#39)
* Localisation * Update tests * Fix map markers in English view * Fix typo
This commit is contained in:
@@ -13,14 +13,15 @@
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import { mount } from "cypress/react18";
|
||||
import { NextIntlClientProvider } from "next-intl";
|
||||
|
||||
import messages from "@/messages/fr.json";
|
||||
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
|
||||
@@ -34,7 +35,15 @@ declare global {
|
||||
}
|
||||
}
|
||||
|
||||
Cypress.Commands.add("mount", mount);
|
||||
Cypress.Commands.add("mount", (component, options) => {
|
||||
const wrapped = (
|
||||
<NextIntlClientProvider locale="fr" messages={messages}>
|
||||
{component}
|
||||
</NextIntlClientProvider>
|
||||
);
|
||||
|
||||
return mount(wrapped, options);
|
||||
});
|
||||
|
||||
// Example use:
|
||||
// cy.mount(<MyComponent />)
|
||||
Reference in New Issue
Block a user