Unit test fixes

This commit is contained in:
Max 2022-01-10 16:19:09 -05:00
parent 21c5316950
commit 954625229f
2 changed files with 16 additions and 9 deletions

View file

@ -43,9 +43,9 @@ export default ({
settleAllPromises(promiseResultMap).then((resultMap) => { settleAllPromises(promiseResultMap).then((resultMap) => {
// Call the "next" function to complete the transition to this page. // Call the "next" function to complete the transition to this page.
next((vm) => { next((vm) => {
vm.$refs.funnelHeader.initializeComponent(resultMap.cmsContent.FunnelHeaderWidget[0]); vm.$refs.funnelHeader.initializeComponent(resultMap.cmsContent.FunnelHeaderWidget);
vm.$refs.vehicleBanner.initializeComponent(resultMap.cmsContent.VehicleBannerWidget[0]); vm.$refs.vehicleBanner.initializeComponent(resultMap.cmsContent.VehicleBannerWidget);
vm.$refs.funnelSubHeader.initializeComponent(resultMap.cmsContent.FunnelSubHeaderWidget[0]); vm.$refs.funnelSubHeader.initializeComponent(resultMap.cmsContent.FunnelSubHeaderWidget);
console.log(resultMap.damageOptions); console.log(resultMap.damageOptions);
}); });
}); });

View file

@ -1,5 +1,6 @@
import { shallowMount, flushPromises } from "@vue/test-utils"; import { shallowMount, flushPromises } from "@vue/test-utils";
import { getMountOptions } from "@/helpers/unit-test-helper.js"; import { getMountOptions } from "@/helpers/unit-test-helper.js";
import { storeActions } from "@/constants/store-actions";
import vehicleStyle from "@/layouts/vehicle-style/vehicle-style.vue"; import vehicleStyle from "@/layouts/vehicle-style/vehicle-style.vue";
import funnelHeader from "@/common-components/funnel-header/funnel-header"; import funnelHeader from "@/common-components/funnel-header/funnel-header";
import vehicleBanner from "@/common-components/vehicle-banner/vehicle-banner"; import vehicleBanner from "@/common-components/vehicle-banner/vehicle-banner";
@ -122,7 +123,7 @@ describe("vehicle-style.vue", () => {
}); });
describe("vehicle-style.vue", () => { describe("vehicle-style.vue", () => {
test("selectVehicle triggers a store commit change", async (done) => { test("selectVehicle triggers a dispatchNonBlockingStoreAction commit", async (done) => {
//Arrange //Arrange
const { wrapper, apiPromise } = setupMocks( { const { wrapper, apiPromise } = setupMocks( {
@ -138,7 +139,13 @@ describe("vehicle-style.vue", () => {
style: '2 Door', style: '2 Door',
} }
} }
},
actionList: [
{
actionName: storeActions.GET_VEHICLE,
data: 'mockData'
} }
]
}, },
}); });
@ -148,10 +155,10 @@ describe("vehicle-style.vue", () => {
await nextTick(); await nextTick();
//Assert //Assert
// apiPromise.finally(() => { apiPromise.finally(() => {
// expect(wrapper.vm.$store.commit).toHaveBeenCalled(); expect(wrapper.vm.dispatchNonBlockingStoreAction).toHaveBeenCalled();
// done(); done();
// }); });
}); });
}); });