Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should yield an event with an end', function(done) {
initCalendar({
defaultView: 'dayGridMonth',
defaultDate: '2019-04-01',
droppable: true,
defaultAllDayEventDuration: { days: 2 },
eventReceive(arg) {
expect(arg.event.end).toEqualDate('2019-04-04')
done()
}
})
thirdPartyDraggable = new Draggable($dragEl[0], {
eventData: {}
})
$dragEl.simulate('drag', {
end: getDayEl('2019-04-02')
})
})
})
initCalendar({
defaultView: 'dayGridMonth',
defaultDate: '2019-04-01',
droppable: true,
defaultAllDayEventDuration: { days: 2 },
eventAllow(dropInfo, draggedEvent) {
expect(draggedEvent.id).toBe('a')
expect(draggedEvent.title).toBe('hey')
expect(draggedEvent.start).toBe(null)
expect(draggedEvent.end).toBe(null)
called = true
}
})
thirdPartyDraggable = new Draggable($dragEl[0], {
eventData: {
id: 'a',
title: 'hey'
}
})
$dragEl.simulate('drag', {
end: getDayEl('2019-04-02'),
callback() {
expect(called).toBe(true)
done()
}
})
})