Updated unit tests
This commit is contained in:
parent
6e52253f62
commit
aa47c33e69
7 changed files with 39 additions and 30 deletions
|
|
@ -31,5 +31,5 @@ module.exports = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Uncomment this to avoid the massive amount of warnings we are getting for onSubmit and onInvalidSubmit
|
// Uncomment this to avoid the massive amount of warnings we are getting for onSubmit and onInvalidSubmit
|
||||||
// silent: true,
|
silent: true,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
15
src/layouts/service-location/classes/provider-address.js
Normal file
15
src/layouts/service-location/classes/provider-address.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
export class ProviderAddress {
|
||||||
|
constructor(
|
||||||
|
streetAddress = null,
|
||||||
|
city = null,
|
||||||
|
state = null,
|
||||||
|
zipCode = null,
|
||||||
|
zipCodeCtu = null
|
||||||
|
) {
|
||||||
|
this.streetAddress = streetAddress;
|
||||||
|
this.city = city;
|
||||||
|
this.state = state;
|
||||||
|
this.zipCode = zipCode;
|
||||||
|
this.zipCodeCtu = zipCodeCtu;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
src/layouts/service-location/classes/provider.js
Normal file
8
src/layouts/service-location/classes/provider.js
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
import { ProviderAddress } from "./provider-address";
|
||||||
|
|
||||||
|
export class Provider {
|
||||||
|
constructor(providerNumber = null, address = null) {
|
||||||
|
this.providerNumber = providerNumber;
|
||||||
|
this.address = address ?? new ProviderAddress();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -74,26 +74,3 @@ export async function getAvailabilityRating(
|
||||||
|
|
||||||
return Promise.resolve(shopStatus);
|
return Promise.resolve(shopStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Provider {
|
|
||||||
constructor(providerNumber = null, address = null) {
|
|
||||||
this.providerNumber = providerNumber;
|
|
||||||
this.address = address ?? new ProviderAddress();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ProviderAddress {
|
|
||||||
constructor(
|
|
||||||
streetAddress = null,
|
|
||||||
city = null,
|
|
||||||
state = null,
|
|
||||||
zipCode = null,
|
|
||||||
zipCodeCtu = null
|
|
||||||
) {
|
|
||||||
this.streetAddress = streetAddress;
|
|
||||||
this.city = city;
|
|
||||||
this.state = state;
|
|
||||||
this.zipCode = zipCode;
|
|
||||||
this.zipCodeCtu = zipCodeCtu;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,10 @@ import { getMountOptions } from "@/helpers/unit-test-helper";
|
||||||
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import baseMixin from "@/mixins/base-mixin";
|
import baseMixin from "@/mixins/base-mixin";
|
||||||
import { getServiceabilityDetails } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
import {
|
||||||
|
getServiceabilityDetails,
|
||||||
|
Provider,
|
||||||
|
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
||||||
|
|
||||||
// Define Mocks
|
// Define Mocks
|
||||||
jest.mock("@/helpers/cms-content-helper", () => ({
|
jest.mock("@/helpers/cms-content-helper", () => ({
|
||||||
|
|
@ -16,6 +19,8 @@ jest.mock("@/helpers/cms-content-helper", () => ({
|
||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
jest.mock("./classes/provider");
|
||||||
|
|
||||||
const mockGetPricedMobileFeePart = (mockServiceZipCode) => {
|
const mockGetPricedMobileFeePart = (mockServiceZipCode) => {
|
||||||
let mobileFeePart = {};
|
let mobileFeePart = {};
|
||||||
|
|
||||||
|
|
@ -397,6 +402,7 @@ describe("service-location.vue", () => {
|
||||||
|
|
||||||
await wrapper.setData({
|
await wrapper.setData({
|
||||||
selectedAppointmentType: "Mobile",
|
selectedAppointmentType: "Mobile",
|
||||||
|
providerData: { mobileProviderNumber: "01820" },
|
||||||
});
|
});
|
||||||
|
|
||||||
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
||||||
|
|
@ -448,6 +454,7 @@ describe("service-location.vue", () => {
|
||||||
|
|
||||||
await wrapper.setData({
|
await wrapper.setData({
|
||||||
selectedAppointmentType: "Mobile",
|
selectedAppointmentType: "Mobile",
|
||||||
|
providerData: { mobileProviderNumber: "01820" },
|
||||||
});
|
});
|
||||||
|
|
||||||
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
||||||
|
|
@ -511,6 +518,7 @@ describe("service-location.vue", () => {
|
||||||
|
|
||||||
await wrapper.setData({
|
await wrapper.setData({
|
||||||
selectedAppointmentType: "Mobile",
|
selectedAppointmentType: "Mobile",
|
||||||
|
providerData: { mobileProviderNumber: "01820" },
|
||||||
});
|
});
|
||||||
|
|
||||||
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
||||||
|
|
|
||||||
|
|
@ -135,8 +135,10 @@ import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
import {
|
import {
|
||||||
getPricedMobileFeePart,
|
getPricedMobileFeePart,
|
||||||
getServiceabilityDetails,
|
getServiceabilityDetails,
|
||||||
Provider,
|
|
||||||
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
||||||
|
|
||||||
|
import { Provider } from "@/layouts/service-location/classes/provider";
|
||||||
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
||||||
// Validation
|
// Validation
|
||||||
|
|
|
||||||
|
|
@ -52,10 +52,9 @@ import { errorMessages } from "@/constants/error-messages";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import { nextTick } from "vue";
|
import { nextTick } from "vue";
|
||||||
|
|
||||||
import {
|
import { getAvailabilityRating } from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
||||||
getAvailabilityRating,
|
|
||||||
Provider,
|
import { Provider } from "@/layouts/service-location/classes/provider";
|
||||||
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
|
||||||
|
|
||||||
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue