Skip to content

Commit a952e72

Browse files
wip(tests): update
1 parent c381d8e commit a952e72

File tree

2 files changed

+119
-0
lines changed

2 files changed

+119
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// @vitest-environment nuxt
2+
3+
import { describe, expect, test } from "vitest"
4+
import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
5+
6+
import { createVuetify } from "vuetify"
7+
import * as components from "vuetify/components"
8+
import * as directives from "vuetify/directives"
9+
10+
import InspectorResultPanel from "@/components/Inspector/ResultPanel.vue"
11+
import schemas from "@geode/opengeodeweb-back/schemas.json"
12+
13+
const inspect_file_schema = schemas.opengeodeweb_back.inspect_file
14+
15+
const vuetify = createVuetify({
16+
components,
17+
directives,
18+
})
19+
20+
const inpection_result = [
21+
{
22+
title: "Brep inspection",
23+
nb_issues: 27,
24+
children: [
25+
{
26+
title: "Model topology inspection",
27+
nb_issues: 25,
28+
children: [
29+
{ title: "test topology 1", nb_issues: 25 },
30+
{ title: "test topology 2", nb_issues: 0 },
31+
],
32+
},
33+
{
34+
title: "Meshes inspection",
35+
nb_issues: 2,
36+
children: [
37+
{ title: "test meshes 1", nb_issues: 1 },
38+
{ title: "test meshes 2", nb_issues: 1 },
39+
],
40+
},
41+
],
42+
},
43+
]
44+
45+
describe("Inspector/ResultPanel.vue", async () => {
46+
test(`Test render`, async () => {
47+
const wrapper = mount(InspectorResultPanel, {
48+
global: {
49+
plugins: [vuetify],
50+
},
51+
props: { inspection_results: [], fetch_results: true },
52+
})
53+
const td = await wrapper.find("td")
54+
await wrapper.vm.$nextTick()
55+
const input = await td.find("input")
56+
await input.trigger("click")
57+
expect(wrapper.emitted()).toHaveProperty("update_values")
58+
expect(wrapper.emitted().update_values).toHaveLength(1)
59+
expect(wrapper.emitted().update_values[0][0]).toEqual({
60+
[inspection_results]: crs_list[0],
61+
})
62+
})
63+
})
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// @vitest-environment nuxt
2+
3+
import { describe, expect, test } from "vitest"
4+
import { mount } from "@vue/test-utils"
5+
6+
import { createVuetify } from "vuetify"
7+
import * as components from "vuetify/components"
8+
import * as directives from "vuetify/directives"
9+
10+
import InspectorResultPanel from "@/components/Inspector/ResultPanel.vue"
11+
12+
const vuetify = createVuetify({
13+
components,
14+
directives,
15+
})
16+
17+
const inpection_result = [
18+
{
19+
title: "Brep inspection",
20+
nb_issues: 27,
21+
children: [
22+
{
23+
title: "Model topology inspection",
24+
nb_issues: 25,
25+
children: [
26+
{ title: "test topology 1", nb_issues: 25 },
27+
{ title: "test topology 2", nb_issues: 0 },
28+
],
29+
},
30+
{
31+
title: "Meshes inspection",
32+
nb_issues: 2,
33+
children: [
34+
{ title: "test meshes 1", nb_issues: 1 },
35+
{ title: "test meshes 2", nb_issues: 1 },
36+
],
37+
},
38+
],
39+
},
40+
]
41+
42+
describe("Inspector/ResultPanel.vue", async () => {
43+
test(`Test render`, async () => {
44+
const wrapper = mount(InspectorResultPanel, {
45+
global: {
46+
plugins: [vuetify],
47+
},
48+
props: { inpection_result },
49+
})
50+
51+
const v_expansion_panels = wrapper.findComponent(
52+
components.VExpansionPanels,
53+
)
54+
console.log("v_expansion_panels", v_expansion_panels)
55+
})
56+
})

0 commit comments

Comments
 (0)