Merge branch 'develop' into feature/SSR-105

This commit is contained in:
Kulbhushan Kaushik 2022-11-03 14:58:19 -04:00
commit a4ef1ace14
4 changed files with 67 additions and 25 deletions

View file

@ -39,11 +39,17 @@ describe("vehicle-make.vue", () => {
); );
//Assert //Assert
apiPromise.finally(() => { return apiPromise.finally(() => {
expect(makeQuestion.methods.initializeComponent).toHaveBeenCalledWith( try {
makeQuestionInitialData expect(makeQuestion.methods.initializeComponent).toHaveBeenCalledWith(
); makeQuestionInitialData
);
}
catch (e) {
throw e
}
}); });
}); });
test("BackButtonAction triggers a router.navigate change", async () => { test("BackButtonAction triggers a router.navigate change", async () => {
@ -68,9 +74,15 @@ describe("vehicle-make.vue", () => {
await nextTick(); await nextTick();
//Assert //Assert
apiPromise.finally(() => { return apiPromise.finally(() => {
expect(wrapper.vm.$router.navigate).toHaveBeenCalled(); try {
}); expect(wrapper.vm.$router.navigate).toHaveBeenCalled();
}
catch (e) {
throw e
}
});
}); });
test("Year set, arePagePrerequisitesValid should be true ", async () => { test("Year set, arePagePrerequisitesValid should be true ", async () => {

View file

@ -36,17 +36,23 @@ describe("vehicle-model.vue", () => {
undefined, undefined,
(c) => c(wrapper.vm) (c) => c(wrapper.vm)
); );
//Assert //Assert
apiPromise.finally(() => { return apiPromise.finally(() => {
expect(modelQuestion.methods.initializeComponent).toHaveBeenCalledWith( try {
modelQuestionInitialData expect(modelQuestion.methods.initializeComponent).toHaveBeenCalledWith(
); modelQuestionInitialData
);
}
catch (e) {
throw e
}
}); });
}); });
}); });
describe("vehicle-model.vue", () => { describe("vehicle-model.vue", () => {
test("BackButtonAction triggers a router.navigateWithoutSaving change", async () => { test("BackButtonAction triggers a router.navigate change", async () => {
//Arrange //Arrange
const { wrapper, apiPromise } = setupMocks({ const { wrapper, apiPromise } = setupMocks({
pageHeaderWidgetHeaderText: "Select a model to get started", pageHeaderWidgetHeaderText: "Select a model to get started",
@ -65,12 +71,20 @@ describe("vehicle-model.vue", () => {
); );
wrapper.vm.backButtonAction(); wrapper.vm.backButtonAction();
await nextTick(); await nextTick();
//Assert //Assert
apiPromise.finally(() => { return apiPromise.finally(() => {
expect(wrapper.vm.$router.navigate).toHaveBeenCalled(); try {
}); expect(wrapper.vm.$router.navigate).toHaveBeenCalled();
}
catch (e) {
throw e
}
});
}); });
}); });
describe("vehicle-model.vue", () => { describe("vehicle-model.vue", () => {
test("Make set, arePagePrerequisitesValid should be true ", async () => { test("Make set, arePagePrerequisitesValid should be true ", async () => {
//Arrange //Arrange

View file

@ -43,10 +43,15 @@ describe("vehicle-style.vue", () => {
); );
//Assert //Assert
apiPromise.finally(() => { return apiPromise.finally(() => {
expect(styleQuestion.methods.initializeComponent).toHaveBeenCalledWith( try {
styleQuestionInitialData expect(styleQuestion.methods.initializeComponent).toHaveBeenCalledWith(
); styleQuestionInitialData
);
}
catch (e) {
throw e
}
}); });
}); });
@ -72,8 +77,13 @@ describe("vehicle-style.vue", () => {
await nextTick(); await nextTick();
//Assert //Assert
apiPromise.finally(() => { return apiPromise.finally(() => {
expect(wrapper.vm.$router.navigate).toHaveBeenCalled(); try {
expect(wrapper.vm.$router.navigate).toHaveBeenCalled();
}
catch (e) {
throw e
}
}); });
}); });

View file

@ -36,11 +36,17 @@ describe("vehicle-year.vue", () => {
); );
//Assert //Assert
apiPromise.finally(() => { return apiPromise.finally(() => {
expect(yearQuestion.methods.initializeComponent).toHaveBeenCalledWith( try {
yearQuestionInitialData expect(yearQuestion.methods.initializeComponent).toHaveBeenCalledWith(
); yearQuestionInitialData
);
}
catch (e) {
throw e
}
}); });
}); });
}); });