getEventSourceById.js 962 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. describe('getEventSource', function() {
  2. pushOptions({
  3. now: '2015-08-07',
  4. defaultView: 'agendaWeek',
  5. eventSources: [
  6. {
  7. events: [
  8. { id: 1, start: '2015-08-07T02:00:00', end: '2015-08-07T03:00:00', title: 'event A' }
  9. ],
  10. id: 'source1'
  11. },
  12. {
  13. events: [
  14. { id: 2, start: '2015-08-07T03:00:00', end: '2015-08-07T04:00:00', title: 'event B' }
  15. ],
  16. id: 'source2'
  17. },
  18. {
  19. events: [
  20. { id: 3, start: '2015-08-07T04:00:00', end: '2015-08-07T05:00:00', title: 'event C' }
  21. ],
  22. id: 'source3'
  23. }
  24. ]
  25. })
  26. it('retreives the queried event source', function(done) {
  27. initCalendar()
  28. var eventSource1 = currentCalendar.getEventSourceById('source1')
  29. var eventSource2 = currentCalendar.getEventSourceById('source2')
  30. expect(eventSource1.id).toBe('source1')
  31. expect(eventSource2.id).toBe('source2')
  32. done()
  33. })
  34. })