CSR-1012 formatting

This commit is contained in:
Matt Caimi 2023-02-17 10:28:21 -05:00
parent 837c4454c8
commit 66104b1d9e

View file

@ -3,7 +3,7 @@ import serviceZipModalQuestion from "./service-zip-modal-question";
import crypto from "crypto"; import crypto from "crypto";
global.crypto = crypto; global.crypto = crypto;
jest.mock('@/digital-components/textbox-question/textbox-question', () => ({ jest.mock("@/digital-components/textbox-question/textbox-question", () => ({
getCmsContent: jest.fn((widgetName, cmsFieldName) => { getCmsContent: jest.fn((widgetName, cmsFieldName) => {
return widgetName[cmsFieldName]; return widgetName[cmsFieldName];
}), }),
@ -22,20 +22,23 @@ const mockModalCmsContent = {
}; };
const mockTextboxQuestionCmsContent = { const mockTextboxQuestionCmsContent = {
QuestionText: "Sample question text here." QuestionText: "Sample question text here.",
}; };
const mockMixin = { const mockMixin = {
methods: { methods: {
getCmsContent: jest.fn((widgetName, cmsFieldName) => { getCmsContent: jest.fn((widgetName, cmsFieldName) => {
if (widgetName === linkWidgetName) if (widgetName === linkWidgetName) {
return mockLinkCmsContent[cmsFieldName]; return mockLinkCmsContent[cmsFieldName];
}
if (widgetName === modalWidgetName) if (widgetName === modalWidgetName) {
return mockModalCmsContent[cmsFieldName]; return mockModalCmsContent[cmsFieldName];
}
if (widgetName === textboxQuestionWidgetName) if (widgetName === textboxQuestionWidgetName) {
return mockTextboxQuestionCmsContent[cmsFieldName]; return mockTextboxQuestionCmsContent[cmsFieldName];
}
return null; return null;
}), }),
@ -51,7 +54,6 @@ const mockMixin = {
}; };
describe("service-zip-modal-question.vue", () => { describe("service-zip-modal-question.vue", () => {
it("Should display text from textboxQuestionWidget", async () => { it("Should display text from textboxQuestionWidget", async () => {
const wrapper = mount(serviceZipModalQuestion, { const wrapper = mount(serviceZipModalQuestion, {
mixins: [mockMixin], mixins: [mockMixin],
@ -62,7 +64,9 @@ describe("service-zip-modal-question.vue", () => {
}, },
attachTo: document.body, attachTo: document.body,
}); });
expect(wrapper.html()).toEqual(expect.stringContaining(mockTextboxQuestionCmsContent["QuestionText"])); expect(wrapper.html()).toEqual(
expect.stringContaining(mockTextboxQuestionCmsContent["QuestionText"])
);
}); });
it("Should display footer text from modalWidget", async () => { it("Should display footer text from modalWidget", async () => {
@ -77,5 +81,4 @@ describe("service-zip-modal-question.vue", () => {
}); });
expect(wrapper.html()).toEqual(expect.stringContaining(mockModalCmsContent["FooterText"])); expect(wrapper.html()).toEqual(expect.stringContaining(mockModalCmsContent["FooterText"]));
}); });
}); });