Merge pull request #230 from Safelite/origin/feature/Digital/SSR-361
SSR-361
This commit is contained in:
commit
1059970cba
2 changed files with 42 additions and 0 deletions
32
src/layouts/service-location/service-location.spec.js
Normal file
32
src/layouts/service-location/service-location.spec.js
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
import { shallowMount } from "@vue/test-utils";
|
||||||
|
import { getMountOptions } from "@/helpers/unit-test-helper.js";
|
||||||
|
import serviceLocationModal from "@/layouts/service-location/service-location.vue";
|
||||||
|
|
||||||
|
describe("navigation", () => {
|
||||||
|
test("if the back button is clicked, navigate back", async () => {
|
||||||
|
// Arrange
|
||||||
|
|
||||||
|
const { wrapper } = setupMocks({
|
||||||
|
});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
await wrapper.vm.backButtonAction();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(wrapper.vm.$router.navigate).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function setupMocks()
|
||||||
|
{
|
||||||
|
const wrapper = shallowMount(
|
||||||
|
serviceLocationModal,
|
||||||
|
getMountOptions({
|
||||||
|
router: {
|
||||||
|
navigate: jest.fn(),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
return { wrapper };
|
||||||
|
}
|
||||||
|
|
@ -440,6 +440,16 @@ const routingTable = function(store) {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
issPageValue: issPageValues.SERVICE_LOCATION,
|
||||||
|
maps: [
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_BACK,
|
||||||
|
destinationIssPageValue: issPageValues.PROVIDER_PREFERENCE,
|
||||||
|
},
|
||||||
|
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue