| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- describe('forceEventDuration', function() {
- pushOptions({
- defaultDate: '2014-05-01',
- defaultView: 'month'
- })
- describe('when turned off', function() {
- pushOptions({
- forceEventDuration: false
- })
- it('allows a null end date for all-day and timed events', function() {
- initCalendar({
- events: [
- {
- id: '1',
- start: '2014-05-10'
- },
- {
- id: '2',
- start: '2014-05-10T14:00:00'
- }
- ]
- })
- var events = currentCalendar.clientEvents()
- expect(events[0].end).toBeNull()
- expect(events[1].end).toBeNull()
- })
- })
- describe('when turned on', function() {
- pushOptions({
- forceEventDuration: true
- })
- it('allows a null end date for all-day and timed events', function() {
- initCalendar({
- events: [
- {
- id: '1',
- start: '2014-05-10'
- },
- {
- id: '2',
- start: '2014-05-10T14:00:00'
- }
- ]
- })
- var events = currentCalendar.clientEvents()
- expect(events[0].id).toEqual('1')
- expect(moment.isMoment(events[0].end)).toEqual(true)
- expect(events[1].id).toEqual('2')
- expect(moment.isMoment(events[1].end)).toEqual(true)
- })
- })
- // NOTE: the actual verification of the correct calculation of the end
- // (using defaultTimedEventDuration and defaultAllDayEventDuration)
- // is done in those test files.
- })
|