getEventSourceById.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. describe('getEventSource', function() {
  2. var options;
  3. var calendarEl;
  4. beforeEach(function() {
  5. affix('#cal');
  6. calendarEl = $('#cal');
  7. options = {
  8. now: '2015-08-07',
  9. defaultView: 'agendaWeek',
  10. eventSources: [
  11. {
  12. events: [
  13. { id: 1, start: '2015-08-07T02:00:00', end: '2015-08-07T03:00:00', title: 'event A' }
  14. ],
  15. id: 'source1'
  16. },
  17. {
  18. events: [
  19. { id: 2, start: '2015-08-07T03:00:00', end: '2015-08-07T04:00:00', title: 'event B' }
  20. ],
  21. id: 'source2'
  22. },
  23. {
  24. events: [
  25. { id: 3, start: '2015-08-07T04:00:00', end: '2015-08-07T05:00:00', title: 'event C' }
  26. ],
  27. id: 'source3'
  28. }
  29. ]
  30. };
  31. });
  32. it('retreives the queried event source', function(done) {
  33. var eventSource1;
  34. var eventSource2;
  35. calendarEl.fullCalendar(options);
  36. eventSource1 = calendarEl.fullCalendar('getEventSourceById', 'source1');
  37. eventSource2 = calendarEl.fullCalendar('getEventSourceById', 'source2');
  38. expect(eventSource1.id).toBe('source1');
  39. expect(eventSource2.id).toBe('source2');
  40. done();
  41. });
  42. });