Update unit tests
This commit is contained in:
parent
e04ce3018b
commit
5d48014a83
1 changed files with 59 additions and 12 deletions
|
|
@ -19,6 +19,53 @@ beforeEach(() => {
|
||||||
jest.restoreAllMocks();
|
jest.restoreAllMocks();
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
store.getters = {
|
store.getters = {
|
||||||
|
submittedOrder: {
|
||||||
|
schedule: {
|
||||||
|
date: "2023-01-01",
|
||||||
|
startTime: "09:00",
|
||||||
|
endTime: "10:00",
|
||||||
|
routeCode: "000",
|
||||||
|
},
|
||||||
|
lineItems: {
|
||||||
|
glassParts: [
|
||||||
|
{
|
||||||
|
partNumber: "ABC123",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
supportingItems: [],
|
||||||
|
},
|
||||||
|
serviceLocation: {
|
||||||
|
address: "test",
|
||||||
|
address2: "123",
|
||||||
|
city: "test",
|
||||||
|
state: "AZ",
|
||||||
|
appointmentType: "Inshop",
|
||||||
|
zipCode: "12345",
|
||||||
|
zipCodeCtu: "01234",
|
||||||
|
provider: {
|
||||||
|
providerNumber: "123",
|
||||||
|
address: {
|
||||||
|
streetAddress: "test1",
|
||||||
|
city: "test",
|
||||||
|
state: "AZ",
|
||||||
|
zipCode: "12345",
|
||||||
|
zipCodeCtu: "01234",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
damage: {
|
||||||
|
isRepair: false,
|
||||||
|
},
|
||||||
|
referralNumber: "1234567",
|
||||||
|
vehicle: {
|
||||||
|
year: "2004",
|
||||||
|
make: "Ford",
|
||||||
|
model: "F Series F250",
|
||||||
|
},
|
||||||
|
customer: {
|
||||||
|
emailAddress: "test@test.com",
|
||||||
|
},
|
||||||
|
},
|
||||||
order: {
|
order: {
|
||||||
schedule: {
|
schedule: {
|
||||||
date: "2023-01-01",
|
date: "2023-01-01",
|
||||||
|
|
@ -127,9 +174,9 @@ describe("computed properties...", () => {
|
||||||
});
|
});
|
||||||
test("ScheduleTimeFormatted should return mobile time in expected format.", () => {
|
test("ScheduleTimeFormatted should return mobile time in expected format.", () => {
|
||||||
//Arrange
|
//Arrange
|
||||||
store.getters.order.serviceLocation.appointmentType = AppointmentTypeStrings.MOBILE;
|
store.getters.submittedOrder.serviceLocation.appointmentType = AppointmentTypeStrings.MOBILE;
|
||||||
store.getters.order.schedule.startTime = "09:00";
|
store.getters.submittedOrder.schedule.startTime = "09:00";
|
||||||
store.getters.order.schedule.endTime = "11:00";
|
store.getters.submittedOrder.schedule.endTime = "11:00";
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -140,9 +187,9 @@ describe("computed properties...", () => {
|
||||||
});
|
});
|
||||||
test("ScheduleTimeFormatted should return DROP_OFF time in expected format.", () => {
|
test("ScheduleTimeFormatted should return DROP_OFF time in expected format.", () => {
|
||||||
//Arrange
|
//Arrange
|
||||||
store.getters.order.serviceLocation.appointmentType = AppointmentTypeStrings.DROP_OFF;
|
store.getters.submittedOrder.serviceLocation.appointmentType = AppointmentTypeStrings.DROP_OFF;
|
||||||
store.getters.order.schedule.startTime = "09:00";
|
store.getters.submittedOrder.schedule.startTime = "09:00";
|
||||||
store.getters.order.schedule.endTime = "11:00";
|
store.getters.submittedOrder.schedule.endTime = "11:00";
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -153,9 +200,9 @@ describe("computed properties...", () => {
|
||||||
});
|
});
|
||||||
test("ScheduleTimeFormatted should return Inshop time in expected format.", () => {
|
test("ScheduleTimeFormatted should return Inshop time in expected format.", () => {
|
||||||
//Arrange
|
//Arrange
|
||||||
store.getters.order.serviceLocation.appointmentType = AppointmentTypeStrings.IN_SHOP;
|
store.getters.submittedOrder.serviceLocation.appointmentType = AppointmentTypeStrings.IN_SHOP;
|
||||||
store.getters.order.schedule.startTime = "09:00";
|
store.getters.submittedOrder.schedule.startTime = "09:00";
|
||||||
store.getters.order.schedule.endTime = "11:00";
|
store.getters.submittedOrder.schedule.endTime = "11:00";
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -166,7 +213,7 @@ describe("computed properties...", () => {
|
||||||
});
|
});
|
||||||
test("AppointmentWordingText should return mobile text in expected format.", () => {
|
test("AppointmentWordingText should return mobile text in expected format.", () => {
|
||||||
//Arrange
|
//Arrange
|
||||||
store.getters.order.serviceLocation.appointmentType = AppointmentTypeStrings.MOBILE;
|
store.getters.submittedOrder.serviceLocation.appointmentType = AppointmentTypeStrings.MOBILE;
|
||||||
|
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -177,7 +224,7 @@ describe("computed properties...", () => {
|
||||||
});
|
});
|
||||||
test("AppointmentWordingText should return DROP_OFF text in expected format.", () => {
|
test("AppointmentWordingText should return DROP_OFF text in expected format.", () => {
|
||||||
//Arrange
|
//Arrange
|
||||||
store.getters.order.serviceLocation.appointmentType = AppointmentTypeStrings.DROP_OFF;
|
store.getters.submittedOrder.serviceLocation.appointmentType = AppointmentTypeStrings.DROP_OFF;
|
||||||
|
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
|
@ -189,7 +236,7 @@ describe("computed properties...", () => {
|
||||||
});
|
});
|
||||||
test("AppointmentWordingText should return IN_SHOP text in expected format.", () => {
|
test("AppointmentWordingText should return IN_SHOP text in expected format.", () => {
|
||||||
//Arrange
|
//Arrange
|
||||||
store.getters.order.serviceLocation.appointmentType = AppointmentTypeStrings.IN_SHOP;
|
store.getters.submittedOrder.serviceLocation.appointmentType = AppointmentTypeStrings.IN_SHOP;
|
||||||
|
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue