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 () => {
|
||||
// Arrange
|
||||
const serviceZipCode = null;
|
||||
const serviceType = "Replace";
|
||||
const parentAccountNumber = 167132
|
||||
const billToAccountNumber = 1234
|
||||
const expected = null;
|
||||
|
||||
// Act
|
||||
const result = await getPricedMobileFeePart(serviceZipCode);
|
||||
const result = await getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber);
|
||||
|
||||
// Assert
|
||||
expect(result).toEqual(expected);
|
||||
|
|
@ -60,6 +63,10 @@ describe("service-location-helper.js", () => {
|
|||
it("Should return the priced mobile fee part", async () => {
|
||||
// Arrange
|
||||
const serviceZipCode = "43235";
|
||||
const serviceType = "Replace";
|
||||
const parentAccountNumber = 167132
|
||||
const billToAccountNumber = 1234
|
||||
|
||||
const expected = {
|
||||
partNumber: "MOBILE FEE",
|
||||
description: "MOBILE FEE",
|
||||
|
|
@ -70,7 +77,7 @@ describe("service-location-helper.js", () => {
|
|||
};
|
||||
|
||||
// Act
|
||||
const result = await getPricedMobileFeePart(serviceZipCode);
|
||||
const result = await getPricedMobileFeePart(serviceZipCode, serviceType, parentAccountNumber, billToAccountNumber);
|
||||
|
||||
// Assert
|
||||
expect(result).toEqual(expected);
|
||||
|
|
|
|||
|
|
@ -300,40 +300,6 @@ describe("mobile-location-modal-questions.vue", () => {
|
|||
// Assert
|
||||
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 }) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue