Merge pull request #435 from Safelite/defect/digital/SSR-485
Remove bailout when no vehicle found
This commit is contained in:
commit
68a985d4e9
2 changed files with 1 additions and 37 deletions
|
|
@ -476,34 +476,6 @@ describe('vin-lookup.vue', () => {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
test('Selected vehicle VIN do not match vehicles (CarIDs) in our system then navigate forward to bailout page.', async () => {
|
||||
// Arrange
|
||||
const user = userEvent.setup();
|
||||
lookupVehicleByVin.mockResponse.data.error = true;
|
||||
|
||||
jest.spyOn(VinLookupComponent.methods, lookupVehicleByVin.methodName)
|
||||
.mockResolvedValue(lookupVehicleByVinError.mockResponse);
|
||||
|
||||
mountOptions.data = () => ({
|
||||
needToLookupVehicle: true,
|
||||
bailout: true,
|
||||
vin: mockValidVin
|
||||
});
|
||||
|
||||
const { container } = render(VinLookupComponent, mountOptions);
|
||||
const continueButton = container.querySelector(continueButtonQuerySelector);
|
||||
await user.click(continueButton);
|
||||
|
||||
await flushPromises();
|
||||
await waitFor(() => {
|
||||
expect(mockRouter.navigate).toHaveBeenCalledTimes(1);
|
||||
expect(mockRouter.navigate).toHaveBeenCalledWith(
|
||||
navigationScenarios.CLICKED_FORWARD_WITH_BAILOUT,
|
||||
mockRoute
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -112,8 +112,7 @@ export default {
|
|||
vehicleFromLookup: null,
|
||||
vin: this.getVinFromStore(),
|
||||
forwardButtonCarStyle: '',
|
||||
vinPopulatedOnPageLoad: this.getVinFromStore()?.length > 0,
|
||||
bailout: false
|
||||
vinPopulatedOnPageLoad: this.getVinFromStore()?.length > 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -179,15 +178,8 @@ export default {
|
|||
// because the form itself actually passes its client-side validation.
|
||||
// SSR-189 Scenario #4.
|
||||
this.$refs.siteFooter.enableForwardAction();
|
||||
this.bailout = true;
|
||||
}
|
||||
|
||||
if (this.bailout) {
|
||||
return this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD_WITH_BAILOUT,
|
||||
this.$route
|
||||
);
|
||||
}
|
||||
// Add vin bcs the response from the service doesn't contain vin
|
||||
this.vehicleFromLookup = Object.assign(vehicleLookupResponse.data, { vin: this.vin });
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue