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 { getRandomString, getRandomGuid, getRandomInt, getRandomBoolean } from '@/helpers/data-generation.js';
|
||||||
import coverageStatuses from '@/constants/coverage-statuses.js';
|
import coverageStatuses from '@/constants/coverage-statuses.js';
|
||||||
import { endpoints } from '@/constants/endpoints';
|
import { endpoints } from '@/constants/endpoints';
|
||||||
|
import { AppointmentTypeStrings } from '@/constants/schedule-constants';
|
||||||
|
|
||||||
describe('Store', () => {
|
describe('Store', () => {
|
||||||
let store;
|
let store;
|
||||||
|
|
@ -994,7 +995,7 @@ describe('Store', () => {
|
||||||
|
|
||||||
describe('updatePolicyITACFlag method', () => {
|
describe('updatePolicyITACFlag method', () => {
|
||||||
it('updatePolicyITACFlag updates policy.isITAC flag in store', () => {
|
it('updatePolicyITACFlag updates policy.isITAC flag in store', () => {
|
||||||
// Assert
|
// Arrange
|
||||||
const moqIsITAC = getRandomBoolean();
|
const moqIsITAC = getRandomBoolean();
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -1004,4 +1005,40 @@ describe('Store', () => {
|
||||||
expect(store.order.policy.isITAC).toEqual(moqIsITAC);
|
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