CASH-464: update unit tests
This commit is contained in:
parent
4e63f0975b
commit
980ce409e1
2 changed files with 1 additions and 47 deletions
|
|
@ -1332,6 +1332,7 @@ function setupMocks(mountOptionsMockData = {}) {
|
||||||
order: {
|
order: {
|
||||||
serviceLocation: { appointmentType: "Inshop", provider: { providerNumber: "12345" } },
|
serviceLocation: { appointmentType: "Inshop", provider: { providerNumber: "12345" } },
|
||||||
},
|
},
|
||||||
|
lineItems: { supportingItems: [] },
|
||||||
};
|
};
|
||||||
const initialMountOptionsMockData = {
|
const initialMountOptionsMockData = {
|
||||||
store: {
|
store: {
|
||||||
|
|
|
||||||
|
|
@ -441,52 +441,6 @@ describe("schedule.vue...", () => {
|
||||||
expect(testValue).toStrictEqual("01234");
|
expect(testValue).toStrictEqual("01234");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("openInshopTimeSlotsModal should trigger openModal method", () => {
|
|
||||||
// Arrange
|
|
||||||
const { wrapper } = setupMocks({});
|
|
||||||
wrapper.vm.selectableDatesData = {
|
|
||||||
days: [],
|
|
||||||
};
|
|
||||||
|
|
||||||
// Act
|
|
||||||
wrapper.vm.openInshopTimeSlotsModal();
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
expect(wrapper.vm.$refs.timeSlotModalQuestion.openModal).toBeCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("timeSlotModalClosed should null any selected date when there's no route code", () => {
|
|
||||||
// Arrange
|
|
||||||
const { wrapper } = setupMocks({});
|
|
||||||
wrapper.vm.selectableDatesData = {
|
|
||||||
days: [],
|
|
||||||
};
|
|
||||||
|
|
||||||
wrapper.setData({
|
|
||||||
selectedDate: "1980-05-05",
|
|
||||||
});
|
|
||||||
|
|
||||||
const selectedTimeSlotInfo = {
|
|
||||||
timeSlot: {
|
|
||||||
date: "2019-01-01",
|
|
||||||
startTime: "09:00",
|
|
||||||
endTime: "10:00",
|
|
||||||
routeCode: null,
|
|
||||||
},
|
|
||||||
isPremiumAppointment: null,
|
|
||||||
};
|
|
||||||
|
|
||||||
wrapper.setData({
|
|
||||||
selectedTimeSlotInfo: selectedTimeSlotInfo,
|
|
||||||
});
|
|
||||||
|
|
||||||
// Act
|
|
||||||
wrapper.vm.timeSlotModalClosed();
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
expect(wrapper.vm.selectedDate).toBe(null);
|
|
||||||
});
|
|
||||||
|
|
||||||
test("getDisplayTextForMilitaryTime should return the correctly formatted string", () => {
|
test("getDisplayTextForMilitaryTime should return the correctly formatted string", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const { wrapper } = setupMocks({});
|
const { wrapper } = setupMocks({});
|
||||||
|
|
@ -666,7 +620,6 @@ function setupMocks({ customMountOptions }) {
|
||||||
wrapper.vm.$refs.datePicker.initializeComponent = jest.fn();
|
wrapper.vm.$refs.datePicker.initializeComponent = jest.fn();
|
||||||
wrapper.vm.$refs.locationAlerts.initializeComponent = jest.fn();
|
wrapper.vm.$refs.locationAlerts.initializeComponent = jest.fn();
|
||||||
wrapper.vm.$refs.navbar.updateButtonText = jest.fn();
|
wrapper.vm.$refs.navbar.updateButtonText = jest.fn();
|
||||||
wrapper.vm.$refs.timeSlotModalQuestion.openModal = jest.fn();
|
|
||||||
|
|
||||||
return { wrapper };
|
return { wrapper };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue