tests for isMobileAppointment
This commit is contained in:
parent
fcfd46d40f
commit
19bc2e7d2d
1 changed files with 38 additions and 1 deletions
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue