Unit test fixes
This commit is contained in:
parent
21c5316950
commit
954625229f
2 changed files with 16 additions and 9 deletions
|
|
@ -43,9 +43,9 @@ export default ({
|
|||
settleAllPromises(promiseResultMap).then((resultMap) => {
|
||||
// Call the "next" function to complete the transition to this page.
|
||||
next((vm) => {
|
||||
vm.$refs.funnelHeader.initializeComponent(resultMap.cmsContent.FunnelHeaderWidget[0]);
|
||||
vm.$refs.vehicleBanner.initializeComponent(resultMap.cmsContent.VehicleBannerWidget[0]);
|
||||
vm.$refs.funnelSubHeader.initializeComponent(resultMap.cmsContent.FunnelSubHeaderWidget[0]);
|
||||
vm.$refs.funnelHeader.initializeComponent(resultMap.cmsContent.FunnelHeaderWidget);
|
||||
vm.$refs.vehicleBanner.initializeComponent(resultMap.cmsContent.VehicleBannerWidget);
|
||||
vm.$refs.funnelSubHeader.initializeComponent(resultMap.cmsContent.FunnelSubHeaderWidget);
|
||||
console.log(resultMap.damageOptions);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { shallowMount, flushPromises } from "@vue/test-utils";
|
||||
import { getMountOptions } from "@/helpers/unit-test-helper.js";
|
||||
import { storeActions } from "@/constants/store-actions";
|
||||
import vehicleStyle from "@/layouts/vehicle-style/vehicle-style.vue";
|
||||
import funnelHeader from "@/common-components/funnel-header/funnel-header";
|
||||
import vehicleBanner from "@/common-components/vehicle-banner/vehicle-banner";
|
||||
|
|
@ -122,7 +123,7 @@ 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
|
||||
const { wrapper, apiPromise } = setupMocks( {
|
||||
|
|
@ -138,7 +139,13 @@ describe("vehicle-style.vue", () => {
|
|||
style: '2 Door',
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
actionList: [
|
||||
{
|
||||
actionName: storeActions.GET_VEHICLE,
|
||||
data: 'mockData'
|
||||
}
|
||||
]
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -148,10 +155,10 @@ describe("vehicle-style.vue", () => {
|
|||
await nextTick();
|
||||
|
||||
//Assert
|
||||
// apiPromise.finally(() => {
|
||||
// expect(wrapper.vm.$store.commit).toHaveBeenCalled();
|
||||
// done();
|
||||
// });
|
||||
apiPromise.finally(() => {
|
||||
expect(wrapper.vm.dispatchNonBlockingStoreAction).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue