diff --git a/jest.config.js b/jest.config.js index ed4f38dc7..631d0b9c4 100644 --- a/jest.config.js +++ b/jest.config.js @@ -13,6 +13,8 @@ module.exports = { "!src/helpers/unit-test-helper.js", "!src/layouts/component-test/component-test.vue", "!src/layouts/form-test/form-test.vue", + "!src/layouts/license-plate-lookup/license-plate-lookup.vue", + "!src/layouts/vin-lookup/vin-lookup.vue", "!src/layouts/vehicle-damage/windshield-damage-type-question/windshield-damage-type-question.vue", "!src/layouts/vehicle-damage/windshield-options/windshield-options.vue", "!src/layouts/address-poc/address-poc.vue", @@ -32,7 +34,8 @@ module.exports = { testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"], coverageThreshold: { global: { - statements: 89, + statements: 88, + // Got the go ahead from Mark to temporarily lower this. Taking out initialize component made the year,make,model and style coverage drop a bit. Once unit tests for license plate lookup, vin lookup and address lookup are in the coverage should go back up to 90 }, }, }; diff --git a/src/common-components/funnel-footer/funnel-footer.spec.js b/src/common-components/funnel-footer/funnel-footer.spec.js index 6b2bd8335..30dc14fd3 100644 --- a/src/common-components/funnel-footer/funnel-footer.spec.js +++ b/src/common-components/funnel-footer/funnel-footer.spec.js @@ -16,8 +16,8 @@ describe("funnel-footer.vue", () => { }); const wrapper = mount(funnelFooter, { + mixins: [mockMixin] }); - wrapper.vm.initializeComponent(cmsContent); // Assert const link = wrapper.find("a"); @@ -30,6 +30,7 @@ describe("funnel-footer.vue", () => { it("Should emit ForwardClicked on button click", async () => { // Act const wrapper = mount(funnelFooter, { + mixins: [mockMixin] }); wrapper.vm.buttonClick(); // Assert @@ -39,16 +40,28 @@ describe("funnel-footer.vue", () => { it("Should emit BackClicked on link click", async () => { // Act const wrapper = mount(funnelFooter, { + mixins: [mockMixin] }); wrapper.vm.linkClick(); // Assert expect(wrapper.emitted()["BackClicked"][0]).toHaveBeenCalled; }); + it("Should change button text when update button text is called", async () => { + // Act + const wrapper = mount(funnelFooter, { + mixins: [mockMixin] + }); + wrapper.vm.updateButtonText('newText'); + + // Assert + expect(wrapper.componentVM.customButtontext).toBe('newText'); + }); + }); -//Mock CMS content -const cmsContent = { - backLink: "text", - buttonText: "text", -}; +const mockMixin = { + methods: { + getCmsContent: jest.fn() + } +} \ No newline at end of file diff --git a/src/common-components/funnel-footer/funnel-footer.vue b/src/common-components/funnel-footer/funnel-footer.vue index cb83ecae1..62b7d9147 100644 --- a/src/common-components/funnel-footer/funnel-footer.vue +++ b/src/common-components/funnel-footer/funnel-footer.vue @@ -18,6 +18,7 @@