updated test
This commit is contained in:
parent
aa25092cc9
commit
757bb36cea
1 changed files with 23 additions and 5 deletions
|
|
@ -42,12 +42,12 @@ jest.mock(
|
||||||
);
|
);
|
||||||
|
|
||||||
jest.spyOn(baseMixin.methods, "getZipCodeData").mockImplementation((serviceZipCode) => {
|
jest.spyOn(baseMixin.methods, "getZipCodeData").mockImplementation((serviceZipCode) => {
|
||||||
let moqContainsMilitaryBase = false;
|
|
||||||
if (serviceZipCode === 45433) {
|
|
||||||
moqContainsMilitaryBase = true;
|
|
||||||
}
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
resolve({ containsMilitaryBase: moqContainsMilitaryBase, isValid: true, isServiceable: true, state: "OH", zipCodeCtu: "01820" });
|
let mockContainsMilitaryBase = false;
|
||||||
|
if (serviceZipCode === 45433 || serviceZipCode === '45433') {
|
||||||
|
mockContainsMilitaryBase = true;
|
||||||
|
}
|
||||||
|
resolve({ containsMilitaryBase: mockContainsMilitaryBase, isValid: true, isServiceable: true, state: "OH", zipCodeCtu: "01820" });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -301,6 +301,24 @@ describe("service-location.vue", () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.mobileLocationQuestions).toStrictEqual(newMobileLocationQuestions);
|
expect(wrapper.vm.mobileLocationQuestions).toStrictEqual(newMobileLocationQuestions);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("displays military zip message when zip is updated", () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = setupMocks({});
|
||||||
|
wrapper.vm.$refs.mobileLocationModalQuestions.resetComponent = jest.fn();
|
||||||
|
expect(wrapper.vm.zipContainsMilitaryBase).toBe(false);
|
||||||
|
|
||||||
|
const newServiceZipCodeQuestion = {
|
||||||
|
zipCode: "45433",
|
||||||
|
state: "OH",
|
||||||
|
};
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
wrapper.setData({zipCode: newServiceZipCodeQuestion.zipCode});
|
||||||
|
wrapper.vm.$nextTick(() => {
|
||||||
|
expect(wrapper.vm.zipContainsMilitaryBase).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("updating mobile location", () => {
|
describe("updating mobile location", () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue