Merge pull request #230 from Safelite/origin/feature/Digital/SSR-361

SSR-361
This commit is contained in:
saumyaChaturvedi123 2023-04-10 10:50:37 +05:30 committed by GitHub
commit 1059970cba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 0 deletions

View 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 };
}

View file

@ -440,6 +440,16 @@ const routingTable = function(store) {
},
],
},
{
issPageValue: issPageValues.SERVICE_LOCATION,
maps: [
{
scenario: navigationScenarios.CLICKED_BACK,
destinationIssPageValue: issPageValues.PROVIDER_PREFERENCE,
},
],
},
];
};