-
-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathFirstStep1.spec.js
79 lines (65 loc) · 2.51 KB
/
FirstStep1.spec.js
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import { mount } from "@vue/test-utils";
import FirstStep from "@/Components/FirstStep.vue";
describe("FirstStep.vue", () => {
const wrapper = mount(FirstStep);
it("Has the main div tag", () => {
expect(wrapper.contains(".step-content")).toBe(true);
});
it("renders without any errors", () => {
expect(wrapper.isVueInstance()).toBeTruthy();
});
it("Checks if the cardtext function return the correct answer when selected is true", () => {
wrapper.setProps({
selected: true
});
expect(wrapper.vm.cardText).toBe("stepper.FS.selected");
});
it("Checks if the cardtext function return the correct answer when selected is false", () => {
wrapper.setProps({
selected: false
});
expect(wrapper.vm.cardText).toBe("stepper.FS.not-selected");
});
it("Checks if the yesText function returns correct answer ", () => {
expect(wrapper.vm.yesText).toBe("stepper.FS.selected");
});
it("Checks if the noText function returns correct answer", () => {
expect(wrapper.vm.noText).toBe("stepper.FS.not-selected");
});
it("Checks if the yesSelected function returns the correct boolean when selected is true", () => {
wrapper.setProps({
selected: true
});
expect(wrapper.vm.yesSelected).toBe("selected");
});
it("Checks if the yesSelected function returns the correct boolean when selected is false", () => {
wrapper.setProps({
selected: false
});
expect(wrapper.vm.yesSelected).toBe("not-selected");
});
it("Checks if the get function in radio returns the correct value when selected is undefined", () => {
wrapper.setProps({
selected: undefined
});
expect(wrapper.vm.radio).toBe(undefined);
});
it("Checks if the get function in radio returns the correct value when selected is yes", () => {
wrapper.setData({
selected: "yes"
});
expect(wrapper.vm.radio).toBe("yes");
});
it("Checks if the noSelected function returns the correct boolean when selected is true", () => {
wrapper.setProps({
selected: true
});
expect(wrapper.vm.noSelected).toBe("not-selected");
});
it("Checks if the noSelected function returns the correct boolean when selected is false", () => {
wrapper.setProps({
selected: false
});
expect(wrapper.vm.noSelected).toBe("selected");
});
});