Fixed mobile-location-modal-questions tests
This commit is contained in:
parent
09a0f932b4
commit
8ee9952538
2 changed files with 9 additions and 36 deletions
|
|
@ -48,10 +48,13 @@ describe("service-location-helper.js", () => {
|
||||||
it("Should return null if no service zip code is passed in", async () => {
|
it("Should return null if no service zip code is passed in", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const serviceZipCode = null;
|
const serviceZipCode = null;
|
||||||
|
const serviceType = "Replace";
|
||||||
|
const parentAccountNumber = 167132
|
||||||
|
const billToAccountNumber = 1234
|
||||||
const expected = null;
|
const expected = null;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = await getPricedMobileFeePart(serviceZipCode);
|
const result = await getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(result).toEqual(expected);
|
expect(result).toEqual(expected);
|
||||||
|
|
@ -60,6 +63,10 @@ describe("service-location-helper.js", () => {
|
||||||
it("Should return the priced mobile fee part", async () => {
|
it("Should return the priced mobile fee part", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const serviceZipCode = "43235";
|
const serviceZipCode = "43235";
|
||||||
|
const serviceType = "Replace";
|
||||||
|
const parentAccountNumber = 167132
|
||||||
|
const billToAccountNumber = 1234
|
||||||
|
|
||||||
const expected = {
|
const expected = {
|
||||||
partNumber: "MOBILE FEE",
|
partNumber: "MOBILE FEE",
|
||||||
description: "MOBILE FEE",
|
description: "MOBILE FEE",
|
||||||
|
|
@ -70,7 +77,7 @@ describe("service-location-helper.js", () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = await getPricedMobileFeePart(serviceZipCode);
|
const result = await getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(result).toEqual(expected);
|
expect(result).toEqual(expected);
|
||||||
|
|
|
||||||
|
|
@ -300,40 +300,6 @@ describe("mobile-location-modal-questions.vue", () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.displayInvalidZipAlert).toBe(true);
|
expect(wrapper.vm.displayInvalidZipAlert).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should clear the internal model when resetModel is called", async () => {
|
|
||||||
// Arrange
|
|
||||||
const mobileLocationQuestions = {
|
|
||||||
addressQuestions: {
|
|
||||||
streetAddress: "555 Some St",
|
|
||||||
apartmentNumberOrBusinessName: "Apt 1",
|
|
||||||
city: "Funkytown",
|
|
||||||
state: "OH",
|
|
||||||
zipCode: "55555",
|
|
||||||
},
|
|
||||||
isVehicleProtected: true,
|
|
||||||
serviceZipCode: "55555",
|
|
||||||
};
|
|
||||||
|
|
||||||
const { wrapper } = setupMocks({
|
|
||||||
mixins: [mockMixin],
|
|
||||||
props: {
|
|
||||||
modelValue: mobileLocationQuestions,
|
|
||||||
},
|
|
||||||
mountOptions: {
|
|
||||||
attachTo: document.body,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Act
|
|
||||||
wrapper.vm.resetModel();
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
expect(wrapper.vm.internalModel.addressQuestions.streetAddress).toEqual("");
|
|
||||||
expect(wrapper.vm.internalModel.addressQuestions.apartmentNumberOrBusinessName).toEqual("");
|
|
||||||
expect(wrapper.vm.internalModel.addressQuestions.city).toEqual("");
|
|
||||||
expect(wrapper.vm.internalModel.isVehicleProtected).toEqual(null);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function setupMocks({ mountOptions, mixins, props, isShallowMount = true }) {
|
function setupMocks({ mountOptions, mixins, props, isShallowMount = true }) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue