@code-coaching/vuetiful 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -2,18 +2,6 @@ import { mount } from "@vue/test-utils";
|
|
|
2
2
|
import { expect, test } from "vitest";
|
|
3
3
|
import { VButton } from ".";
|
|
4
4
|
|
|
5
|
-
test("VButton using prop", async () => {
|
|
6
|
-
expect(VButton).toBeTruthy();
|
|
7
|
-
|
|
8
|
-
const vButtonElement = mount(VButton, {
|
|
9
|
-
props: {
|
|
10
|
-
msg: "John Duck",
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
expect(vButtonElement.text()).toContain("John Duck");
|
|
15
|
-
});
|
|
16
|
-
|
|
17
5
|
test("VButton using slot", async () => {
|
|
18
6
|
expect(VButton).toBeTruthy();
|
|
19
7
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { useDrawer } from "./drawer.service";
|
|
3
|
+
|
|
4
|
+
const { drawer, open, close } = useDrawer();
|
|
5
|
+
|
|
6
|
+
describe("useDrawer", () => {
|
|
7
|
+
describe("defaults", () => {
|
|
8
|
+
it("should have the default values", () => {
|
|
9
|
+
expect(drawer.id).toBe("default");
|
|
10
|
+
expect(drawer.open).toBe(false);
|
|
11
|
+
expect(drawer.position).toBe("left");
|
|
12
|
+
expect(drawer.duration).toBe(300);
|
|
13
|
+
expect(drawer.regionBackdrop).toBe("");
|
|
14
|
+
expect(drawer.regionDrawer).toBe("");
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
describe("open", () => {
|
|
19
|
+
it("should use the settings", () => {
|
|
20
|
+
open({
|
|
21
|
+
id: "test",
|
|
22
|
+
open: true,
|
|
23
|
+
position: "right",
|
|
24
|
+
duration: 150,
|
|
25
|
+
regionBackdrop: "backdrop",
|
|
26
|
+
regionDrawer: "drawer",
|
|
27
|
+
});
|
|
28
|
+
expect(drawer.id).toBe("test");
|
|
29
|
+
expect(drawer.open).toBe(true);
|
|
30
|
+
expect(drawer.position).toBe("right");
|
|
31
|
+
expect(drawer.duration).toBe(150);
|
|
32
|
+
expect(drawer.regionBackdrop).toBe("backdrop");
|
|
33
|
+
expect(drawer.regionDrawer).toBe("drawer");
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe("close", () => {
|
|
38
|
+
it("should set the drawer to close", () => {
|
|
39
|
+
open();
|
|
40
|
+
expect(drawer.open).toBe(true);
|
|
41
|
+
close();
|
|
42
|
+
expect(drawer.open).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, expect } from "vitest";
|
|
2
|
+
import { useRail } from "./rail.service";
|
|
3
|
+
|
|
4
|
+
const { selectedRailTile } = useRail();
|
|
5
|
+
|
|
6
|
+
describe("useRail", () => {
|
|
7
|
+
describe("selectedRailTile", () => {
|
|
8
|
+
selectedRailTile.value = "John Duck";
|
|
9
|
+
expect(selectedRailTile.value).toBe("John Duck");
|
|
10
|
+
});
|
|
11
|
+
});
|