Merge pull request #729 from Safelite/feature/richardson/SSR-1279

Add spinner to bailout back button.
This commit is contained in:
brich1212safe 2024-06-03 09:44:27 -04:00 committed by GitHub
commit 685ea1eb04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions

View file

@ -1,6 +1,6 @@
import { useMainStore } from '@/store';
import BailoutCode from '@/constants/bailoutCode';
import issPageValues from "@/router/router-constants/issPage-values";
import issPageValues from '@/router/router-constants/issPage-values';
function canBailoutNavigateBack() {
const code = useMainStore().pageData(issPageValues.BAILOUT_PAGE)?.bailoutCode;

View file

@ -23,7 +23,8 @@ jest.mock('@/helpers/layout-helper.js', () => jest.fn());
function getMountedComponent(mainInitialState = {}, initialData = {}, methodToRunAfterInitializingStore = () => {}) {
const mountOptions = getMountOptions({
router: {
navigate: jest.fn()
navigate: jest.fn(),
navigateWithSpinner: jest.fn()
}
});
@ -428,7 +429,7 @@ describe('Bailout page', () => {
wrapper.vm.backButtonAction();
// Assert
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(
expect(wrapper.vm.$router.navigateWithSpinner).toHaveBeenCalledWith(
wrapper.vm.navigationScenarios.CLICKED_BACK_PREVIOUS,
wrapper.vm.$route
);

View file

@ -195,7 +195,7 @@ export default {
backButtonAction() {
// route to move backwards
this.mainStore.resetBailout();
this.$router.navigate(
this.$router.navigateWithSpinner(
this.navigationScenarios.CLICKED_BACK_PREVIOUS,
this.$route
);