CSR-748 Fix tests and format
This commit is contained in:
parent
daab990942
commit
33f58fda6d
5 changed files with 12 additions and 13 deletions
|
|
@ -196,7 +196,7 @@ export default {
|
|||
this.displayNonServiceableZipAlert = false;
|
||||
|
||||
return this.$router.navigateWithSaving(
|
||||
this.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS ,
|
||||
this.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS,
|
||||
this.$route
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ describe("vehicle-parts.vue", () => {
|
|||
});
|
||||
});
|
||||
|
||||
test("User had part questions > BackButtonAction triggers a router.navigateWithoutSaving change with correct scenario", async () => {
|
||||
test("User had part questions > navigateBack triggers a router.navigateWithoutSaving change with correct scenario", async () => {
|
||||
//Arrange
|
||||
const { wrapper } = setupMocks({
|
||||
mountOptionsMockData: {
|
||||
|
|
@ -248,7 +248,7 @@ describe("vehicle-parts.vue", () => {
|
|||
(c) => c(wrapper.vm)
|
||||
);
|
||||
|
||||
wrapper.vm.backButtonAction();
|
||||
wrapper.vm.navigateBack();
|
||||
|
||||
//Assert
|
||||
expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith(
|
||||
|
|
@ -257,7 +257,7 @@ describe("vehicle-parts.vue", () => {
|
|||
);
|
||||
});
|
||||
|
||||
test("User did not have part questions > BackButtonAction triggers a router.navigateWithoutSaving change with correct scenario", async () => {
|
||||
test("User did not have part questions > navigateBack triggers a router.navigateWithoutSaving change with correct scenario", async () => {
|
||||
//Arrange
|
||||
const { wrapper } = setupMocks({
|
||||
mountOptionsMockData: {
|
||||
|
|
@ -294,7 +294,7 @@ describe("vehicle-parts.vue", () => {
|
|||
(c) => c(wrapper.vm)
|
||||
);
|
||||
|
||||
wrapper.vm.backButtonAction();
|
||||
wrapper.vm.navigateBack();
|
||||
|
||||
//Assert
|
||||
expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith(
|
||||
|
|
|
|||
|
|
@ -467,7 +467,6 @@ export default {
|
|||
},
|
||||
// Can't use `this` because navigateForward is also called from quote
|
||||
navigateBack(vm) {
|
||||
console.log("HIIII")
|
||||
const self = vm ?? this;
|
||||
const partsOrQuestions = (
|
||||
self.$store.getters.pageData(fmgPageValues.PART_QUESTIONS) ??
|
||||
|
|
|
|||
|
|
@ -2243,7 +2243,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("backButtonAction", () => {
|
||||
describe("navigateBack", () => {
|
||||
// TODO KO
|
||||
test.todo(
|
||||
"current page is quote, there are no questions, and we don't have their vin => go to estimate"
|
||||
|
|
@ -2254,7 +2254,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
const { wrapper } = setupMocks({ fmgPage: fmgPageValues.QUOTE, hasVin: true });
|
||||
|
||||
// Act
|
||||
wrapper.vm.backButtonAction();
|
||||
wrapper.vm.navigateBack();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith(
|
||||
|
|
@ -2269,7 +2269,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
wrapper.vm.hasCapabilityQuestions = jest.fn().mockReturnValue(true);
|
||||
|
||||
// Act
|
||||
wrapper.vm.backButtonAction();
|
||||
wrapper.vm.navigateBack();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith(
|
||||
|
|
@ -2285,7 +2285,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
wrapper.vm.hasChildPartQuestions = jest.fn().mockReturnValue(true);
|
||||
|
||||
// Act
|
||||
wrapper.vm.backButtonAction();
|
||||
wrapper.vm.navigateBack();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith(
|
||||
|
|
@ -2303,7 +2303,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
wrapper.vm.hasCapabilityQuestions = jest.fn().mockReturnValue(true);
|
||||
|
||||
// Act
|
||||
wrapper.vm.backButtonAction();
|
||||
wrapper.vm.navigateBack();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith(
|
||||
|
|
@ -2321,7 +2321,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
wrapper.vm.hasCapabilityQuestions = jest.fn().mockReturnValue(true);
|
||||
|
||||
// Act
|
||||
wrapper.vm.backButtonAction();
|
||||
wrapper.vm.navigateBack();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith(
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ const routingTable = function (store) {
|
|||
destinationFmgPageValue: fmgPageValues.ADDRESS_LOOKUP,
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS ,
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS,
|
||||
destinationFmgPageValue: fmgPageValues.QUOTE,
|
||||
},
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in a new issue