diff --git a/src/common-components/modal/modal.spec.js b/src/common-components/modal/modal.spec.js index 85472d6eb..2664accfa 100644 --- a/src/common-components/modal/modal.spec.js +++ b/src/common-components/modal/modal.spec.js @@ -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"])); }); diff --git a/src/common-components/modal/modal.vue b/src/common-components/modal/modal.vue index 9a8e6c211..d28e87bdd 100644 --- a/src/common-components/modal/modal.vue +++ b/src/common-components/modal/modal.vue @@ -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();