mirror of
https://github.com/maputnik/editor.git
synced 2026-01-04 12:30:00 +00:00
It's apparently forced now to use the eslint.config.js instead of .eslintrc It got more strict with requiring the underscore on unused vars like `catch(_err)` , but that was all Closes #1012 Closes #995 Closes #992 ## Launch Checklist <!-- Thanks for the PR! Feel free to add or remove items from the checklist. --> - [ ] Briefly describe the changes in this PR. - [ ] Link to related issues. - [ ] Include before/after visuals or gifs if this PR includes visual changes. - [ ] Write tests for all new functionality. - [ ] Add an entry to `CHANGELOG.md` under the `## main` section.
36 lines
1018 B
TypeScript
36 lines
1018 B
TypeScript
import { MaputnikDriver } from "./maputnik-driver";
|
|
|
|
describe("i18n", () => {
|
|
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
|
|
beforeAndAfter();
|
|
|
|
describe("language detector", () => {
|
|
it("English", () => {
|
|
const url = "?lng=en";
|
|
when.visit(url);
|
|
then(get.elementByTestId("maputnik-lang-select")).shouldHaveValue("en");
|
|
});
|
|
|
|
it("Japanese", () => {
|
|
const url = "?lng=ja";
|
|
when.visit(url);
|
|
then(get.elementByTestId("maputnik-lang-select")).shouldHaveValue("ja");
|
|
});
|
|
});
|
|
|
|
describe("language switcher", () => {
|
|
beforeEach(() => {
|
|
when.setStyle("layer");
|
|
});
|
|
|
|
it("the language switcher switches to Japanese", () => {
|
|
const selector = "maputnik-lang-select";
|
|
then(get.elementByTestId(selector)).shouldExist();
|
|
when.select(selector, "ja");
|
|
then(get.elementByTestId(selector)).shouldHaveValue("ja");
|
|
|
|
then(get.elementByTestId("nav:settings")).shouldHaveText("スタイル設定");
|
|
});
|
|
});
|
|
});
|