Update unit test.

This commit is contained in:
Bryan Mauger 2022-11-16 10:23:32 -05:00
parent 66e4184bca
commit 39966abc9f
2 changed files with 17 additions and 0 deletions

View file

@ -6,6 +6,10 @@ describe("modal.vue", () => {
// Act
const wrapper = shallowMount(Modal, {
mixins: [mockMixin],
props: {
cmsWidgetName: "test",
},
attachTo: document.body,
});
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["HeaderText"]));
});
@ -14,6 +18,10 @@ describe("modal.vue", () => {
// Act
const wrapper = shallowMount(Modal, {
mixins: [mockMixin],
props: {
cmsWidgetName: "test",
},
attachTo: document.body,
});
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["SubheaderText"]));
});
@ -22,6 +30,10 @@ describe("modal.vue", () => {
// Act
const wrapper = shallowMount(Modal, {
mixins: [mockMixin],
props: {
cmsWidgetName: "test",
},
attachTo: document.body,
});
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["Image"]));
});
@ -30,6 +42,10 @@ describe("modal.vue", () => {
// Act
const wrapper = shallowMount(Modal, {
mixins: [mockMixin],
props: {
cmsWidgetName: "test",
},
attachTo: document.body,
});
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["BodyText"]));
});

View file

@ -61,6 +61,7 @@ export default {
},
},
mounted() {
console.log("#1", document);
const modal = document.querySelector("#" + this.cmsWidgetName);
modal.addEventListener("hidden.bs.modal", (event) => {
this.$refs.buttonMain.resetButtonStyle();