-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPackagesVersions.nuxt.test.js
More file actions
45 lines (42 loc) · 1.18 KB
/
PackagesVersions.nuxt.test.js
File metadata and controls
45 lines (42 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { describe, expect, test, vi } from "vitest"
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
import { setActivePinia } from "pinia"
import { createTestingPinia } from "@pinia/testing"
import PackagesVersions from "@ogw_front/components/PackagesVersions"
import { useGeodeStore } from "@ogw_front/stores/geode"
import { vuetify } from "../../utils"
describe("PackagesVersions", async () => {
test(`Mount`, async () => {
const pinia = createTestingPinia({
createSpy: vi.fn,
})
setActivePinia(pinia)
const geodeStore = useGeodeStore()
geodeStore.base_url = ""
const schema = {
$id: "/versions",
methods: ["GET"],
type: "object",
properties: {},
additionalProperties: false,
}
registerEndpoint(schema.$id, {
method: schema.methods[0],
handler: () => ({
versions: [
{
package: "package",
version: "version",
},
],
}),
})
const wrapper = await mountSuspended(PackagesVersions, {
global: {
plugins: [vuetify, pinia],
},
props: { schema },
})
expect(wrapper.exists()).toBe(true)
})
})