Merge pull request #729 from Safelite/feature/richardson/SSR-1279
Add spinner to bailout back button.
This commit is contained in:
commit
685ea1eb04
3 changed files with 5 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import { useMainStore } from '@/store';
|
import { useMainStore } from '@/store';
|
||||||
import BailoutCode from '@/constants/bailoutCode';
|
import BailoutCode from '@/constants/bailoutCode';
|
||||||
import issPageValues from "@/router/router-constants/issPage-values";
|
import issPageValues from '@/router/router-constants/issPage-values';
|
||||||
|
|
||||||
function canBailoutNavigateBack() {
|
function canBailoutNavigateBack() {
|
||||||
const code = useMainStore().pageData(issPageValues.BAILOUT_PAGE)?.bailoutCode;
|
const code = useMainStore().pageData(issPageValues.BAILOUT_PAGE)?.bailoutCode;
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@ jest.mock('@/helpers/layout-helper.js', () => jest.fn());
|
||||||
function getMountedComponent(mainInitialState = {}, initialData = {}, methodToRunAfterInitializingStore = () => {}) {
|
function getMountedComponent(mainInitialState = {}, initialData = {}, methodToRunAfterInitializingStore = () => {}) {
|
||||||
const mountOptions = getMountOptions({
|
const mountOptions = getMountOptions({
|
||||||
router: {
|
router: {
|
||||||
navigate: jest.fn()
|
navigate: jest.fn(),
|
||||||
|
navigateWithSpinner: jest.fn()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -428,7 +429,7 @@ describe('Bailout page', () => {
|
||||||
wrapper.vm.backButtonAction();
|
wrapper.vm.backButtonAction();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(
|
expect(wrapper.vm.$router.navigateWithSpinner).toHaveBeenCalledWith(
|
||||||
wrapper.vm.navigationScenarios.CLICKED_BACK_PREVIOUS,
|
wrapper.vm.navigationScenarios.CLICKED_BACK_PREVIOUS,
|
||||||
wrapper.vm.$route
|
wrapper.vm.$route
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ export default {
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
// route to move backwards
|
// route to move backwards
|
||||||
this.mainStore.resetBailout();
|
this.mainStore.resetBailout();
|
||||||
this.$router.navigate(
|
this.$router.navigateWithSpinner(
|
||||||
this.navigationScenarios.CLICKED_BACK_PREVIOUS,
|
this.navigationScenarios.CLICKED_BACK_PREVIOUS,
|
||||||
this.$route
|
this.$route
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue