tests for isMobileAppointment

This commit is contained in:
Bill Richardson 2023-10-05 11:31:18 -04:00
parent fcfd46d40f
commit 19bc2e7d2d

View file

@ -4,6 +4,7 @@ import globalMethods from '@/global-methods.js';
import { getRandomString, getRandomGuid, getRandomInt, getRandomBoolean } from '@/helpers/data-generation.js';
import coverageStatuses from '@/constants/coverage-statuses.js';
import { endpoints } from '@/constants/endpoints';
import { AppointmentTypeStrings } from '@/constants/schedule-constants';
describe('Store', () => {
let store;
@ -994,7 +995,7 @@ describe('Store', () => {
describe('updatePolicyITACFlag method', () => {
it('updatePolicyITACFlag updates policy.isITAC flag in store', () => {
// Assert
// Arrange
const moqIsITAC = getRandomBoolean();
// Act
@ -1004,4 +1005,40 @@ describe('Store', () => {
expect(store.order.policy.isITAC).toEqual(moqIsITAC);
});
});
describe('isMobileAppointment', () => {
it('Should return true for mobile appointments', () => {
// Arrange
// Act
store.updateServiceLocation({
appointmentType: AppointmentTypeStrings.MOBILE
});
// Assert
expect(store.isMobileAppointment).toBe(true);
});
it('Should return false for non-mobile appointments', () => {
// Arrange
// Act
store.updateServiceLocation({
appointmentType: AppointmentTypeStrings.IN_SHOP
});
// Assert
expect(store.isMobileAppointment).toBe(false);
});
it('Should return false for null appointments', () => {
// Arrange
// Act
store.updateServiceLocation({ appointmentType: null });
// Assert
expect(store.isMobileAppointment).toBe(false);
});
});
});