Prettified
This commit is contained in:
parent
49d6eb3a72
commit
192db1177b
4 changed files with 19 additions and 25 deletions
|
|
@ -51,7 +51,7 @@ describe("object-cloning-helper.js", () => {
|
||||||
|
|
||||||
const array = [9, 8, 7, 6, 5, 4, 3, 2, 1];
|
const array = [9, 8, 7, 6, 5, 4, 3, 2, 1];
|
||||||
|
|
||||||
const expected = [9, 8, 7, 6, 5, 4, 3, 2, 1];;
|
const expected = [9, 8, 7, 6, 5, 4, 3, 2, 1];
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = deepClone(array);
|
const result = deepClone(array);
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,7 @@ import { storeActions } from "@/constants/store-actions";
|
||||||
const mockStoreActionGetMobileFeePart = storeActions.GET_MOBILE_FEE_PART;
|
const mockStoreActionGetMobileFeePart = storeActions.GET_MOBILE_FEE_PART;
|
||||||
const mockStoreActionPriceOrderItemsAndSaveServerData =
|
const mockStoreActionPriceOrderItemsAndSaveServerData =
|
||||||
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA;
|
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA;
|
||||||
const mockStoreActionGetServiceabilityDetails =
|
const mockStoreActionGetServiceabilityDetails = storeActions.GET_SERVICEABILITY_DETAILS;
|
||||||
storeActions.GET_SERVICEABILITY_DETAILS;
|
|
||||||
|
|
||||||
jest.mock("@/mixins/base-mixin.js", () => ({
|
jest.mock("@/mixins/base-mixin.js", () => ({
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -44,14 +43,12 @@ jest.mock("@/mixins/base-mixin.js", () => ({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actionName === mockStoreActionGetServiceabilityDetails) {
|
if (actionName === mockStoreActionGetServiceabilityDetails) {
|
||||||
return Promise.resolve(
|
return Promise.resolve({
|
||||||
{
|
isGlassServiceableInshop: true,
|
||||||
isGlassServiceableInshop: true,
|
isRecalibrationServiceableInshop: true,
|
||||||
isRecalibrationServiceableInshop: true,
|
isGlassServiceableMobile: true,
|
||||||
isGlassServiceableMobile: true,
|
isRecalibrationServiceableMobile: true,
|
||||||
isRecalibrationServiceableMobile: true
|
});
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
@ -66,7 +63,7 @@ describe("service-location-helper.js", () => {
|
||||||
const parentAccountNumber = 167132;
|
const parentAccountNumber = 167132;
|
||||||
const billToAccountNumber = 1234;
|
const billToAccountNumber = 1234;
|
||||||
const expected = null;
|
const expected = null;
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = await getPricedMobileFeePart(
|
const result = await getPricedMobileFeePart(
|
||||||
serviceZipCode,
|
serviceZipCode,
|
||||||
|
|
@ -74,18 +71,18 @@ describe("service-location-helper.js", () => {
|
||||||
parentAccountNumber,
|
parentAccountNumber,
|
||||||
billToAccountNumber
|
billToAccountNumber
|
||||||
);
|
);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(result).toEqual(expected);
|
expect(result).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
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 damageType = "Replace";
|
const damageType = "Replace";
|
||||||
const parentAccountNumber = 167132;
|
const parentAccountNumber = 167132;
|
||||||
const billToAccountNumber = 1234;
|
const billToAccountNumber = 1234;
|
||||||
|
|
||||||
const expected = {
|
const expected = {
|
||||||
partNumber: "MOBILE FEE",
|
partNumber: "MOBILE FEE",
|
||||||
description: "MOBILE FEE",
|
description: "MOBILE FEE",
|
||||||
|
|
@ -94,7 +91,7 @@ describe("service-location-helper.js", () => {
|
||||||
sellingPrice: 0,
|
sellingPrice: 0,
|
||||||
kitPrice: 0,
|
kitPrice: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = await getPricedMobileFeePart(
|
const result = await getPricedMobileFeePart(
|
||||||
serviceZipCode,
|
serviceZipCode,
|
||||||
|
|
@ -102,7 +99,7 @@ describe("service-location-helper.js", () => {
|
||||||
parentAccountNumber,
|
parentAccountNumber,
|
||||||
billToAccountNumber
|
billToAccountNumber
|
||||||
);
|
);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(result).toEqual(expected);
|
expect(result).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
@ -112,20 +109,19 @@ describe("service-location-helper.js", () => {
|
||||||
it("Should return the serviceability details", async () => {
|
it("Should return the serviceability details", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const serviceZipCode = "43235";
|
const serviceZipCode = "43235";
|
||||||
|
|
||||||
const expected = {
|
const expected = {
|
||||||
isGlassServiceableInshop: true,
|
isGlassServiceableInshop: true,
|
||||||
isRecalibrationServiceableInshop: true,
|
isRecalibrationServiceableInshop: true,
|
||||||
isGlassServiceableMobile: true,
|
isGlassServiceableMobile: true,
|
||||||
isRecalibrationServiceableMobile: true
|
isRecalibrationServiceableMobile: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const result = await getServiceabilityDetails(serviceZipCode);
|
const result = await getServiceabilityDetails(serviceZipCode);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(result).toEqual(expected);
|
expect(result).toEqual(expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -540,7 +540,6 @@ describe("service-location.vue", () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.selectedAppointmentType).toStrictEqual("Mobile");
|
expect(wrapper.vm.selectedAppointmentType).toStrictEqual("Mobile");
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("serviceability logic", () => {
|
describe("serviceability logic", () => {
|
||||||
|
|
|
||||||
|
|
@ -486,7 +486,6 @@ describe("shop-question.vue", () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.vm.answers.length).toEqual(3);
|
expect(wrapper.vm.answers.length).toEqual(3);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function setupMocks({ mountOptions, mixins, props, isShallowMount = true }) {
|
function setupMocks({ mountOptions, mixins, props, isShallowMount = true }) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue