mirror of
https://github.com/maputnik/editor.git
synced 2026-07-09 15:37:28 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c24049cb88 | |||
| 1047286d9e | |||
| 99b5dd785d | |||
| be9456d11b | |||
| a87a4d8df8 | |||
| 89d583715f | |||
| fadf01a51d | |||
| 251fe40fde | |||
| f175749fb7 | |||
| f9219c3c83 | |||
| f78b9ccaaa | |||
| bb73a2b1e8 | |||
| a4da75d722 | |||
| 1b314b11b9 |
@@ -56,7 +56,7 @@ jobs:
|
|||||||
|
|
||||||
# Build and upload desktop CLI artifacts
|
# Build and upload desktop CLI artifacts
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
||||||
with:
|
with:
|
||||||
go-version: ^1.23.x
|
go-version: ^1.23.x
|
||||||
cache-dependency-path: desktop/go.sum
|
cache-dependency-path: desktop/go.sum
|
||||||
@@ -98,7 +98,7 @@ jobs:
|
|||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run test-unit-ci
|
- run: npm run test-unit-ci
|
||||||
- name: Upload coverage reports to Codecov
|
- name: Upload coverage reports to Codecov
|
||||||
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
|
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
||||||
with:
|
with:
|
||||||
files: ${{ github.workspace }}/coverage/coverage-final.json
|
files: ${{ github.workspace }}/coverage/coverage-final.json
|
||||||
verbose: true
|
verbose: true
|
||||||
@@ -124,7 +124,7 @@ jobs:
|
|||||||
start: npm run start
|
start: npm run start
|
||||||
browser: chrome
|
browser: chrome
|
||||||
- name: Upload coverage reports to Codecov
|
- name: Upload coverage reports to Codecov
|
||||||
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
|
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
||||||
with:
|
with:
|
||||||
files: ${{ github.workspace }}/.nyc_output/out.json
|
files: ${{ github.workspace }}/.nyc_output/out.json
|
||||||
verbose: true
|
verbose: true
|
||||||
@@ -148,7 +148,7 @@ jobs:
|
|||||||
start: docker run --rm --network host maputnik --port=8888
|
start: docker run --rm --network host maputnik --port=8888
|
||||||
browser: chrome
|
browser: chrome
|
||||||
- name: Upload coverage reports to Codecov
|
- name: Upload coverage reports to Codecov
|
||||||
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
|
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
||||||
with:
|
with:
|
||||||
files: ${{ github.workspace }}/.nyc_output/out.json
|
files: ${{ github.workspace }}/.nyc_output/out.json
|
||||||
verbose: true
|
verbose: true
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
|
uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
|
uses: github/codeql-action/autobuild@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
# 📚 https://git.io/JvXDl
|
# 📚 https://git.io/JvXDl
|
||||||
@@ -67,4 +67,4 @@ jobs:
|
|||||||
# make release
|
# make release
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
|
uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
|
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
registry-url: "https://registry.npmjs.org"
|
registry-url: "https://registry.npmjs.org"
|
||||||
|
|
||||||
- name: Set up Go for desktop build
|
- name: Set up Go for desktop build
|
||||||
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
||||||
with:
|
with:
|
||||||
go-version: ^1.23.x
|
go-version: ^1.23.x
|
||||||
cache-dependency-path: desktop/go.sum
|
cache-dependency-path: desktop/go.sum
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
e2e: {
|
e2e: {
|
||||||
|
specPattern: "e2e/**/*.spec.ts",
|
||||||
setupNodeEvents(on, config) {
|
setupNodeEvents(on, config) {
|
||||||
// implement node event listeners here
|
// implement node event listeners here
|
||||||
require("@cypress/code-coverage/task")(on, config);
|
require("@cypress/code-coverage/task")(on, config);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { MaputnikDriver } from "./maputnik-driver";
|
import { MaputnikDriver } from "./maputnik-driver";
|
||||||
|
|
||||||
|
const test = it;
|
||||||
|
|
||||||
describe("accessibility", () => {
|
describe("accessibility", () => {
|
||||||
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
|
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
|
||||||
beforeAndAfter();
|
beforeAndAfter();
|
||||||
@@ -9,7 +11,7 @@ describe("accessibility", () => {
|
|||||||
when.setStyle("layer");
|
when.setStyle("layer");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("skip link to layer list", () => {
|
test("skip link to layer list", () => {
|
||||||
const selector = "root:skip:layer-list";
|
const selector = "root:skip:layer-list";
|
||||||
then(get.elementByTestId(selector)).shouldExist();
|
then(get.elementByTestId(selector)).shouldExist();
|
||||||
when.tab();
|
when.tab();
|
||||||
@@ -18,7 +20,7 @@ describe("accessibility", () => {
|
|||||||
then(get.skipTargetLayerList()).shouldBeFocused();
|
then(get.skipTargetLayerList()).shouldBeFocused();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("skip link to layer editor", () => {
|
test("skip link to layer editor", () => {
|
||||||
const selector = "root:skip:layer-editor";
|
const selector = "root:skip:layer-editor";
|
||||||
then(get.elementByTestId(selector)).shouldExist();
|
then(get.elementByTestId(selector)).shouldExist();
|
||||||
then(get.elementByTestId("skip-target-layer-editor")).shouldExist();
|
then(get.elementByTestId("skip-target-layer-editor")).shouldExist();
|
||||||
@@ -28,7 +30,7 @@ describe("accessibility", () => {
|
|||||||
then(get.skipTargetLayerEditor()).shouldBeFocused();
|
then(get.skipTargetLayerEditor()).shouldBeFocused();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("skip link to map view", () => {
|
test("skip link to map view", () => {
|
||||||
const selector = "root:skip:map-view";
|
const selector = "root:skip:map-view";
|
||||||
then(get.elementByTestId(selector)).shouldExist();
|
then(get.elementByTestId(selector)).shouldExist();
|
||||||
when.tab().tab().tab();
|
when.tab().tab().tab();
|
||||||
@@ -1,15 +1,17 @@
|
|||||||
import { MaputnikDriver } from "./maputnik-driver";
|
import { MaputnikDriver } from "./maputnik-driver";
|
||||||
|
|
||||||
|
const test = it;
|
||||||
|
|
||||||
describe("code editor", () => {
|
describe("code editor", () => {
|
||||||
const { beforeAndAfter, when, get, then } = new MaputnikDriver();
|
const { beforeAndAfter, when, get, then } = new MaputnikDriver();
|
||||||
beforeAndAfter();
|
beforeAndAfter();
|
||||||
|
|
||||||
it("open code editor", () => {
|
test("open code editor", () => {
|
||||||
when.click("nav:code-editor");
|
when.click("nav:code-editor");
|
||||||
then(get.element(".maputnik-code-editor")).shouldExist();
|
then(get.element(".maputnik-code-editor")).shouldExist();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("closes code editor", () => {
|
test("closes code editor", () => {
|
||||||
when.click("nav:code-editor");
|
when.click("nav:code-editor");
|
||||||
then(get.element(".maputnik-code-editor")).shouldExist();
|
then(get.element(".maputnik-code-editor")).shouldExist();
|
||||||
when.click("nav:code-editor");
|
when.click("nav:code-editor");
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
import { MaputnikDriver } from "./maputnik-driver";
|
import { MaputnikDriver } from "./maputnik-driver";
|
||||||
|
|
||||||
|
const test = it;
|
||||||
|
|
||||||
describe("history", () => {
|
describe("history", () => {
|
||||||
const { beforeAndAfter, when, get, then } = new MaputnikDriver();
|
const { beforeAndAfter, when, get, then } = new MaputnikDriver();
|
||||||
beforeAndAfter();
|
beforeAndAfter();
|
||||||
@@ -13,7 +15,7 @@ describe("history", () => {
|
|||||||
redoKeyCombo = isMac ? "{meta}{shift}z" : "{ctrl}y";
|
redoKeyCombo = isMac ? "{meta}{shift}z" : "{ctrl}y";
|
||||||
});
|
});
|
||||||
|
|
||||||
it("undo/redo", () => {
|
test("undo/redo", () => {
|
||||||
when.setStyle("geojson");
|
when.setStyle("geojson");
|
||||||
when.modal.open();
|
when.modal.open();
|
||||||
|
|
||||||
@@ -87,7 +89,7 @@ describe("history", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not redo after undo and value change", () => {
|
test("should not redo after undo and value change", () => {
|
||||||
when.setStyle("geojson");
|
when.setStyle("geojson");
|
||||||
when.modal.open();
|
when.modal.open();
|
||||||
when.modal.fillLayers({
|
when.modal.fillLayers({
|
||||||
@@ -1,17 +1,19 @@
|
|||||||
import { MaputnikDriver } from "./maputnik-driver";
|
import { MaputnikDriver } from "./maputnik-driver";
|
||||||
|
|
||||||
|
const test = it;
|
||||||
|
|
||||||
describe("i18n", () => {
|
describe("i18n", () => {
|
||||||
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
|
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
|
||||||
beforeAndAfter();
|
beforeAndAfter();
|
||||||
|
|
||||||
describe("language detector", () => {
|
describe("language detector", () => {
|
||||||
it("English", () => {
|
test("English", () => {
|
||||||
const url = "?lng=en";
|
const url = "?lng=en";
|
||||||
when.visit(url);
|
when.visit(url);
|
||||||
then(get.elementByTestId("maputnik-lang-select")).shouldHaveValue("en");
|
then(get.elementByTestId("maputnik-lang-select")).shouldHaveValue("en");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Japanese", () => {
|
test("Japanese", () => {
|
||||||
const url = "?lng=ja";
|
const url = "?lng=ja";
|
||||||
when.visit(url);
|
when.visit(url);
|
||||||
then(get.elementByTestId("maputnik-lang-select")).shouldHaveValue("ja");
|
then(get.elementByTestId("maputnik-lang-select")).shouldHaveValue("ja");
|
||||||
@@ -23,7 +25,7 @@ describe("i18n", () => {
|
|||||||
when.setStyle("layer");
|
when.setStyle("layer");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("the language switcher switches to Japanese", () => {
|
test("the language switcher switches to Japanese", () => {
|
||||||
const selector = "maputnik-lang-select";
|
const selector = "maputnik-lang-select";
|
||||||
then(get.elementByTestId(selector)).shouldExist();
|
then(get.elementByTestId(selector)).shouldExist();
|
||||||
when.select(selector, "ja");
|
when.select(selector, "ja");
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import { MaputnikDriver } from "./maputnik-driver";
|
import { MaputnikDriver } from "./maputnik-driver";
|
||||||
|
const test = it;
|
||||||
|
|
||||||
describe("keyboard", () => {
|
describe("keyboard", () => {
|
||||||
const { beforeAndAfter, given, when, get, then } = new MaputnikDriver();
|
const { beforeAndAfter, given, when, get, then } = new MaputnikDriver();
|
||||||
@@ -9,7 +10,7 @@ describe("keyboard", () => {
|
|||||||
when.setStyle("");
|
when.setStyle("");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("ESC should unfocus", () => {
|
test("ESC should unfocus", () => {
|
||||||
const targetSelector = "maputnik-select";
|
const targetSelector = "maputnik-select";
|
||||||
when.focus(targetSelector);
|
when.focus(targetSelector);
|
||||||
then(get.elementByTestId(targetSelector)).shouldBeFocused();
|
then(get.elementByTestId(targetSelector)).shouldBeFocused();
|
||||||
@@ -17,42 +18,42 @@ describe("keyboard", () => {
|
|||||||
then(get.elementByTestId(targetSelector)).shouldNotBeFocused();
|
then(get.elementByTestId(targetSelector)).shouldNotBeFocused();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("'?' should show shortcuts modal", () => {
|
test("'?' should show shortcuts modal", () => {
|
||||||
when.typeKeys("?");
|
when.typeKeys("?");
|
||||||
then(get.elementByTestId("modal:shortcuts")).shouldBeVisible();
|
then(get.elementByTestId("modal:shortcuts")).shouldBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("'o' should show open modal", () => {
|
test("'o' should show open modal", () => {
|
||||||
when.typeKeys("o");
|
when.typeKeys("o");
|
||||||
then(get.elementByTestId("modal:open")).shouldBeVisible();
|
then(get.elementByTestId("modal:open")).shouldBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("'e' should show export modal", () => {
|
test("'e' should show export modal", () => {
|
||||||
when.typeKeys("e");
|
when.typeKeys("e");
|
||||||
then(get.elementByTestId("modal:export")).shouldBeVisible();
|
then(get.elementByTestId("modal:export")).shouldBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("'d' should show sources modal", () => {
|
test("'d' should show sources modal", () => {
|
||||||
when.typeKeys("d");
|
when.typeKeys("d");
|
||||||
then(get.elementByTestId("modal:sources")).shouldBeVisible();
|
then(get.elementByTestId("modal:sources")).shouldBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("'s' should show settings modal", () => {
|
test("'s' should show settings modal", () => {
|
||||||
when.typeKeys("s");
|
when.typeKeys("s");
|
||||||
then(get.elementByTestId("modal:settings")).shouldBeVisible();
|
then(get.elementByTestId("modal:settings")).shouldBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("'i' should change map to inspect mode", () => {
|
test("'i' should change map to inspect mode", () => {
|
||||||
when.typeKeys("i");
|
when.typeKeys("i");
|
||||||
then(get.inputValue("maputnik-select")).shouldEqual("inspect");
|
then(get.inputValue("maputnik-select")).shouldEqual("inspect");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("'m' should focus map", () => {
|
test("'m' should focus map", () => {
|
||||||
when.typeKeys("m");
|
when.typeKeys("m");
|
||||||
then(get.canvas()).shouldBeFocused();
|
then(get.canvas()).shouldBeFocused();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("'!' should show debug modal", () => {
|
test("'!' should show debug modal", () => {
|
||||||
when.typeKeys("!");
|
when.typeKeys("!");
|
||||||
then(get.elementByTestId("modal:debug")).shouldBeVisible();
|
then(get.elementByTestId("modal:debug")).shouldBeVisible();
|
||||||
});
|
});
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
import { MaputnikDriver } from "./maputnik-driver";
|
import { MaputnikDriver } from "./maputnik-driver";
|
||||||
import { v1 as uuid } from "uuid";
|
import { v1 as uuid } from "uuid";
|
||||||
|
|
||||||
|
const test = it;
|
||||||
|
|
||||||
describe("layer editor", () => {
|
describe("layer editor", () => {
|
||||||
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
|
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
|
||||||
beforeAndAfter();
|
beforeAndAfter();
|
||||||
@@ -28,8 +30,8 @@ describe("layer editor", () => {
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
it("expand/collapse");
|
test("expand/collapse");
|
||||||
it("id", () => {
|
test("id", () => {
|
||||||
const bgId = createBackground();
|
const bgId = createBackground();
|
||||||
|
|
||||||
when.click("layer-list-item:background:" + bgId);
|
when.click("layer-list-item:background:" + bgId);
|
||||||
@@ -49,7 +51,7 @@ describe("layer editor", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("source", () => {
|
describe("source", () => {
|
||||||
it("should show error when the source is invalid", () => {
|
test("should show error when the source is invalid", () => {
|
||||||
when.modal.fillLayers({
|
when.modal.fillLayers({
|
||||||
type: "circle",
|
type: "circle",
|
||||||
layer: "invalid",
|
layer: "invalid",
|
||||||
@@ -68,7 +70,7 @@ describe("layer editor", () => {
|
|||||||
when.click("layer-editor.layer-id");
|
when.click("layer-editor.layer-id");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should update min-zoom in local storage", () => {
|
test("should update min-zoom in local storage", () => {
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
layers: [
|
layers: [
|
||||||
{
|
{
|
||||||
@@ -105,7 +107,7 @@ describe("layer editor", () => {
|
|||||||
when.click("layer-editor.layer-id");
|
when.click("layer-editor.layer-id");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should update style in local storage", () => {
|
test("should update style in local storage", () => {
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
layers: [
|
layers: [
|
||||||
{
|
{
|
||||||
@@ -129,7 +131,7 @@ describe("layer editor", () => {
|
|||||||
when.click("layer-editor.layer-id");
|
when.click("layer-editor.layer-id");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should update style in local storage", () => {
|
test("should update style in local storage", () => {
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
layers: [
|
layers: [
|
||||||
{
|
{
|
||||||
@@ -149,7 +151,7 @@ describe("layer editor", () => {
|
|||||||
when.click("min-zoom.input-text");
|
when.click("min-zoom.input-text");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should update style in local storage", () => {
|
test("should update style in local storage", () => {
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
layers: [
|
layers: [
|
||||||
{
|
{
|
||||||
@@ -170,7 +172,7 @@ describe("layer editor", () => {
|
|||||||
when.click("spec-field:background-color");
|
when.click("spec-field:background-color");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should update style in local storage", () => {
|
test("should update style in local storage", () => {
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
layers: [
|
layers: [
|
||||||
{
|
{
|
||||||
@@ -190,11 +192,11 @@ describe("layer editor", () => {
|
|||||||
when.type("spec-field-input:background-opacity", "0.");
|
when.type("spec-field-input:background-opacity", "0.");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should keep '.' in the input field", () => {
|
test("should keep '.' in the input field", () => {
|
||||||
then(get.elementByTestId("spec-field-input:background-opacity")).shouldHaveValue("0.");
|
then(get.elementByTestId("spec-field-input:background-opacity")).shouldHaveValue("0.");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should revert to a valid value when focus out", () => {
|
test("should revert to a valid value when focus out", () => {
|
||||||
when.click("layer-list-item:background:" + bgId);
|
when.click("layer-list-item:background:" + bgId);
|
||||||
then(get.elementByTestId("spec-field-input:background-opacity")).shouldHaveValue("0");
|
then(get.elementByTestId("spec-field-input:background-opacity")).shouldHaveValue("0");
|
||||||
});
|
});
|
||||||
@@ -203,12 +205,12 @@ describe("layer editor", () => {
|
|||||||
|
|
||||||
|
|
||||||
describe("filter", () => {
|
describe("filter", () => {
|
||||||
it("expand/collapse");
|
test("expand/collapse");
|
||||||
it("compound filter");
|
test("compound filter");
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("layout", () => {
|
describe("layout", () => {
|
||||||
it("text-font", () => {
|
test("text-font", () => {
|
||||||
when.setStyle("font");
|
when.setStyle("font");
|
||||||
when.collapseGroupInLayerEditor();
|
when.collapseGroupInLayerEditor();
|
||||||
when.collapseGroupInLayerEditor(1);
|
when.collapseGroupInLayerEditor(1);
|
||||||
@@ -222,14 +224,14 @@ describe("layer editor", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("paint", () => {
|
describe("paint", () => {
|
||||||
it("expand/collapse");
|
test("expand/collapse");
|
||||||
it("color");
|
test("color");
|
||||||
it("pattern");
|
test("pattern");
|
||||||
it("opacity");
|
test("opacity");
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("json-editor", () => {
|
describe("json-editor", () => {
|
||||||
it("add", () => {
|
test("add", () => {
|
||||||
const id = when.modal.fillLayers({
|
const id = when.modal.fillLayers({
|
||||||
type: "circle",
|
type: "circle",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -254,10 +256,10 @@ describe("layer editor", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("expand/collapse");
|
test("expand/collapse");
|
||||||
it("modify");
|
test("modify");
|
||||||
|
|
||||||
it("parse error", () => {
|
test("parse error", () => {
|
||||||
const bgId = createBackground();
|
const bgId = createBackground();
|
||||||
|
|
||||||
when.click("layer-list-item:background:" + bgId);
|
when.click("layer-list-item:background:" + bgId);
|
||||||
@@ -273,7 +275,7 @@ describe("layer editor", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("sticky header", () => {
|
describe("sticky header", () => {
|
||||||
it("should keep layer header visible when scrolling properties", () => {
|
test("should keep layer header visible when scrolling properties", () => {
|
||||||
// Setup: Create a layer with many properties (e.g., symbol layer)
|
// Setup: Create a layer with many properties (e.g., symbol layer)
|
||||||
when.modal.fillLayers({
|
when.modal.fillLayers({
|
||||||
type: "symbol",
|
type: "symbol",
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import { MaputnikDriver } from "./maputnik-driver";
|
import { MaputnikDriver } from "./maputnik-driver";
|
||||||
|
const test = it;
|
||||||
|
|
||||||
describe("layers list", () => {
|
describe("layers list", () => {
|
||||||
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
|
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
|
||||||
@@ -16,7 +17,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should update layers in local storage", () => {
|
test("should update layers in local storage", () => {
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
layers: [
|
layers: [
|
||||||
{
|
{
|
||||||
@@ -31,7 +32,7 @@ describe("layers list", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
when.click("layer-list-item:" + id + ":delete");
|
when.click("layer-list-item:" + id + ":delete");
|
||||||
});
|
});
|
||||||
it("should empty layers in local storage", () => {
|
test("should empty layers in local storage", () => {
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
layers: [],
|
layers: [],
|
||||||
});
|
});
|
||||||
@@ -42,7 +43,7 @@ describe("layers list", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
when.click("layer-list-item:" + id + ":copy");
|
when.click("layer-list-item:" + id + ":copy");
|
||||||
});
|
});
|
||||||
it("should add copy layer in local storage", () => {
|
test("should add copy layer in local storage", () => {
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
layers: [
|
layers: [
|
||||||
{
|
{
|
||||||
@@ -63,7 +64,7 @@ describe("layers list", () => {
|
|||||||
when.click("layer-list-item:" + id + ":toggle-visibility");
|
when.click("layer-list-item:" + id + ":toggle-visibility");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should update visibility to none in local storage", () => {
|
test("should update visibility to none in local storage", () => {
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
layers: [
|
layers: [
|
||||||
{
|
{
|
||||||
@@ -82,7 +83,7 @@ describe("layers list", () => {
|
|||||||
when.click("layer-list-item:" + id + ":toggle-visibility");
|
when.click("layer-list-item:" + id + ":toggle-visibility");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should update visibility to visible in local storage", () => {
|
test("should update visibility to visible in local storage", () => {
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
layers: [
|
layers: [
|
||||||
{
|
{
|
||||||
@@ -106,7 +107,7 @@ describe("layers list", () => {
|
|||||||
type: "background",
|
type: "background",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it("should show the selected layer in the editor", () => {
|
test("should show the selected layer in the editor", () => {
|
||||||
when.realClick("layer-list-item:" + secondId);
|
when.realClick("layer-list-item:" + secondId);
|
||||||
then(get.elementByTestId("layer-editor.layer-id.input")).shouldHaveValue(secondId);
|
then(get.elementByTestId("layer-editor.layer-id.input")).shouldHaveValue(secondId);
|
||||||
when.realClick("layer-list-item:" + id);
|
when.realClick("layer-list-item:" + id);
|
||||||
@@ -117,7 +118,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("background", () => {
|
describe("background", () => {
|
||||||
it("add", () => {
|
test("add", () => {
|
||||||
const id = when.modal.fillLayers({
|
const id = when.modal.fillLayers({
|
||||||
type: "background",
|
type: "background",
|
||||||
});
|
});
|
||||||
@@ -135,7 +136,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("fill", () => {
|
describe("fill", () => {
|
||||||
it("add", () => {
|
test("add", () => {
|
||||||
const id = when.modal.fillLayers({
|
const id = when.modal.fillLayers({
|
||||||
type: "fill",
|
type: "fill",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -153,11 +154,11 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Change source
|
// TODO: Change source
|
||||||
it("change source");
|
test("change source");
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("line", () => {
|
describe("line", () => {
|
||||||
it("add", () => {
|
test("add", () => {
|
||||||
const id = when.modal.fillLayers({
|
const id = when.modal.fillLayers({
|
||||||
type: "line",
|
type: "line",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -174,7 +175,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("groups", () => {
|
test("groups", () => {
|
||||||
when.modal.open();
|
when.modal.open();
|
||||||
const id1 = when.modal.fillLayers({
|
const id1 = when.modal.fillLayers({
|
||||||
id: "aa",
|
id: "aa",
|
||||||
@@ -230,7 +231,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("symbol", () => {
|
describe("symbol", () => {
|
||||||
it("add", () => {
|
test("add", () => {
|
||||||
const id = when.modal.fillLayers({
|
const id = when.modal.fillLayers({
|
||||||
type: "symbol",
|
type: "symbol",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -247,7 +248,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show spec info when hovering and clicking single line property", () => {
|
test("should show spec info when hovering and clicking single line property", () => {
|
||||||
when.modal.fillLayers({
|
when.modal.fillLayers({
|
||||||
type: "symbol",
|
type: "symbol",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -259,7 +260,7 @@ describe("layers list", () => {
|
|||||||
then(get.elementByTestId("spec-field-doc")).shouldContainText("Rotates the ");
|
then(get.elementByTestId("spec-field-doc")).shouldContainText("Rotates the ");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show spec info when hovering and clicking multi line property", () => {
|
test("should show spec info when hovering and clicking multi line property", () => {
|
||||||
when.modal.fillLayers({
|
when.modal.fillLayers({
|
||||||
type: "symbol",
|
type: "symbol",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -271,7 +272,7 @@ describe("layers list", () => {
|
|||||||
then(get.elementByTestId("spec-field-doc")).shouldContainText("Offset distance");
|
then(get.elementByTestId("spec-field-doc")).shouldContainText("Offset distance");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should hide spec info when clicking a second time", () => {
|
test("should hide spec info when clicking a second time", () => {
|
||||||
when.modal.fillLayers({
|
when.modal.fillLayers({
|
||||||
type: "symbol",
|
type: "symbol",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -287,7 +288,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("raster", () => {
|
describe("raster", () => {
|
||||||
it("add", () => {
|
test("add", () => {
|
||||||
const id = when.modal.fillLayers({
|
const id = when.modal.fillLayers({
|
||||||
type: "raster",
|
type: "raster",
|
||||||
layer: "raster",
|
layer: "raster",
|
||||||
@@ -306,7 +307,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("circle", () => {
|
describe("circle", () => {
|
||||||
it("add", () => {
|
test("add", () => {
|
||||||
const id = when.modal.fillLayers({
|
const id = when.modal.fillLayers({
|
||||||
type: "circle",
|
type: "circle",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -325,7 +326,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("fill extrusion", () => {
|
describe("fill extrusion", () => {
|
||||||
it("add", () => {
|
test("add", () => {
|
||||||
const id = when.modal.fillLayers({
|
const id = when.modal.fillLayers({
|
||||||
type: "fill-extrusion",
|
type: "fill-extrusion",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -344,7 +345,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("hillshade", () => {
|
describe("hillshade", () => {
|
||||||
it("add", () => {
|
test("add", () => {
|
||||||
const id = when.modal.fillLayers({
|
const id = when.modal.fillLayers({
|
||||||
type: "hillshade",
|
type: "hillshade",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -361,7 +362,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("set hillshade illumination direction array", () => {
|
test("set hillshade illumination direction array", () => {
|
||||||
const id = when.modal.fillLayers({
|
const id = when.modal.fillLayers({
|
||||||
type: "hillshade",
|
type: "hillshade",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -387,7 +388,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("set hillshade highlight color array", () => {
|
test("set hillshade highlight color array", () => {
|
||||||
const id = when.modal.fillLayers({
|
const id = when.modal.fillLayers({
|
||||||
type: "hillshade",
|
type: "hillshade",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -413,7 +414,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("color-relief", () => {
|
describe("color-relief", () => {
|
||||||
it("add", () => {
|
test("add", () => {
|
||||||
const id = when.modal.fillLayers({
|
const id = when.modal.fillLayers({
|
||||||
type: "color-relief",
|
type: "color-relief",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -430,7 +431,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("adds elevation expression when clicking the elevation button", () => {
|
test("adds elevation expression when clicking the elevation button", () => {
|
||||||
when.modal.fillLayers({
|
when.modal.fillLayers({
|
||||||
type: "color-relief",
|
type: "color-relief",
|
||||||
layer: "example",
|
layer: "example",
|
||||||
@@ -442,7 +443,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("groups", () => {
|
describe("groups", () => {
|
||||||
it("simple", () => {
|
test("simple", () => {
|
||||||
when.setStyle("geojson");
|
when.setStyle("geojson");
|
||||||
|
|
||||||
when.modal.open();
|
when.modal.open();
|
||||||
@@ -478,7 +479,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("drag and drop", () => {
|
describe("drag and drop", () => {
|
||||||
it("move layer should update local storage", () => {
|
test("move layer should update local storage", () => {
|
||||||
when.modal.open();
|
when.modal.open();
|
||||||
const firstId = when.modal.fillLayers({
|
const firstId = when.modal.fillLayers({
|
||||||
id: "a",
|
id: "a",
|
||||||
@@ -517,7 +518,7 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("sticky header", () => {
|
describe("sticky header", () => {
|
||||||
it("should keep header visible when scrolling layer list", () => {
|
test("should keep header visible when scrolling layer list", () => {
|
||||||
// Setup: Create multiple layers to enable scrolling
|
// Setup: Create multiple layers to enable scrolling
|
||||||
for (let i = 0; i < 20; i++) {
|
for (let i = 0; i < 20; i++) {
|
||||||
when.modal.open();
|
when.modal.open();
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
import { MaputnikDriver } from "./maputnik-driver";
|
import { MaputnikDriver } from "./maputnik-driver";
|
||||||
|
|
||||||
|
const test = it;
|
||||||
|
|
||||||
describe("map", () => {
|
describe("map", () => {
|
||||||
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
|
const { beforeAndAfter, get, when, then } = new MaputnikDriver();
|
||||||
beforeAndAfter();
|
beforeAndAfter();
|
||||||
describe("zoom level", () => {
|
describe("zoom level", () => {
|
||||||
it("via url", () => {
|
test("via url", () => {
|
||||||
const zoomLevel = 12.37;
|
const zoomLevel = 12.37;
|
||||||
when.setStyle("geojson", zoomLevel);
|
when.setStyle("geojson", zoomLevel);
|
||||||
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldBeVisible();
|
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldBeVisible();
|
||||||
@@ -13,7 +15,7 @@ describe("map", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("via map controls", () => {
|
test("via map controls", () => {
|
||||||
const zoomLevel = 12.37;
|
const zoomLevel = 12.37;
|
||||||
when.setStyle("geojson", zoomLevel);
|
when.setStyle("geojson", zoomLevel);
|
||||||
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldBeVisible();
|
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldBeVisible();
|
||||||
@@ -23,7 +25,7 @@ describe("map", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("via style file definition", () => {
|
test("via style file definition", () => {
|
||||||
when.setStyle("zoom_7_center_0_51");
|
when.setStyle("zoom_7_center_0_51");
|
||||||
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldBeVisible();
|
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldBeVisible();
|
||||||
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldContainText(
|
then(get.elementByTestId("maplibre:ctrl-zoom")).shouldContainText(
|
||||||
@@ -40,7 +42,7 @@ describe("map", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("search", () => {
|
describe("search", () => {
|
||||||
it("should exist", () => {
|
test("should exist", () => {
|
||||||
then(get.searchControl()).shouldBeVisible();
|
then(get.searchControl()).shouldBeVisible();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -50,12 +52,12 @@ describe("map", () => {
|
|||||||
when.setStyle("rectangles");
|
when.setStyle("rectangles");
|
||||||
then(get.locationHash().should("exist"));
|
then(get.locationHash().should("exist"));
|
||||||
});
|
});
|
||||||
it("should open on feature click", () => {
|
test("should open on feature click", () => {
|
||||||
when.clickCenter("maplibre:map");
|
when.clickCenter("maplibre:map");
|
||||||
then(get.elementByTestId("feature-layer-popup")).shouldBeVisible();
|
then(get.elementByTestId("feature-layer-popup")).shouldBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should open a second feature after closing popup", () => {
|
test("should open a second feature after closing popup", () => {
|
||||||
when.clickCenter("maplibre:map");
|
when.clickCenter("maplibre:map");
|
||||||
then(get.elementByTestId("feature-layer-popup")).shouldBeVisible();
|
then(get.elementByTestId("feature-layer-popup")).shouldBeVisible();
|
||||||
when.closePopup();
|
when.closePopup();
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { MaputnikDriver } from "./maputnik-driver";
|
import { MaputnikDriver } from "./maputnik-driver";
|
||||||
import tokens from "../../src/config/tokens.json" with {type: "json"};
|
import tokens from "../src/config/tokens.json" with {type: "json"};
|
||||||
|
const test = it;
|
||||||
|
|
||||||
describe("modals", () => {
|
describe("modals", () => {
|
||||||
const { beforeAndAfter, when, get, given, then } = new MaputnikDriver();
|
const { beforeAndAfter, when, get, given, then } = new MaputnikDriver();
|
||||||
@@ -13,17 +14,17 @@ describe("modals", () => {
|
|||||||
when.click("nav:open");
|
when.click("nav:open");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("close", () => {
|
test("close", () => {
|
||||||
when.modal.close("modal:open");
|
when.modal.close("modal:open");
|
||||||
then(get.elementByTestId("modal:open")).shouldNotExist();
|
then(get.elementByTestId("modal:open")).shouldNotExist();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("upload", () => {
|
test("upload", () => {
|
||||||
when.chooseExampleFile();
|
when.chooseExampleFile();
|
||||||
then(get.fixture("example-style.json")).shouldEqualToStoredStyle();
|
then(get.fixture("example-style.json")).shouldEqualToStoredStyle();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("upload via drag and drop", () => {
|
test("upload via drag and drop", () => {
|
||||||
when.dropExampleFile();
|
when.dropExampleFile();
|
||||||
then(get.fixture("example-style.json")).shouldEqualToStoredStyle();
|
then(get.fixture("example-style.json")).shouldEqualToStoredStyle();
|
||||||
});
|
});
|
||||||
@@ -36,14 +37,14 @@ describe("modals", () => {
|
|||||||
when.click("modal:open.url.button");
|
when.click("modal:open.url.button");
|
||||||
when.wait(200);
|
when.wait(200);
|
||||||
});
|
});
|
||||||
it("load from url", () => {
|
test("load from url", () => {
|
||||||
then(get.responseBody("example-style.json")).shouldEqualToStoredStyle();
|
then(get.responseBody("example-style.json")).shouldEqualToStoredStyle();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("shortcuts", () => {
|
describe("shortcuts", () => {
|
||||||
it("open/close", () => {
|
test("open/close", () => {
|
||||||
when.setStyle("");
|
when.setStyle("");
|
||||||
when.typeKeys("?");
|
when.typeKeys("?");
|
||||||
when.modal.close("modal:shortcuts");
|
when.modal.close("modal:shortcuts");
|
||||||
@@ -56,13 +57,13 @@ describe("modals", () => {
|
|||||||
when.click("nav:export");
|
when.click("nav:export");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("close", () => {
|
test("close", () => {
|
||||||
when.modal.close("modal:export");
|
when.modal.close("modal:export");
|
||||||
then(get.elementByTestId("modal:export")).shouldNotExist();
|
then(get.elementByTestId("modal:export")).shouldNotExist();
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Work out how to download a file and check the contents
|
// TODO: Work out how to download a file and check the contents
|
||||||
it("download");
|
test("download");
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("sources", () => {
|
describe("sources", () => {
|
||||||
@@ -71,10 +72,10 @@ describe("modals", () => {
|
|||||||
when.click("nav:sources");
|
when.click("nav:sources");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("active sources");
|
test("active sources");
|
||||||
it("public source");
|
test("public source");
|
||||||
|
|
||||||
it("add new source", () => {
|
test("add new source", () => {
|
||||||
const sourceId = "n1z2v3r";
|
const sourceId = "n1z2v3r";
|
||||||
when.setValue("modal:sources.add.source_id", sourceId);
|
when.setValue("modal:sources.add.source_id", sourceId);
|
||||||
when.select("modal:sources.add.source_type", "tile_vector");
|
when.select("modal:sources.add.source_type", "tile_vector");
|
||||||
@@ -88,7 +89,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("add new pmtiles source", () => {
|
test("add new pmtiles source", () => {
|
||||||
const sourceId = "pmtilestest";
|
const sourceId = "pmtilestest";
|
||||||
when.setValue("modal:sources.add.source_id", sourceId);
|
when.setValue("modal:sources.add.source_id", sourceId);
|
||||||
when.select("modal:sources.add.source_type", "pmtiles_vector");
|
when.select("modal:sources.add.source_type", "pmtiles_vector");
|
||||||
@@ -106,7 +107,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("add new raster source", () => {
|
test("add new raster source", () => {
|
||||||
const sourceId = "rastertest";
|
const sourceId = "rastertest";
|
||||||
when.setValue("modal:sources.add.source_id", sourceId);
|
when.setValue("modal:sources.add.source_id", sourceId);
|
||||||
when.select("modal:sources.add.source_type", "tile_raster");
|
when.select("modal:sources.add.source_type", "tile_raster");
|
||||||
@@ -123,7 +124,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("inspect", () => {
|
describe("inspect", () => {
|
||||||
it("toggle", () => {
|
test("toggle", () => {
|
||||||
// There is no assertion in this test
|
// There is no assertion in this test
|
||||||
when.setStyle("geojson");
|
when.setStyle("geojson");
|
||||||
when.select("maputnik-select", "inspect");
|
when.select("maputnik-select", "inspect");
|
||||||
@@ -140,7 +141,7 @@ describe("modals", () => {
|
|||||||
when.click("field-doc-button-Name");
|
when.click("field-doc-button-Name");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the spec information", () => {
|
test("should show the spec information", () => {
|
||||||
then(get.elementsText("spec-field-doc")).shouldInclude(
|
then(get.elementsText("spec-field-doc")).shouldInclude(
|
||||||
"name for the style"
|
"name for the style"
|
||||||
);
|
);
|
||||||
@@ -154,7 +155,7 @@ describe("modals", () => {
|
|||||||
when.wait(200);
|
when.wait(200);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("show name specifications", () => {
|
test("show name specifications", () => {
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
name: "foobar",
|
name: "foobar",
|
||||||
});
|
});
|
||||||
@@ -167,14 +168,14 @@ describe("modals", () => {
|
|||||||
when.click("modal:settings.name");
|
when.click("modal:settings.name");
|
||||||
when.wait(200);
|
when.wait(200);
|
||||||
});
|
});
|
||||||
it("should update owner in local storage", () => {
|
test("should update owner in local storage", () => {
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
owner: "foobar",
|
owner: "foobar",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("sprite url", () => {
|
test("sprite url", () => {
|
||||||
when.setTextInJsonEditor("\"http://example.com\"");
|
when.setTextInJsonEditor("\"http://example.com\"");
|
||||||
when.click("modal:settings.name");
|
when.click("modal:settings.name");
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
@@ -182,7 +183,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("sprite object", () => {
|
test("sprite object", () => {
|
||||||
when.setTextInJsonEditor(JSON.stringify([{ id: "1", url: "2" }]));
|
when.setTextInJsonEditor(JSON.stringify([{ id: "1", url: "2" }]));
|
||||||
|
|
||||||
when.click("modal:settings.name");
|
when.click("modal:settings.name");
|
||||||
@@ -191,7 +192,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("glyphs url", () => {
|
test("glyphs url", () => {
|
||||||
const glyphsUrl = "http://example.com/{fontstack}/{range}.pbf";
|
const glyphsUrl = "http://example.com/{fontstack}/{range}.pbf";
|
||||||
when.setValue("modal:settings.glyphs", glyphsUrl);
|
when.setValue("modal:settings.glyphs", glyphsUrl);
|
||||||
when.click("modal:settings.name");
|
when.click("modal:settings.name");
|
||||||
@@ -200,7 +201,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("maptiler access token", () => {
|
test("maptiler access token", () => {
|
||||||
const apiKey = "testing123";
|
const apiKey = "testing123";
|
||||||
when.setValue(
|
when.setValue(
|
||||||
"modal:settings.maputnik:openmaptiles_access_token",
|
"modal:settings.maputnik:openmaptiles_access_token",
|
||||||
@@ -214,7 +215,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("thunderforest access token", () => {
|
test("thunderforest access token", () => {
|
||||||
const apiKey = "testing123";
|
const apiKey = "testing123";
|
||||||
when.setValue(
|
when.setValue(
|
||||||
"modal:settings.maputnik:thunderforest_access_token",
|
"modal:settings.maputnik:thunderforest_access_token",
|
||||||
@@ -226,7 +227,7 @@ describe("modals", () => {
|
|||||||
).shouldInclude({ "maputnik:thunderforest_access_token": apiKey });
|
).shouldInclude({ "maputnik:thunderforest_access_token": apiKey });
|
||||||
});
|
});
|
||||||
|
|
||||||
it("stadia access token", () => {
|
test("stadia access token", () => {
|
||||||
const apiKey = "testing123";
|
const apiKey = "testing123";
|
||||||
when.setValue(
|
when.setValue(
|
||||||
"modal:settings.maputnik:stadia_access_token",
|
"modal:settings.maputnik:stadia_access_token",
|
||||||
@@ -238,7 +239,7 @@ describe("modals", () => {
|
|||||||
).shouldInclude({ "maputnik:stadia_access_token": apiKey });
|
).shouldInclude({ "maputnik:stadia_access_token": apiKey });
|
||||||
});
|
});
|
||||||
|
|
||||||
it("locationiq access token", () => {
|
test("locationiq access token", () => {
|
||||||
const apiKey = "testing123";
|
const apiKey = "testing123";
|
||||||
when.setValue(
|
when.setValue(
|
||||||
"modal:settings.maputnik:locationiq_access_token",
|
"modal:settings.maputnik:locationiq_access_token",
|
||||||
@@ -250,14 +251,14 @@ describe("modals", () => {
|
|||||||
).shouldInclude({ "maputnik:locationiq_access_token": apiKey });
|
).shouldInclude({ "maputnik:locationiq_access_token": apiKey });
|
||||||
});
|
});
|
||||||
|
|
||||||
it("style projection mercator", () => {
|
test("style projection mercator", () => {
|
||||||
when.select("modal:settings.projection", "mercator");
|
when.select("modal:settings.projection", "mercator");
|
||||||
then(
|
then(
|
||||||
get.styleFromLocalStorage().then((style) => style.projection)
|
get.styleFromLocalStorage().then((style) => style.projection)
|
||||||
).shouldInclude({ type: "mercator" });
|
).shouldInclude({ type: "mercator" });
|
||||||
});
|
});
|
||||||
|
|
||||||
it("style projection globe", () => {
|
test("style projection globe", () => {
|
||||||
when.select("modal:settings.projection", "globe");
|
when.select("modal:settings.projection", "globe");
|
||||||
then(
|
then(
|
||||||
get.styleFromLocalStorage().then((style) => style.projection)
|
get.styleFromLocalStorage().then((style) => style.projection)
|
||||||
@@ -265,7 +266,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("style projection vertical-perspective", () => {
|
test("style projection vertical-perspective", () => {
|
||||||
when.select("modal:settings.projection", "vertical-perspective");
|
when.select("modal:settings.projection", "vertical-perspective");
|
||||||
then(
|
then(
|
||||||
get.styleFromLocalStorage().then((style) => style.projection)
|
get.styleFromLocalStorage().then((style) => style.projection)
|
||||||
@@ -273,7 +274,7 @@ describe("modals", () => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("style renderer", () => {
|
test("style renderer", () => {
|
||||||
cy.on("uncaught:exception", () => false); // this is due to the fact that this is an invalid style for openlayers
|
cy.on("uncaught:exception", () => false); // this is due to the fact that this is an invalid style for openlayers
|
||||||
when.select("modal:settings.maputnik:renderer", "ol");
|
when.select("modal:settings.maputnik:renderer", "ol");
|
||||||
then(get.inputValue("modal:settings.maputnik:renderer")).shouldEqual(
|
then(get.inputValue("modal:settings.maputnik:renderer")).shouldEqual(
|
||||||
@@ -288,7 +289,7 @@ describe("modals", () => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
it("include API key when change renderer", () => {
|
test("include API key when change renderer", () => {
|
||||||
|
|
||||||
when.click("modal:settings.close-modal");
|
when.click("modal:settings.close-modal");
|
||||||
when.click("nav:open");
|
when.click("nav:open");
|
||||||
@@ -327,7 +328,7 @@ describe("modals", () => {
|
|||||||
when.modal.open();
|
when.modal.open();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("shows duplicate id error", () => {
|
test("shows duplicate id error", () => {
|
||||||
when.setValue("add-layer.layer-id.input", "background");
|
when.setValue("add-layer.layer-id.input", "background");
|
||||||
when.click("add-layer");
|
when.click("add-layer");
|
||||||
then(get.elementByTestId("modal:add-layer")).shouldExist();
|
then(get.elementByTestId("modal:add-layer")).shouldExist();
|
||||||
@@ -338,7 +339,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("sources", () => {
|
describe("sources", () => {
|
||||||
it("toggle");
|
test("toggle");
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("global state", () => {
|
describe("global state", () => {
|
||||||
@@ -346,7 +347,7 @@ describe("modals", () => {
|
|||||||
when.click("nav:global-state");
|
when.click("nav:global-state");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("add variable", () => {
|
test("add variable", () => {
|
||||||
when.wait(100);
|
when.wait(100);
|
||||||
when.click("global-state-add-variable");
|
when.click("global-state-add-variable");
|
||||||
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
|
||||||
@@ -355,7 +356,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it("add multiple variables", () => {
|
test("add multiple variables", () => {
|
||||||
when.click("global-state-add-variable");
|
when.click("global-state-add-variable");
|
||||||
when.click("global-state-add-variable");
|
when.click("global-state-add-variable");
|
||||||
when.click("global-state-add-variable");
|
when.click("global-state-add-variable");
|
||||||
@@ -365,7 +366,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("remove variable", () => {
|
test("remove variable", () => {
|
||||||
when.click("global-state-add-variable");
|
when.click("global-state-add-variable");
|
||||||
when.click("global-state-add-variable");
|
when.click("global-state-add-variable");
|
||||||
when.click("global-state-add-variable");
|
when.click("global-state-add-variable");
|
||||||
@@ -376,7 +377,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("edit variable key", () => {
|
test("edit variable key", () => {
|
||||||
when.click("global-state-add-variable");
|
when.click("global-state-add-variable");
|
||||||
when.wait(100);
|
when.wait(100);
|
||||||
when.setValue("global-state-variable-key:0", "mykey");
|
when.setValue("global-state-variable-key:0", "mykey");
|
||||||
@@ -387,7 +388,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("edit variable value", () => {
|
test("edit variable value", () => {
|
||||||
when.click("global-state-add-variable");
|
when.click("global-state-add-variable");
|
||||||
when.wait(100);
|
when.wait(100);
|
||||||
when.setValue("global-state-variable-value:0", "myvalue");
|
when.setValue("global-state-variable-value:0", "myvalue");
|
||||||
@@ -400,11 +401,11 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("error panel", () => {
|
describe("error panel", () => {
|
||||||
it("not visible when no errors", () => {
|
test("not visible when no errors", () => {
|
||||||
then(get.element("maputnik-message-panel-error")).shouldNotExist();
|
then(get.element("maputnik-message-panel-error")).shouldNotExist();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("visible on style error", () => {
|
test("visible on style error", () => {
|
||||||
when.modal.open();
|
when.modal.open();
|
||||||
when.modal.fillLayers({
|
when.modal.fillLayers({
|
||||||
type: "circle",
|
type: "circle",
|
||||||
@@ -415,7 +416,7 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("Handle localStorage QuotaExceededError", () => {
|
describe("Handle localStorage QuotaExceededError", () => {
|
||||||
it("handles quota exceeded error when opening style from URL", () => {
|
test("handles quota exceeded error when opening style from URL", () => {
|
||||||
// Clear localStorage to start fresh
|
// Clear localStorage to start fresh
|
||||||
cy.clearLocalStorage();
|
cy.clearLocalStorage();
|
||||||
|
|
||||||
Generated
+341
-396
File diff suppressed because it is too large
Load Diff
+13
-14
@@ -28,16 +28,16 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/lang-json": "^6.0.2",
|
"@codemirror/lang-json": "^6.0.2",
|
||||||
"@codemirror/lint": "^6.9.7",
|
"@codemirror/lint": "^6.9.7",
|
||||||
"@codemirror/state": "^6.7.0",
|
"@codemirror/state": "^6.7.1",
|
||||||
"@codemirror/theme-one-dark": "^6.1.3",
|
"@codemirror/theme-one-dark": "^6.1.3",
|
||||||
"@codemirror/view": "^6.43.4",
|
"@codemirror/view": "^6.43.6",
|
||||||
"@dnd-kit/core": "^6.3.1",
|
"@dnd-kit/core": "^6.3.1",
|
||||||
"@dnd-kit/sortable": "^10.0.0",
|
"@dnd-kit/sortable": "^10.0.0",
|
||||||
"@dnd-kit/utilities": "^3.2.2",
|
"@dnd-kit/utilities": "^3.2.2",
|
||||||
"@mapbox/mapbox-gl-rtl-text": "^0.4.0",
|
"@mapbox/mapbox-gl-rtl-text": "^0.4.0",
|
||||||
"@maplibre/maplibre-gl-geocoder": "^1.9.4",
|
"@maplibre/maplibre-gl-geocoder": "^1.9.4",
|
||||||
"@maplibre/maplibre-gl-inspect": "^1.8.2",
|
"@maplibre/maplibre-gl-inspect": "^1.8.2",
|
||||||
"@maplibre/maplibre-gl-style-spec": "^25.0.1",
|
"@maplibre/maplibre-gl-style-spec": "^25.0.2",
|
||||||
"array-move": "^4.0.0",
|
"array-move": "^4.0.0",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"classnames": "^2.5.1",
|
"classnames": "^2.5.1",
|
||||||
@@ -65,15 +65,15 @@
|
|||||||
"ol-mapbox-style": "^13.4.1",
|
"ol-mapbox-style": "^13.4.1",
|
||||||
"pmtiles": "^4.4.1",
|
"pmtiles": "^4.4.1",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react": "^19.2.4",
|
"react": "^19.2.7",
|
||||||
"react-accessible-accordion": "^5.0.1",
|
"react-accessible-accordion": "^5.0.1",
|
||||||
"react-aria-menubutton": "^8.0.0",
|
"react-aria-menubutton": "^8.0.0",
|
||||||
"react-aria-modal": "^5.0.2",
|
"react-aria-modal": "^5.0.2",
|
||||||
"react-collapse": "^5.1.1",
|
"react-collapse": "^5.1.1",
|
||||||
"react-color": "^2.19.3",
|
"react-color": "^2.19.3",
|
||||||
"react-dom": "^19.2.4",
|
"react-dom": "^19.2.7",
|
||||||
"react-i18next": "^17.0.7",
|
"react-i18next": "^17.0.8",
|
||||||
"react-icons": "^5.6.0",
|
"react-icons": "^5.7.0",
|
||||||
"react-markdown": "^10.1.0",
|
"react-markdown": "^10.1.0",
|
||||||
"reconnecting-websocket": "^4.4.0",
|
"reconnecting-websocket": "^4.4.0",
|
||||||
"slugify": "^1.6.9",
|
"slugify": "^1.6.9",
|
||||||
@@ -101,7 +101,6 @@
|
|||||||
"@cypress/code-coverage": "^4.0.3",
|
"@cypress/code-coverage": "^4.0.3",
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
||||||
"@rollup/plugin-replace": "^6.0.3",
|
|
||||||
"@shellygo/cypress-test-utils": "^6.0.6",
|
"@shellygo/cypress-test-utils": "^6.0.6",
|
||||||
"@stylistic/eslint-plugin": "^5.10.0",
|
"@stylistic/eslint-plugin": "^5.10.0",
|
||||||
"@types/codemirror": "^5.60.17",
|
"@types/codemirror": "^5.60.17",
|
||||||
@@ -117,7 +116,7 @@
|
|||||||
"@types/lodash.isequal": "^4.5.8",
|
"@types/lodash.isequal": "^4.5.8",
|
||||||
"@types/lodash.throttle": "^4.1.9",
|
"@types/lodash.throttle": "^4.1.9",
|
||||||
"@types/randomcolor": "^0.5.9",
|
"@types/randomcolor": "^0.5.9",
|
||||||
"@types/react": "^19.2.14",
|
"@types/react": "^19.2.17",
|
||||||
"@types/react-aria-menubutton": "^6.2.14",
|
"@types/react-aria-menubutton": "^6.2.14",
|
||||||
"@types/react-aria-modal": "^5.0.0",
|
"@types/react-aria-modal": "^5.0.0",
|
||||||
"@types/react-collapse": "^5.0.4",
|
"@types/react-collapse": "^5.0.4",
|
||||||
@@ -125,16 +124,16 @@
|
|||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
"@types/string-hash": "^1.1.3",
|
"@types/string-hash": "^1.1.3",
|
||||||
"@types/wicg-file-system-access": "^2023.10.7",
|
"@types/wicg-file-system-access": "^2023.10.7",
|
||||||
"@vitejs/plugin-react": "^5.1.4",
|
"@vitejs/plugin-react": "5.2",
|
||||||
"@vitest/coverage-v8": "^4.1.9",
|
"@vitest/coverage-v8": "^4.1.10",
|
||||||
"cors": "^2.8.6",
|
"cors": "^2.8.6",
|
||||||
"cypress": "^15.18.0",
|
"cypress": "^15.18.0",
|
||||||
"cypress-plugin-tab": "^2.0.0",
|
"cypress-plugin-tab": "^2.0.0",
|
||||||
"eslint": "^10.6.0",
|
"eslint": "^10.6.0",
|
||||||
"eslint-plugin-react": "^7.37.5",
|
"eslint-plugin-react": "^7.37.5",
|
||||||
"eslint-plugin-react-hooks": "^7.1.1",
|
"eslint-plugin-react-hooks": "^7.1.1",
|
||||||
"eslint-plugin-react-refresh": "^0.5.2",
|
"eslint-plugin-react-refresh": "^0.5.3",
|
||||||
"i18next-cli": "^1.53.2",
|
"i18next-cli": "^1.65.0",
|
||||||
"istanbul": "^0.4.5",
|
"istanbul": "^0.4.5",
|
||||||
"istanbul-lib-coverage": "^3.2.2",
|
"istanbul-lib-coverage": "^3.2.2",
|
||||||
"postcss": "^8.5.16",
|
"postcss": "^8.5.16",
|
||||||
@@ -148,6 +147,6 @@
|
|||||||
"uuid": "^14.0.1",
|
"uuid": "^14.0.1",
|
||||||
"vite": "^7.3.2",
|
"vite": "^7.3.2",
|
||||||
"vite-plugin-istanbul": "^9.0.1",
|
"vite-plugin-istanbul": "^9.0.1",
|
||||||
"vitest": "^4.1.9"
|
"vitest": "^4.1.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"noFallthroughCasesInSwitch": true
|
"noFallthroughCasesInSwitch": true
|
||||||
},
|
},
|
||||||
"include": ["src", "cypress/e2e"],
|
"include": ["src", "cypress/e2e", "e2e/maputnik-cypress-helper.ts"],
|
||||||
"exclude": ["dist"],
|
"exclude": ["dist"],
|
||||||
"references": [{ "path": "./tsconfig.node.json" }],
|
"references": [{ "path": "./tsconfig.node.json" }],
|
||||||
// TODO: Remove when issue is resolved https://github.com/cypress-io/cypress/issues/27448
|
// TODO: Remove when issue is resolved https://github.com/cypress-io/cypress/issues/27448
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import replace from "@rollup/plugin-replace";
|
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import istanbul from "vite-plugin-istanbul";
|
import istanbul from "vite-plugin-istanbul";
|
||||||
@@ -11,14 +10,6 @@ export default defineConfig(({ mode }) => ({
|
|||||||
sourcemap: true
|
sourcemap: true
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
replace({
|
|
||||||
preventAssignment: true,
|
|
||||||
include: /\/jsonlint-lines-primitives\/lib\/jsonlint.js/,
|
|
||||||
delimiters: ["", ""],
|
|
||||||
values: {
|
|
||||||
"_token_stack:": "",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
react(),
|
react(),
|
||||||
istanbul({
|
istanbul({
|
||||||
cypress: true,
|
cypress: true,
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { defineConfig } from "vitest/config";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
// Only the unit tests that live next to the source are run by Vitest. The
|
||||||
|
// e2e specs (*.spec.ts) are run by their own runner, and the component
|
||||||
|
// browser test is run separately.
|
||||||
|
include: ["src/**/*.test.{ts,tsx}"],
|
||||||
|
exclude: ["**/node_modules/**", "e2e/**", "**/*.browser.test.tsx"],
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user