fix web tests

This commit is contained in:
swithek 2026-09-19 16:24:23 +02:00
parent 7467e1eca2
commit 39a89232fa
2 changed files with 23 additions and 1 deletions

View File

@ -23,6 +23,17 @@ import {
} from "~/composables/api/test-helpers"
import { emitFrom, renderedIconNames } from "~/components/test-helpers"
// echarts measures text on a canvas, which happy-dom does not implement
vi.mock("./visualizations/LineChart.vue", () => ({
default: { name: "LineChart", render: () => null },
}))
vi.mock("./visualizations/BarChart.vue", () => ({
default: { name: "BarChart", render: () => null },
}))
vi.mock("./visualizations/GaugeChart.vue", () => ({
default: { name: "GaugeChart", render: () => null },
}))
const DOCUMENT_ID = makeXid("doc")
const BRANCH_ID = makeXid("branch")

View File

@ -1,5 +1,5 @@
import { enableAutoUnmount } from "@vue/test-utils"
import { afterEach, beforeEach, describe, it } from "vitest"
import { afterEach, beforeEach, describe, it, vi } from "vitest"
import BaseModal from "./BaseModal.client.vue"
import ConfigSidebar from "./ConfigSidebar.vue"
import VisualizationContainer from "../VisualizationContainer.vue"
@ -26,6 +26,17 @@ import {
} from "~/components/test-helpers"
import { DiffStatus } from "~/components/editor/diff/position-map"
// echarts measures text on a canvas, which happy-dom does not implement
vi.mock("../visualizations/LineChart.vue", () => ({
default: { name: "LineChart", render: () => null },
}))
vi.mock("../visualizations/BarChart.vue", () => ({
default: { name: "BarChart", render: () => null },
}))
vi.mock("../visualizations/GaugeChart.vue", () => ({
default: { name: "GaugeChart", render: () => null },
}))
const DOCUMENT_ID = makeXid("doc")
const BRANCH_ID = makeXid("branch")