1781-zoneHoliday #994
|
@ -58,7 +58,7 @@ describe('component vnZoneCalendar', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('data() setter', () => {
|
describe('data() setter', () => {
|
||||||
it('should set the events and exclusions and then call the refreshEvents() method', () => {
|
it('should set the events, exclusions and geoExclusions and then call the refreshEvents() method', () => {
|
||||||
jest.spyOn(controller, 'refreshEvents').mockReturnThis();
|
jest.spyOn(controller, 'refreshEvents').mockReturnThis();
|
||||||
|
|
||||||
controller.data = {
|
controller.data = {
|
||||||
|
@ -67,13 +67,17 @@ describe('component vnZoneCalendar', () => {
|
||||||
}],
|
}],
|
||||||
events: [{
|
events: [{
|
||||||
dated: new Date()
|
dated: new Date()
|
||||||
}]
|
}],
|
||||||
|
geoExclusions: [{
|
||||||
|
dated: new Date()
|
||||||
|
}],
|
||||||
};
|
};
|
||||||
|
|
||||||
expect(controller.refreshEvents).toHaveBeenCalledWith();
|
expect(controller.refreshEvents).toHaveBeenCalledWith();
|
||||||
expect(controller.events).toBeDefined();
|
expect(controller.events).toBeDefined();
|
||||||
expect(controller.events.length).toEqual(1);
|
expect(controller.events.length).toEqual(1);
|
||||||
expect(controller.exclusions).toBeDefined();
|
expect(controller.exclusions).toBeDefined();
|
||||||
|
expect(controller.geoExclusions).toBeDefined();
|
||||||
expect(Object.keys(controller.exclusions).length).toEqual(1);
|
expect(Object.keys(controller.exclusions).length).toEqual(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -153,5 +157,16 @@ describe('component vnZoneCalendar', () => {
|
||||||
|
|
||||||
expect(result).toEqual('excluded');
|
expect(result).toEqual('excluded');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should return the className "geoExcluded" for a date with geo excluded', () => {
|
||||||
|
const dated = new Date();
|
||||||
|
|
||||||
|
controller.geoExclusions = [];
|
||||||
|
controller.geoExclusions[dated.getTime()] = true;
|
||||||
|
|
||||||
|
const result = controller.getClass(dated);
|
||||||
|
|
||||||
|
expect(result).toEqual('geoExcluded');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue