Update unit test.
This commit is contained in:
parent
66e4184bca
commit
39966abc9f
2 changed files with 17 additions and 0 deletions
|
|
@ -6,6 +6,10 @@ describe("modal.vue", () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(Modal, {
|
const wrapper = shallowMount(Modal, {
|
||||||
mixins: [mockMixin],
|
mixins: [mockMixin],
|
||||||
|
props: {
|
||||||
|
cmsWidgetName: "test",
|
||||||
|
},
|
||||||
|
attachTo: document.body,
|
||||||
});
|
});
|
||||||
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["HeaderText"]));
|
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["HeaderText"]));
|
||||||
});
|
});
|
||||||
|
|
@ -14,6 +18,10 @@ describe("modal.vue", () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(Modal, {
|
const wrapper = shallowMount(Modal, {
|
||||||
mixins: [mockMixin],
|
mixins: [mockMixin],
|
||||||
|
props: {
|
||||||
|
cmsWidgetName: "test",
|
||||||
|
},
|
||||||
|
attachTo: document.body,
|
||||||
});
|
});
|
||||||
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["SubheaderText"]));
|
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["SubheaderText"]));
|
||||||
});
|
});
|
||||||
|
|
@ -22,6 +30,10 @@ describe("modal.vue", () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(Modal, {
|
const wrapper = shallowMount(Modal, {
|
||||||
mixins: [mockMixin],
|
mixins: [mockMixin],
|
||||||
|
props: {
|
||||||
|
cmsWidgetName: "test",
|
||||||
|
},
|
||||||
|
attachTo: document.body,
|
||||||
});
|
});
|
||||||
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["Image"]));
|
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["Image"]));
|
||||||
});
|
});
|
||||||
|
|
@ -30,6 +42,10 @@ describe("modal.vue", () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(Modal, {
|
const wrapper = shallowMount(Modal, {
|
||||||
mixins: [mockMixin],
|
mixins: [mockMixin],
|
||||||
|
props: {
|
||||||
|
cmsWidgetName: "test",
|
||||||
|
},
|
||||||
|
attachTo: document.body,
|
||||||
});
|
});
|
||||||
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["BodyText"]));
|
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["BodyText"]));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
console.log("#1", document);
|
||||||
const modal = document.querySelector("#" + this.cmsWidgetName);
|
const modal = document.querySelector("#" + this.cmsWidgetName);
|
||||||
modal.addEventListener("hidden.bs.modal", (event) => {
|
modal.addEventListener("hidden.bs.modal", (event) => {
|
||||||
this.$refs.buttonMain.resetButtonStyle();
|
this.$refs.buttonMain.resetButtonStyle();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue