CASH-940 tests
CASH-940 tests
This commit is contained in:
parent
743040bd11
commit
082eedfdea
1 changed files with 11 additions and 6 deletions
|
|
@ -26,11 +26,6 @@ describe("policy-info-submitted.vue", () => {
|
||||||
expect(wrapper.findComponent({ name: "funnelSubHeader" }).exists()).toBe(true);
|
expect(wrapper.findComponent({ name: "funnelSubHeader" }).exists()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("renders navbar component", () => {
|
|
||||||
const { wrapper } = setupMocks();
|
|
||||||
expect(wrapper.findComponent({ name: "insuranceNavBar" }).exists()).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
test("renders Form component", () => {
|
test("renders Form component", () => {
|
||||||
const { wrapper } = setupMocks();
|
const { wrapper } = setupMocks();
|
||||||
expect(wrapper.findComponent({ name: "Form" }).exists()).toBe(true);
|
expect(wrapper.findComponent({ name: "Form" }).exists()).toBe(true);
|
||||||
|
|
@ -55,13 +50,23 @@ function setupMocks() {
|
||||||
fetchCmsContentForPage.mockResolvedValue(mockCmsContent);
|
fetchCmsContentForPage.mockResolvedValue(mockCmsContent);
|
||||||
settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent });
|
settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent });
|
||||||
|
|
||||||
|
const mockMixin = {
|
||||||
|
methods: {
|
||||||
|
getCmsContent: jest.fn((widgetName, fieldName) => {
|
||||||
|
return mockCmsContent?.[widgetName]?.[fieldName] ?? "";
|
||||||
|
}),
|
||||||
|
setCmsContent: jest.fn(),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
const mountOptions = getMountOptions({
|
const mountOptions = getMountOptions({
|
||||||
route: { name: "policy-vehicle", query: {}, params: {} },
|
route: { name: "endorsements", query: {}, params: {} },
|
||||||
router: {
|
router: {
|
||||||
navigate: jest.fn(),
|
navigate: jest.fn(),
|
||||||
navigateWithSaving: jest.fn(),
|
navigateWithSaving: jest.fn(),
|
||||||
navigateWithoutSaving: jest.fn(),
|
navigateWithoutSaving: jest.fn(),
|
||||||
},
|
},
|
||||||
|
mixins: [mockMixin],
|
||||||
});
|
});
|
||||||
|
|
||||||
const wrapper = shallowMount(policyInfoSubmitted, mountOptions);
|
const wrapper = shallowMount(policyInfoSubmitted, mountOptions);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue