Skip to content

Commit c4b1214

Browse files
wip [skip ci]
1 parent 8800dd3 commit c4b1214

File tree

5 files changed

+54
-10
lines changed

5 files changed

+54
-10
lines changed

app/components/Viewer/Options/VisibilitySwitch.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
2-
<v-row class="pa-0" align="center">
3-
<v-col cols="auto" justify="center">
4-
<v-icon size="30" icon="mdi-eye" v-tooltip:left="'Visibility'" />
5-
</v-col>
6-
<v-col cols="auto" justify="center">
7-
<v-switch v-model="visibility" inset hide-details />
8-
</v-col>
9-
</v-row>
2+
<VRow class="pa-0" align="center">
3+
<VCol cols="auto" justify="center">
4+
<VIcon size="30" icon="mdi-eye" v-tooltip:left="'Visibility'" />
5+
</VCol>
6+
<VCol cols="auto" justify="center">
7+
<VSwitch v-model="visibility" inset hide-details />
8+
</VCol>
9+
</VRow>
1010
</template>
1111

1212
<script setup>

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@
44
"lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore .",
55
"test": "npm run test:unit",
66
"tests": "vitest --config ./tests/vitest.config.js",
7-
"test:unit": "npm run tests --project unit",
7+
"test:browser": "npm run tests --project browser",
88
"test:integration": "npm run tests --project integration",
9+
"test:unit": "npm run tests --project unit",
910
"geode_objects": "node scripts/generate_geode_objects.js && prettier ./assets/geode_objects.js --write",
1011
"build": ""
1112
},
1213
"devDependencies": {
1314
"@nuxt/test-utils": "3.21.0",
1415
"@pinia/testing": "1.0.3",
1516
"@vitejs/plugin-vue": "5.2.4",
17+
"@vitest/browser-playwright": "4.0.16",
18+
"@vitest/browser-preview": "4.0.16",
1619
"@vue/test-utils": "2.4.6",
1720
"electron": "36.4.0",
1821
"eslint": "9.26.0",
@@ -30,7 +33,7 @@
3033
"unplugin-auto-import": "20.0.0",
3134
"vite": "6.3.5",
3235
"vite-plugin-vuetify": "2.1.1",
33-
"vitest": "4.0.15",
36+
"vitest": "4.0.16",
3437
"vitest-environment-nuxt": "1.0.1"
3538
},
3639
"overrides": {
@@ -58,6 +61,7 @@
5861
"sass": "1.87.0",
5962
"semver": "7.7.1",
6063
"uuid": "11.1.0",
64+
"vitest-browser-vue": "^2.0.1",
6165
"vue3-carousel": "0.3.4",
6266
"vuetify": "3.10.11",
6367
"ws": "8.18.3",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { expect, test } from "vitest"
2+
import { render } from "vitest-browser-vue"
3+
4+
import VisibilitySwitch from "@/components/Viewer/Options/VisibilitySwitch.vue"
5+
import { vuetify } from "../../../utils"
6+
7+
console.log("VisibilitySwitch", VisibilitySwitch)
8+
9+
test("Graphic test for VisibilitySwitch", async () => {
10+
const component = await render(VisibilitySwitch, {
11+
global: {
12+
plugins: [vuetify],
13+
},
14+
})
15+
console.log("component", component)
16+
await expect(component).toMatchScreenshot()
17+
})

tests/utils.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { createVuetify } from "vuetify"
2+
import * as components from "vuetify/components"
3+
import * as directives from "vuetify/directives"
4+
const vuetify = createVuetify({ components, directives })
5+
6+
export { vuetify }

tests/vitest.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
11
import { defineConfig } from "vitest/config"
22
import { defineVitestProject } from "@nuxt/test-utils/config"
3+
import { playwright } from "@vitest/browser-playwright"
4+
// import vue from "@vitejs/plugin-vue"
35

46
const globalRetry = process.env.CI ? 3 : 0
57

68
export default defineConfig({
79
test: {
810
projects: [
11+
await defineVitestProject({
12+
// plugins: [vue()],
13+
test: {
14+
name: "browser",
15+
include: ["tests/browser/**/*.test.js"],
16+
setupFiles: ["vitest-browser-vue"],
17+
browser: {
18+
enabled: true,
19+
// headless: true,
20+
provider: playwright(),
21+
instances: [{ browser: "chromium" }],
22+
},
23+
retry: globalRetry,
24+
},
25+
}),
926
await defineVitestProject({
1027
test: {
1128
name: "unit",

0 commit comments

Comments
 (0)