Kaynağa Gözat

bunch more manual test lint fixes

Adam Shaw 8 yıl önce
ebeveyn
işleme
585994e5cd

+ 111 - 111
tests/util/RenderQueue.js

@@ -1,220 +1,220 @@
 
 describe('RenderQueue', function() {
-  var RenderQueue = $.fullCalendar.RenderQueue;
+  var RenderQueue = $.fullCalendar.RenderQueue
 
   it('executes atomic events in sequence', function() {
-    var ops = [];
-    var q = new RenderQueue();
+    var ops = []
+    var q = new RenderQueue()
 
     q.queue(function() {
-      ops.push('fooinit');
-    }, 'foo', 'init');
+      ops.push('fooinit')
+    }, 'foo', 'init')
 
     q.queue(function() {
-      ops.push('fooremove');
-    }, 'foo', 'add');
+      ops.push('fooremove')
+    }, 'foo', 'add')
 
     q.queue(function() {
-      ops.push('fooadd');
-    }, 'foo', 'remove');
+      ops.push('fooadd')
+    }, 'foo', 'remove')
 
     q.queue(function() {
-      ops.push('foodestroy');
-    }, 'foo', 'destroy');
+      ops.push('foodestroy')
+    }, 'foo', 'destroy')
 
-    expect(ops).toEqual([ 'fooinit', 'fooremove', 'fooadd', 'foodestroy' ]);
-  });
+    expect(ops).toEqual([ 'fooinit', 'fooremove', 'fooadd', 'foodestroy' ])
+  })
 
   describe('when accumulating', function() {
 
     describe('using clear action', function() {
 
       it('destroys add/remove operations in same namespace', function() {
-        var ops = [];
-        var q = new RenderQueue();
-        q.pause();
+        var ops = []
+        var q = new RenderQueue()
+        q.pause()
 
         q.queue(function() {
-          ops.push('fooadd');
-        }, 'foo', 'add');
+          ops.push('fooadd')
+        }, 'foo', 'add')
 
         q.queue(function() {
-          ops.push('fooremove');
-        }, 'foo', 'remove');
+          ops.push('fooremove')
+        }, 'foo', 'remove')
 
         q.queue(function() {
-          ops.push('foodestroy');
-        }, 'foo', 'destroy');
+          ops.push('foodestroy')
+        }, 'foo', 'destroy')
 
-        expect(ops).toEqual([]);
-        q.resume();
-        expect(ops).toEqual([ 'foodestroy' ]);
-      });
-    });
-  });
+        expect(ops).toEqual([])
+        q.resume()
+        expect(ops).toEqual([ 'foodestroy' ])
+      })
+    })
+  })
 
   describe('when namespace has a wait value', function() {
 
     it('unpauses when done', function(done) {
-      var ops = [];
+      var ops = []
       var q = new RenderQueue({
         foo: 100
-      });
+      })
 
       q.queue(function() {
-        ops.push('fooinit');
-      }, 'foo', 'init');
+        ops.push('fooinit')
+      }, 'foo', 'init')
 
       q.queue(function() {
-        ops.push('fooadd');
-      }, 'foo', 'add');
+        ops.push('fooadd')
+      }, 'foo', 'add')
 
-      expect(ops).toEqual([]);
+      expect(ops).toEqual([])
 
       setTimeout(function() {
-        expect(ops).toEqual([ 'fooinit', 'fooadd' ]);
-        done();
-      }, 200);
-    });
+        expect(ops).toEqual([ 'fooinit', 'fooadd' ])
+        done()
+      }, 200)
+    })
 
     it('restarts timer when new operation happens', function(done) {
-      var ops = [];
+      var ops = []
       var q = new RenderQueue({
         foo: 100
-      });
+      })
 
       q.queue(function() {
-        ops.push('fooinit');
-      }, 'foo', 'init');
+        ops.push('fooinit')
+      }, 'foo', 'init')
 
       setTimeout(function() {
         q.queue(function() {
-          ops.push('fooadd');
-        }, 'foo', 'add');
-      }, 50);
+          ops.push('fooadd')
+        }, 'foo', 'add')
+      }, 50)
 
       setTimeout(function() {
-        expect(ops).toEqual([]);
-      }, 125);
+        expect(ops).toEqual([])
+      }, 125)
 
       setTimeout(function() {
-        expect(ops).toEqual([ 'fooinit', 'fooadd' ]);
-        done();
-      }, 175);
-    });
+        expect(ops).toEqual([ 'fooinit', 'fooadd' ])
+        done()
+      }, 175)
+    })
 
     it('synchronously executes queue when sync non-namespace operation happens', function() {
-      var ops = [];
+      var ops = []
       var q = new RenderQueue({
         foo: 100
-      });
+      })
 
       q.queue(function() {
-        ops.push('fooinit');
-      }, 'foo', 'init');
+        ops.push('fooinit')
+      }, 'foo', 'init')
 
       q.queue(function() {
-        ops.push('fooadd');
-      }, 'foo', 'add');
+        ops.push('fooadd')
+      }, 'foo', 'add')
 
-      expect(ops).toEqual([]);
+      expect(ops).toEqual([])
 
       q.queue(function() {
-        ops.push('barinit');
-      }, 'bar', 'init');
+        ops.push('barinit')
+      }, 'bar', 'init')
 
-      expect(ops).toEqual([ 'fooinit', 'fooadd', 'barinit' ]);
-    });
+      expect(ops).toEqual([ 'fooinit', 'fooadd', 'barinit' ])
+    })
 
     it('synchronously executes queue when async non-namespace operation happens', function(done) {
-      var ops = [];
+      var ops = []
       var q = new RenderQueue({
         foo: 100,
         bar: 100
-      });
+      })
 
       q.queue(function() {
-        ops.push('fooinit');
-      }, 'foo', 'init');
+        ops.push('fooinit')
+      }, 'foo', 'init')
 
       q.queue(function() {
-        ops.push('fooadd');
-      }, 'foo', 'add');
+        ops.push('fooadd')
+      }, 'foo', 'add')
 
-      expect(ops).toEqual([]);
+      expect(ops).toEqual([])
 
       q.queue(function() {
-        ops.push('barinit');
-      }, 'bar', 'init');
+        ops.push('barinit')
+      }, 'bar', 'init')
 
-      expect(ops).toEqual([ 'fooinit', 'fooadd' ]);
+      expect(ops).toEqual([ 'fooinit', 'fooadd' ])
 
       setTimeout(function() {
-        expect(ops).toEqual([ 'fooinit', 'fooadd', 'barinit' ]);
-        done();
-      }, 200);
-    });
+        expect(ops).toEqual([ 'fooinit', 'fooadd', 'barinit' ])
+        done()
+      }, 200)
+    })
 
     it('resumes non-waiting tasks when unpaused', function(done) {
-      var ops = [];
+      var ops = []
       var q = new RenderQueue({
         foo: 100
-      });
+      })
 
-      q.pause();
+      q.pause()
 
       q.queue(function() {
-        ops.push('barinit');
-      }, 'bar', 'init');
+        ops.push('barinit')
+      }, 'bar', 'init')
 
       q.queue(function() {
-        ops.push('fooinit');
-      }, 'foo', 'init');
+        ops.push('fooinit')
+      }, 'foo', 'init')
 
-      q.resume();
-      expect(ops).toEqual([ 'barinit' ]);
+      q.resume()
+      expect(ops).toEqual([ 'barinit' ])
 
       setTimeout(function() {
-        expect(ops).toEqual([ 'barinit', 'fooinit' ]);
-        done();
-      }, 200);
-    });
+        expect(ops).toEqual([ 'barinit', 'fooinit' ])
+        done()
+      }, 200)
+    })
 
     it('paused+queued tasks from a previous namespace wait resume immediately', function(done) {
-      var ops = [];
+      var ops = []
       var q = new RenderQueue({
         foo: 100
-      });
+      })
 
-      q.pause();
+      q.pause()
 
       q.queue(function() {
-        ops.push('foodestroy');
-      }, 'foo', 'destroy');
+        ops.push('foodestroy')
+      }, 'foo', 'destroy')
 
       q.queue(function() {
-        ops.push('bardestroy');
-      }, 'bar', 'destroy');
+        ops.push('bardestroy')
+      }, 'bar', 'destroy')
 
-      expect(ops).toEqual([]);
+      expect(ops).toEqual([])
 
       q.queue(function() {
-        ops.push('barinit');
-      }, 'bar', 'init');
+        ops.push('barinit')
+      }, 'bar', 'init')
 
       q.queue(function() {
-        ops.push('fooinit');
-      }, 'foo', 'init');
+        ops.push('fooinit')
+      }, 'foo', 'init')
 
-      expect(ops).toEqual([]);
+      expect(ops).toEqual([])
 
-      q.resume();
-      expect(ops).toEqual([ 'foodestroy', 'bardestroy', 'barinit' ]);
+      q.resume()
+      expect(ops).toEqual([ 'foodestroy', 'bardestroy', 'barinit' ])
 
       setTimeout(function() {
-        expect(ops).toEqual([ 'foodestroy', 'bardestroy', 'barinit', 'fooinit' ]);
-        done();
-      }, 200);
-    });
-  });
-});
+        expect(ops).toEqual([ 'foodestroy', 'bardestroy', 'barinit', 'fooinit' ])
+        done()
+      }, 200)
+    })
+  })
+})

+ 78 - 78
tests/util/TaskQueue.js

@@ -1,142 +1,142 @@
 
 describe('TaskQueue', function() {
-  var TaskQueue = $.fullCalendar.TaskQueue;
+  var TaskQueue = $.fullCalendar.TaskQueue
 
   it('executes first task immediately', function() {
-    var q = new TaskQueue();
-    var ops = [];
+    var q = new TaskQueue()
+    var ops = []
 
     q.on('start', function() {
-      ops.push('start-event');
-    });
+      ops.push('start-event')
+    })
     q.on('stop', function() {
-      ops.push('stop-event');
-    });
+      ops.push('stop-event')
+    })
 
     q.queue(function() {
-      ops.push('run1');
-    });
+      ops.push('run1')
+    })
 
-    expect(ops).toEqual([ 'start-event', 'run1', 'stop-event' ]);
-  });
+    expect(ops).toEqual([ 'start-event', 'run1', 'stop-event' ])
+  })
 
   it('executes second task after first has fully completed', function() {
-    var q = new TaskQueue();
-    var ops = [];
+    var q = new TaskQueue()
+    var ops = []
 
     q.on('start', function() {
-      ops.push('start-event');
-    });
+      ops.push('start-event')
+    })
     q.on('stop', function() {
-      ops.push('stop-event');
-    });
+      ops.push('stop-event')
+    })
 
     q.queue(function() {
-      ops.push('start1');
+      ops.push('start1')
 
       q.queue(function() {
-        ops.push('run2');
-      });
+        ops.push('run2')
+      })
 
-      ops.push('stop1');
-    });
+      ops.push('stop1')
+    })
 
-    expect(ops).toEqual([ 'start-event', 'start1', 'stop1', 'run2', 'stop-event' ]);
-  });
+    expect(ops).toEqual([ 'start-event', 'start1', 'stop1', 'run2', 'stop-event' ])
+  })
 
   it('executes second task after first promise resolves', function(done) {
-    var q = new TaskQueue();
-    var ops = [];
+    var q = new TaskQueue()
+    var ops = []
 
     q.on('start', function() {
-      ops.push('start-event');
-    });
+      ops.push('start-event')
+    })
     q.on('stop', function() {
-      ops.push('stop-event');
-    });
+      ops.push('stop-event')
+    })
 
     q.queue(function() {
-      var deferred = $.Deferred();
+      var deferred = $.Deferred()
 
-      ops.push('start1');
+      ops.push('start1')
 
       q.queue(function() {
-        ops.push('run2');
-      });
+        ops.push('run2')
+      })
 
       setTimeout(function() {
-        ops.push('stop1');
-        deferred.resolve();
-      }, 100);
+        ops.push('stop1')
+        deferred.resolve()
+      }, 100)
 
-      return deferred.promise();
-    });
+      return deferred.promise()
+    })
 
     setTimeout(function() {
-      expect(ops).toEqual([ 'start-event', 'start1', 'stop1', 'run2', 'stop-event' ]);
-      done();
-    }, 200);
-  });
+      expect(ops).toEqual([ 'start-event', 'start1', 'stop1', 'run2', 'stop-event' ])
+      done()
+    }, 200)
+  })
 
   it('serially executes two tasks, the first with a promise', function(done) {
-    var q = new TaskQueue();
-    var ops = [];
+    var q = new TaskQueue()
+    var ops = []
 
     q.on('start', function() {
-      ops.push('start-event');
-    });
+      ops.push('start-event')
+    })
     q.on('stop', function() {
-      ops.push('stop-event');
-    });
+      ops.push('stop-event')
+    })
 
     q.queue(function() {
-      var deferred = $.Deferred();
+      var deferred = $.Deferred()
 
-      ops.push('start1');
+      ops.push('start1')
 
       setTimeout(function() {
-        ops.push('stop1');
-        deferred.resolve();
-      }, 100);
+        ops.push('stop1')
+        deferred.resolve()
+      }, 100)
 
-      return deferred.promise();
+      return deferred.promise()
     }, function() {
-      ops.push('run2');
-    });
+      ops.push('run2')
+    })
 
     setTimeout(function() {
-      expect(ops).toEqual([ 'start-event', 'start1', 'stop1', 'run2', 'stop-event' ]);
-      done();
-    }, 200);
-  });
+      expect(ops).toEqual([ 'start-event', 'start1', 'stop1', 'run2', 'stop-event' ])
+      done()
+    }, 200)
+  })
 
   describe('pausing', function() {
 
     it('prevents task from rendering', function() {
-      var q = new TaskQueue();
-      var ops = [];
+      var q = new TaskQueue()
+      var ops = []
 
       q.on('start', function() {
-        ops.push('start-event');
-      });
+        ops.push('start-event')
+      })
       q.on('stop', function() {
-        ops.push('stop-event');
-      });
+        ops.push('stop-event')
+      })
 
-      q.pause();
+      q.pause()
 
       q.queue(function() {
-        ops.push('run1');
-      });
+        ops.push('run1')
+      })
       q.queue(function() {
-        ops.push('run2');
-      });
+        ops.push('run2')
+      })
 
-      expect(ops).toEqual([ ]);
+      expect(ops).toEqual([ ])
 
-      q.resume();
+      q.resume()
 
-      expect(ops).toEqual([ 'start-event', 'run1', 'run2', 'stop-event' ]);
-    });
-  });
-});
+      expect(ops).toEqual([ 'start-event', 'run1', 'run2', 'stop-event' ])
+    })
+  })
+})

+ 12 - 12
tests/view-dates/ViewDateUtils.js

@@ -1,23 +1,23 @@
 
 export function expectRenderRange(start, end) {
-  var currentView = currentCalendar.getView();
-  var dateProfile = currentView.dateProfile;
+  var currentView = currentCalendar.getView()
+  var dateProfile = currentView.dateProfile
 
-  var renderRangeStart = currentCalendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs, dateProfile.isRangeAllDay);
-  var renderRangeEnd = currentCalendar.msToUtcMoment(dateProfile.renderUnzonedRange.endMs, dateProfile.isRangeAllDay);
+  var renderRangeStart = currentCalendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs, dateProfile.isRangeAllDay)
+  var renderRangeEnd = currentCalendar.msToUtcMoment(dateProfile.renderUnzonedRange.endMs, dateProfile.isRangeAllDay)
 
-  expect(renderRangeStart).toEqualMoment(start);
-  expect(renderRangeEnd).toEqualMoment(end);
+  expect(renderRangeStart).toEqualMoment(start)
+  expect(renderRangeEnd).toEqualMoment(end)
 }
 
 
 export function expectActiveRange(start, end) {
-  var currentView = currentCalendar.getView();
-  var dateProfile = currentView.dateProfile;
+  var currentView = currentCalendar.getView()
+  var dateProfile = currentView.dateProfile
 
-  var activeRangeStart = currentCalendar.msToUtcMoment(dateProfile.activeUnzonedRange.startMs, dateProfile.isRangeAllDay);
-  var activeRangeEnd = currentCalendar.msToUtcMoment(dateProfile.activeUnzonedRange.endMs, dateProfile.isRangeAllDay);
+  var activeRangeStart = currentCalendar.msToUtcMoment(dateProfile.activeUnzonedRange.startMs, dateProfile.isRangeAllDay)
+  var activeRangeEnd = currentCalendar.msToUtcMoment(dateProfile.activeUnzonedRange.endMs, dateProfile.isRangeAllDay)
 
-  expect(activeRangeStart).toEqualMoment(start);
-  expect(activeRangeEnd).toEqualMoment(end);
+  expect(activeRangeStart).toEqualMoment(start)
+  expect(activeRangeEnd).toEqualMoment(end)
 }

+ 13 - 13
tests/view-dates/dateAlignment.js

@@ -1,4 +1,4 @@
-import { expectActiveRange } from './ViewDateUtils';
+import { expectActiveRange } from './ViewDateUtils'
 
 /*
 SEE ALSO: next/prev
@@ -8,28 +8,28 @@ describe('dateAlignment', function() {
     defaultView: 'agenda',
     dateAlignment: 'week',
     defaultDate: '2017-06-15'
-  });
+  })
 
   describe('when 3 day duration', function() {
     pushOptions({
       duration: { days: 3 }
-    });
+    })
 
     it('aligns with the week', function() {
-      initCalendar();
-      expectActiveRange('2017-06-11', '2017-06-14');
-    });
-  });
+      initCalendar()
+      expectActiveRange('2017-06-11', '2017-06-14')
+    })
+  })
 
   describe('when 5 day count', function() {
     pushOptions({
       dayCount: 5,
       weekends: false
-    });
+    })
 
     it('aligns with first visible day of the week', function() {
-      initCalendar();
-      expectActiveRange('2017-06-12', '2017-06-17');
-    });
-  });
-});
+      initCalendar()
+      expectActiveRange('2017-06-12', '2017-06-17')
+    })
+  })
+})

+ 31 - 31
tests/view-dates/dayCount.js

@@ -1,11 +1,11 @@
-import { expectActiveRange } from './ViewDateUtils';
-import { expectDay } from '../view-render/ViewRenderUtils';
+import { expectActiveRange } from './ViewDateUtils'
+import { expectDay } from '../view-render/ViewRenderUtils'
 
 describe('dayCount', function() {
   pushOptions({
     defaultDate: '2017-03-15', // wed
     weekends: false
-  });
+  })
 
   describeOptions({
     'when specified as top-level options': {
@@ -23,36 +23,36 @@ describe('dayCount', function() {
     }
   }, function() {
     it('renders the exact day count', function() {
-      initCalendar();
-      expectActiveRange('2017-03-15', '2017-03-22');
-      expectDay('2017-03-15', true);
-      expectDay('2017-03-16', true);
-      expectDay('2017-03-17', true);
-      expectDay('2017-03-18', false); // sat
-      expectDay('2017-03-19', false); // sun
-      expectDay('2017-03-20', true);
-      expectDay('2017-03-21', true);
-    });
-  });
+      initCalendar()
+      expectActiveRange('2017-03-15', '2017-03-22')
+      expectDay('2017-03-15', true)
+      expectDay('2017-03-16', true)
+      expectDay('2017-03-17', true)
+      expectDay('2017-03-18', false) // sat
+      expectDay('2017-03-19', false) // sun
+      expectDay('2017-03-20', true)
+      expectDay('2017-03-21', true)
+    })
+  })
 
   it('can span multiple weeks', function() {
     initCalendar({
       defaultView: 'agenda',
       dayCount: 9
-    });
-    expectActiveRange('2017-03-15', '2017-03-28');
-    expectDay('2017-03-15', true);
-    expectDay('2017-03-16', true);
-    expectDay('2017-03-17', true);
-    expectDay('2017-03-18', false); // sat
-    expectDay('2017-03-19', false); // sun
-    expectDay('2017-03-20', true);
-    expectDay('2017-03-21', true);
-    expectDay('2017-03-22', true);
-    expectDay('2017-03-23', true);
-    expectDay('2017-03-24', true);
-    expectDay('2017-03-25', false); // sat
-    expectDay('2017-03-26', false); // sun
-    expectDay('2017-03-27', true);
-  });
-});
+    })
+    expectActiveRange('2017-03-15', '2017-03-28')
+    expectDay('2017-03-15', true)
+    expectDay('2017-03-16', true)
+    expectDay('2017-03-17', true)
+    expectDay('2017-03-18', false) // sat
+    expectDay('2017-03-19', false) // sun
+    expectDay('2017-03-20', true)
+    expectDay('2017-03-21', true)
+    expectDay('2017-03-22', true)
+    expectDay('2017-03-23', true)
+    expectDay('2017-03-24', true)
+    expectDay('2017-03-25', false) // sat
+    expectDay('2017-03-26', false) // sun
+    expectDay('2017-03-27', true)
+  })
+})

+ 10 - 10
tests/view-dates/gotoDate.js

@@ -5,25 +5,25 @@ describe('gotoDate', function() {
     pushOptions({
       events: function(start, end, timezone, callback) {
         setTimeout(function() {
-          callback([]);
-        }, 0);
+          callback([])
+        }, 0)
       }
-    });
+    })
 
     it('works when called right after initialization', function() {
       initCalendar({
         defaultView: 'month',
         defaultDate: '2017-03-30'
-      });
-      currentCalendar.gotoDate('2017-06-01');
-    });
+      })
+      currentCalendar.gotoDate('2017-06-01')
+    })
 
     it('works when called right after initialization when date already in range', function() {
       initCalendar({
         defaultView: 'month',
         defaultDate: '2017-03-30'
-      });
-      currentCalendar.gotoDate('2017-03-01');
-    });
+      })
+      currentCalendar.gotoDate('2017-03-01')
+    })
   })
-});
+})

+ 66 - 66
tests/view-dates/next.js

@@ -1,23 +1,23 @@
-import { expectActiveRange } from './ViewDateUtils';
-import * as TimeGridRenderUtils from '../view-render/TimeGridRenderUtils';
+import { expectActiveRange } from './ViewDateUtils'
+import * as TimeGridRenderUtils from '../view-render/TimeGridRenderUtils'
 
 
 describe('next', function() {
   pushOptions({
     defaultDate: '2017-06-08'
-  });
+  })
 
   describe('when in agendaWeek view', function() {
     pushOptions({
       defaultView: 'agendaWeek'
-    });
+    })
 
     describe('when dateIncrement not specified', function() {
       it('moves forward by one week', function() {
-        initCalendar();
-        currentCalendar.next();
-        expectActiveRange('2017-06-11', '2017-06-18');
-      });
+        initCalendar()
+        currentCalendar.next()
+        expectActiveRange('2017-06-11', '2017-06-18')
+      })
     })
 
     describeOptions('dateIncrement', {
@@ -26,123 +26,123 @@ describe('next', function() {
       'when two week dateIncrement specified as a string': '14.00:00:00'
     }, function() {
       it('moves forward by two weeks', function() {
-        initCalendar();
-        currentCalendar.next();
-        expectActiveRange('2017-06-18', '2017-06-25');
-      });
-    });
+        initCalendar()
+        currentCalendar.next()
+        expectActiveRange('2017-06-18', '2017-06-25')
+      })
+    })
 
     it('does not duplicate-render skeleton', function() {
-      initCalendar();
-      currentCalendar.next();
-      expect(TimeGridRenderUtils.isStructureValid()).toBe(true);
-    });
-  });
+      initCalendar()
+      currentCalendar.next()
+      expect(TimeGridRenderUtils.isStructureValid()).toBe(true)
+    })
+  })
 
   describe('when in a month view', function() {
     pushOptions({
       defaultView: 'month'
-    });
+    })
 
     describe('when dateIncrement not specified', function() {
 
       it('moves forward by one month', function() {
-        initCalendar();
-        currentCalendar.next();
-        expectActiveRange('2017-06-25', '2017-08-06');
-      });
-    });
+        initCalendar()
+        currentCalendar.next()
+        expectActiveRange('2017-06-25', '2017-08-06')
+      })
+    })
 
     describe('when two month dateIncrement is specified', function() {
       pushOptions({
         dateIncrement: { months: 2 }
-      });
+      })
 
       it('moves forward by two months', function() {
-        initCalendar();
-        currentCalendar.next();
-        expectActiveRange('2017-07-30', '2017-09-10');
-      });
-    });
-  });
+        initCalendar()
+        currentCalendar.next()
+        expectActiveRange('2017-07-30', '2017-09-10')
+      })
+    })
+  })
 
   describe('when in custom three day view', function() {
     pushOptions({
       defaultView: 'basic',
       duration: { days: 3 }
-    });
+    })
 
     describe('when no dateAlignment is specified', function() {
 
       describe('when dateIncrement not specified', function() {
         it('moves forward three days', function() {
-          initCalendar();
-          currentCalendar.next();
-          expectActiveRange('2017-06-11', '2017-06-14');
-        });
-      });
+          initCalendar()
+          currentCalendar.next()
+          expectActiveRange('2017-06-11', '2017-06-14')
+        })
+      })
 
       describe('when two day dateIncrement is specified', function() {
         pushOptions({
           dateIncrement: { days: 2 }
         })
         it('moves forward two days', function() {
-          initCalendar();
-          currentCalendar.next();
-          expectActiveRange('2017-06-10', '2017-06-13');
-        });
-      });
+          initCalendar()
+          currentCalendar.next()
+          expectActiveRange('2017-06-10', '2017-06-13')
+        })
+      })
     })
 
     describe('when week dateAlignment is specified', function() {
       pushOptions({
         dateAlignment: 'week'
-      });
+      })
 
       describe('when dateIncrement not specified', function() {
         it('moves forward one week', function() {
-          initCalendar();
-          currentCalendar.next();
-          expectActiveRange('2017-06-11', '2017-06-14');
-        });
-      });
+          initCalendar()
+          currentCalendar.next()
+          expectActiveRange('2017-06-11', '2017-06-14')
+        })
+      })
 
       describe('when two day dateIncrement is specified', function() {
         pushOptions({
           dateIncrement: { days: 2 }
-        });
+        })
 
         it('does not navigate nor rerender', function() {
-          var called;
+          var called
 
           initCalendar({
             viewRender: function() {
-              called = true;
+              called = true
             }
-          });
+          })
 
-          called = false;
-          currentCalendar.next();
+          called = false
+          currentCalendar.next()
 
-          expectActiveRange('2017-06-04', '2017-06-07'); // the same as how it started
-          expect(called).toBe(false);
-        });
-      });
-    });
-  });
+          expectActiveRange('2017-06-04', '2017-06-07') // the same as how it started
+          expect(called).toBe(false)
+        })
+      })
+    })
+  })
 
   describe('when in a custom two day view and weekends:false', function() {
     pushOptions({
       weekends: false,
       defaultView: 'agenda',
       duration: { days: 2 }
-    });
+    })
 
     it('skips over weekends if there would be alignment with weekend', function() {
       initCalendar({
         defaultDate: '2017-11-09'
-      });
-      currentCalendar.next();
-    });
-  });
-});
+      })
+      currentCalendar.next()
+    })
+  })
+})

+ 15 - 15
tests/view-dates/prev.js

@@ -3,34 +3,34 @@ SEE ALSO:
 - next (does core of date switching)
 */
 
-import { expectActiveRange } from './ViewDateUtils';
+import { expectActiveRange } from './ViewDateUtils'
 
 describe('prev', function() {
   pushOptions({
     defaultDate: '2017-06-08'
-  });
+  })
 
   describe('when in a week view', function() {
     pushOptions({
       defaultView: 'agendaWeek'
-    });
+    })
 
     it('moves back by one week', function() {
-      initCalendar();
-      currentCalendar.prev();
-      expectActiveRange('2017-05-28', '2017-06-04');
-    });
+      initCalendar()
+      currentCalendar.prev()
+      expectActiveRange('2017-05-28', '2017-06-04')
+    })
 
     describe('when two week dateIncrement', function() {
       pushOptions({
         dateIncrement: { weeks: 2 }
-      });
+      })
 
       it('moves back by two weeks', function() {
-        initCalendar();
-        currentCalendar.prev();
-        expectActiveRange('2017-05-21', '2017-05-28');
-      });
-    });
-  });
-});
+        initCalendar()
+        currentCalendar.prev()
+        expectActiveRange('2017-05-21', '2017-05-28')
+      })
+    })
+  })
+})

+ 76 - 76
tests/view-dates/validRange.js

@@ -1,78 +1,78 @@
-import { expectActiveRange, expectRenderRange } from './ViewDateUtils';
+import { expectActiveRange, expectRenderRange } from './ViewDateUtils'
 
 describe('validRange', function() {
   pushOptions({
     defaultDate: '2017-06-08'
-  });
+  })
 
   describe('when one week view', function() { // a view that has date-alignment by default
     pushOptions({
       defaultView: 'agendaWeek' // default range = 2017-06-04 - 2017-06-11
-    });
+    })
 
     describe('when default range is partially before validRange', function() {
       pushOptions({
         validRange: { start: '2017-06-06' }
-      });
+      })
 
       it('allows full renderRange but restricts activeRange', function() {
-        initCalendar();
-        expectRenderRange('2017-06-04', '2017-06-11');
-        expectActiveRange('2017-06-06', '2017-06-11');
-      });
-    });
+        initCalendar()
+        expectRenderRange('2017-06-04', '2017-06-11')
+        expectActiveRange('2017-06-06', '2017-06-11')
+      })
+    })
 
     describe('when default range is partially after validRange', function() {
       pushOptions({
         validRange: { end: '2017-06-05' }
-      });
+      })
 
       it('allows full renderRange but restricts activeRange', function() {
-        initCalendar();
-        expectRenderRange('2017-06-04', '2017-06-11');
-        expectActiveRange('2017-06-04', '2017-06-05');
-      });
-    });
+        initCalendar()
+        expectRenderRange('2017-06-04', '2017-06-11')
+        expectActiveRange('2017-06-04', '2017-06-05')
+      })
+    })
 
     describe('when default range is completely before validRange', function() {
       pushOptions({
         validRange: { start: '2017-06-14' } // a Wednesday
-      });
+      })
 
       it('initializes at earliest partially visible week', function() {
-        initCalendar();
-        expectRenderRange('2017-06-11', '2017-06-18');
-        expectActiveRange('2017-06-14', '2017-06-18');
-      });
-    });
+        initCalendar()
+        expectRenderRange('2017-06-11', '2017-06-18')
+        expectActiveRange('2017-06-14', '2017-06-18')
+      })
+    })
 
     describe('when default range is completely before validRange', function() {
       pushOptions({
         validRange: { end: '2017-05-24' } // a Wednesday
-      });
+      })
 
       it('initializes at latest partially visible week', function() {
-        initCalendar();
-        expectRenderRange('2017-05-21', '2017-05-28');
-        expectActiveRange('2017-05-21', '2017-05-24');
-      });
-    });
+        initCalendar()
+        expectRenderRange('2017-05-21', '2017-05-28')
+        expectActiveRange('2017-05-21', '2017-05-24')
+      })
+    })
 
     describe('when validRange is a function', function() {
-      var nowInput = '2017-06-09T06:00:00';
+      var nowInput = '2017-06-09T06:00:00'
 
       it('receives the nowDate, timezoneless', function() {
         var validRangeSpy = spyOnCalendarCallback('validRange', function(date) {
-          expect(moment.isMoment(date)).toBe(true);
-          expect(date).toEqualMoment(nowInput);
-        });
+          expect(moment.isMoment(date)).toBe(true)
+          expect(date).toEqualMoment(nowInput)
+        })
 
         initCalendar({
           now: nowInput
-        });
+        })
 
-        expect(validRangeSpy).toHaveBeenCalled();
-      });
+        expect(validRangeSpy).toHaveBeenCalled()
+      })
 
       /* getNow() always returns ambig zone for some reason. intentional?
       xit('receives the nowDate, with UTC timezone', function() {
@@ -86,72 +86,72 @@ describe('validRange', function() {
         });
 
         expect(validRangeSpy).toHaveBeenCalled();
-      });*/
+      }); */
 
       it('can return a range object with strings', function() {
         var validRangeSpy = spyOnCalendarCallback('validRange', function() {
-          return { start: '2017-06-06' };
-        });
+          return { start: '2017-06-06' }
+        })
 
-        initCalendar();
+        initCalendar()
 
-        expect(validRangeSpy).toHaveBeenCalled();
-        expectRenderRange('2017-06-04', '2017-06-11');
-        expectActiveRange('2017-06-06', '2017-06-11');
-      });
+        expect(validRangeSpy).toHaveBeenCalled()
+        expectRenderRange('2017-06-04', '2017-06-11')
+        expectActiveRange('2017-06-06', '2017-06-11')
+      })
 
       it('can return a range object with moments', function() {
         var validRangeSpy = spyOnCalendarCallback('validRange', function() {
-          return { start: $.fullCalendar.moment.parseZone('2017-06-06') };
-        });
+          return { start: $.fullCalendar.moment.parseZone('2017-06-06') }
+        })
 
-        initCalendar();
+        initCalendar()
 
-        expect(validRangeSpy).toHaveBeenCalled();
-        expectRenderRange('2017-06-04', '2017-06-11');
-        expectActiveRange('2017-06-06', '2017-06-11');
-      });
+        expect(validRangeSpy).toHaveBeenCalled()
+        expectRenderRange('2017-06-04', '2017-06-11')
+        expectActiveRange('2017-06-06', '2017-06-11')
+      })
 
       it('does not cause side effects when given date is mutated', function() {
         initCalendar({
           now: nowInput,
           validRange: function(nowDate) {
-            nowDate.add(2, 'years');
+            nowDate.add(2, 'years')
           }
-        });
-        expect(currentCalendar.getNow().year()).toBe(2017);
-      });
-    });
-  });
+        })
+        expect(currentCalendar.getNow().year()).toBe(2017)
+      })
+    })
+  })
 
   describe('when a three-day view', function() { // a view with no alignment
     pushOptions({
       defaultView: 'agenda',
       duration: { days: 3 }
-    });
+    })
 
     describe('when default range is completely before of validRange', function() {
       pushOptions({
         validRange: { start: '2017-06-14' }
-      });
+      })
       it('renders earliest three valid days', function() {
-        initCalendar();
-        expectRenderRange('2017-06-14', '2017-06-17');
-        expectActiveRange('2017-06-14', '2017-06-17');
-      });
-    });
+        initCalendar()
+        expectRenderRange('2017-06-14', '2017-06-17')
+        expectActiveRange('2017-06-14', '2017-06-17')
+      })
+    })
 
     describe('when default range is completely after validRange', function() {
       pushOptions({
         validRange: { end: '2017-05-31' }
-      });
+      })
       it('renders latest possible valid day and two invalid days', function() {
-        initCalendar();
-        expectRenderRange('2017-05-30', '2017-06-02');
-        expectActiveRange('2017-05-30', '2017-05-31');
-      });
-    });
-  });
+        initCalendar()
+        expectRenderRange('2017-05-30', '2017-06-02')
+        expectActiveRange('2017-05-30', '2017-05-31')
+      })
+    })
+  })
 
   describe('when hiddenDays causes no days to be active', function() {
     pushOptions({
@@ -162,14 +162,14 @@ describe('validRange', function() {
         start: '2036-05-03',
         end: '2036-06-01'
       }
-    });
+    })
 
     it('pushes view to nearest valid range', function() {
-      initCalendar();
-      expectRenderRange('2036-05-04', '2036-05-10');
-      expectActiveRange('2036-05-04', '2036-05-10');
-    });
+      initCalendar()
+      expectRenderRange('2036-05-04', '2036-05-10')
+      expectActiveRange('2036-05-04', '2036-05-10')
+    })
 
-  });
+  })
 
-});
+})

+ 13 - 13
tests/view-dates/view-duration.js

@@ -1,28 +1,28 @@
-import { expectActiveRange } from './ViewDateUtils';
+import { expectActiveRange } from './ViewDateUtils'
 
 describe('view duration', function() {
   pushOptions({
     defaultView: 'agenda',
     defaultDate: '2017-03-15'
-  });
+  })
 
   describe('when specified as a week integer', function() {
     pushOptions({
       duration: { weeks: 1 }
-    });
+    })
     it('aligns with start of week', function() {
-      initCalendar();
-      expectActiveRange('2017-03-12', '2017-03-19');
-    });
-  });
+      initCalendar()
+      expectActiveRange('2017-03-12', '2017-03-19')
+    })
+  })
 
   describe('when specified as 7 days', function() {
     pushOptions({
       duration: { days: 7 }
-    });
+    })
     it('aligns with start of week', function() {
-      initCalendar();
-      expectActiveRange('2017-03-15', '2017-03-22');
-    });
-  });
-});
+      initCalendar()
+      expectActiveRange('2017-03-15', '2017-03-22')
+    })
+  })
+})

+ 68 - 68
tests/view-dates/visibleRange.js

@@ -1,15 +1,15 @@
-import { expectActiveRange } from './ViewDateUtils';
+import { expectActiveRange } from './ViewDateUtils'
 
 describe('visibleRange', function() {
 
   describe('when custom view with a flexible range', function() {
     pushOptions({
       defaultView: 'agenda'
-    });
+    })
 
     describe('when given a valid date range', function() {
-      var startInput = '2017-06-26';
-      var endInput = '2017-06-29';
+      var startInput = '2017-06-26'
+      var endInput = '2017-06-29'
 
       describeOptions('visibleRange', {
         'of moment objects': {
@@ -24,20 +24,20 @@ describe('visibleRange', function() {
           return {
             start: $.fullCalendar.moment(startInput),
             end: $.fullCalendar.moment(endInput)
-          };
+          }
         },
         'of a function that returns strings': function() {
           return {
             start: startInput,
             end: endInput
-          };
-        },
+          }
+        }
       }, function() {
         it('gets set to the given range', function() {
-          initCalendar();
-          expectActiveRange(startInput, endInput);
-        });
-      });
+          initCalendar()
+          expectActiveRange(startInput, endInput)
+        })
+      })
 
       it('works as a custom view', function() {
         initCalendar({
@@ -51,9 +51,9 @@ describe('visibleRange', function() {
             }
           },
           defaultView: 'myCustomView'
-        });
-        expectActiveRange(startInput, endInput);
-      });
+        })
+        expectActiveRange(startInput, endInput)
+      })
 
       it('ignores dateAlignment', function() {
         initCalendar({
@@ -62,27 +62,27 @@ describe('visibleRange', function() {
             start: startInput,
             end: endInput
           }
-        });
-        expectActiveRange(startInput, endInput);
-      });
+        })
+        expectActiveRange(startInput, endInput)
+      })
 
       it('works as a dynamic option', function() {
         initCalendar({
           defaultView: 'basic'
-        });
+        })
         currentCalendar.option('visibleRange', {
           start: startInput,
           end: endInput
-        });
-        expectActiveRange(startInput, endInput);
-      });
-    });
+        })
+        expectActiveRange(startInput, endInput)
+      })
+    })
 
     describe('when a function', function() {
-      var defaultDateInput = '2017-06-08T12:30:00';
+      var defaultDateInput = '2017-06-08T12:30:00'
 
       it('receives the calendar\'s defaultDate, timezoneless', function() {
-        var matched = false;
+        var matched = false
 
         initCalendar({
           defaultDate: defaultDateInput,
@@ -90,16 +90,16 @@ describe('visibleRange', function() {
             // this function will receive the date for prev/next,
             // which should be ignored. make sure just one call matches.
             if (date.format() === defaultDateInput) {
-              matched = true;
+              matched = true
             }
           }
-        });
+        })
 
-        expect(matched).toBe(true);
-      });
+        expect(matched).toBe(true)
+      })
 
       it('receives the calendar\'s defaultDate, with UTC timezone', function() {
-        var matched = false;
+        var matched = false
 
         initCalendar({
           timezone: 'UTC',
@@ -108,24 +108,24 @@ describe('visibleRange', function() {
             // this function will receive the date for prev/next,
             // which should be ignored. make sure just one call matches.
             if (date.format() === defaultDateInput + 'Z') {
-              matched = true;
+              matched = true
             }
           }
-        });
+        })
 
-        expect(matched).toBe(true);
-      });
+        expect(matched).toBe(true)
+      })
 
       it('does not cause side effects when given date is mutated', function() {
         initCalendar({
           defaultDate: defaultDateInput,
           visibleRange: function(date) {
-            date.add(1, 'year');
+            date.add(1, 'year')
           }
-        });
-        expect(currentCalendar.getDate()).toEqualMoment(defaultDateInput);
-      });
-    });
+        })
+        expect(currentCalendar.getDate()).toEqualMoment(defaultDateInput)
+      })
+    })
 
     describe('when given an invalid range', function() {
 
@@ -145,10 +145,10 @@ describe('visibleRange', function() {
           initCalendar({
             defaultDate: '2017-08-01'
           })
-          expectActiveRange('2017-08-01', '2017-08-02');
-        });
-      });
-    });
+          expectActiveRange('2017-08-01', '2017-08-02')
+        })
+      })
+    })
 
     describe('when later switching to a one-day view', function() {
 
@@ -159,10 +159,10 @@ describe('visibleRange', function() {
             start: '2017-06-26',
             end: '2017-06-29'
           }
-        });
-        currentCalendar.changeView('agendaDay');
-        expectActiveRange('2017-06-26', '2017-06-27');
-      });
+        })
+        currentCalendar.changeView('agendaDay')
+        expectActiveRange('2017-06-26', '2017-06-27')
+      })
 
       it('constrains the current date to the end of visibleRange', function() {
         initCalendar({
@@ -171,12 +171,12 @@ describe('visibleRange', function() {
             start: '2017-06-26',
             end: '2017-06-29'
           }
-        });
-        currentCalendar.changeView('agendaDay');
-        expectActiveRange('2017-06-28', '2017-06-29');
-      });
-    });
-  });
+        })
+        currentCalendar.changeView('agendaDay')
+        expectActiveRange('2017-06-28', '2017-06-29')
+      })
+    })
+  })
 
   describe('when a list view', function() {
     pushOptions({
@@ -188,20 +188,20 @@ describe('visibleRange', function() {
       events: [
         { start: '2017-06-08' }
       ]
-    });
+    })
 
     it('respects the given range', function() {
-      initCalendar();
-      expectActiveRange('2017-06-07', '2017-06-10');
-    });
-  });
+      initCalendar()
+      expectActiveRange('2017-06-07', '2017-06-10')
+    })
+  })
 
   describe('when custom view with fixed duration', function() {
     pushOptions({
       defaultDate: '2015-06-08',
       defaultView: 'agenda',
       duration: { days: 3 }
-    });
+    })
 
     it('ignores the given visibleRange', function() {
       initCalendar({
@@ -209,16 +209,16 @@ describe('visibleRange', function() {
           start: '2017-06-29',
           end: '2017-07-04'
         }
-      });
-      expectActiveRange('2015-06-08', '2015-06-11');
-    });
-  });
+      })
+      expectActiveRange('2015-06-08', '2015-06-11')
+    })
+  })
 
   describe('when standard view', function() {
     pushOptions({
       defaultDate: '2015-06-08',
       defaultView: 'agendaWeek'
-    });
+    })
 
     it('ignores the given visibleRange', function() {
       initCalendar({
@@ -226,8 +226,8 @@ describe('visibleRange', function() {
           start: '2017-06-29',
           end: '2017-07-04'
         }
-      });
-      expectActiveRange('2015-06-07', '2015-06-14');
-    });
-  });
-});
+      })
+      expectActiveRange('2015-06-07', '2015-06-14')
+    })
+  })
+})

+ 7 - 7
tests/view-render/DayGridRenderUtils.js

@@ -1,14 +1,14 @@
 
 export function getSingleDayEl(date) {
-  date = $.fullCalendar.moment.parseZone(date);
-  var els = $('.fc-day-grid .fc-bg .fc-day[data-date="' + date.format('YYYY-MM-DD') + '"]');
-  expect(els).toHaveLength(1);
-  return els;
+  date = $.fullCalendar.moment.parseZone(date)
+  var els = $('.fc-day-grid .fc-bg .fc-day[data-date="' + date.format('YYYY-MM-DD') + '"]')
+  expect(els).toHaveLength(1)
+  return els
 }
 
 
 export function getDisabledEl(i) {
-  var el = $('.fc-day-grid .fc-bg .fc-disabled-day:eq(' + i + ')');
-  expect(el).toHaveLength(1);
-  return el;
+  var el = $('.fc-day-grid .fc-bg .fc-disabled-day:eq(' + i + ')')
+  expect(el).toHaveLength(1)
+  return el
 }

+ 3 - 3
tests/view-render/TimeGridRenderUtils.js

@@ -4,12 +4,12 @@ export function getTimeAxisInfo() {
     return {
       text: $(tr).find('.fc-time').text(),
       isMajor: !$(tr).hasClass('fc-minor')
-    };
-  }).get();
+    }
+  }).get()
 }
 
 
 // for https://github.com/fullcalendar/fullcalendar-scheduler/issues/363
 export function isStructureValid() {
-  return $('.fc-time-grid .fc-content-skeleton').length === 1;
+  return $('.fc-time-grid .fc-content-skeleton').length === 1
 }

+ 18 - 19
tests/view-render/ViewRenderUtils.js

@@ -1,38 +1,37 @@
 
 export function expectDayRange(start, end) {
-  start = processWholeDay(start);
-  end = processWholeDay(end);
+  start = processWholeDay(start)
+  end = processWholeDay(end)
 
-  var dayBefore = start.clone().subtract(1, 'day');
-  expectDay(dayBefore, false);
+  var dayBefore = start.clone().subtract(1, 'day')
+  expectDay(dayBefore, false)
 
-  var date = start.clone();
-  while (date < end) {
-    expectDay(date, true);
-    date.add(1, 'day');
+  var date = start.clone()
+  while (date < end) { // eslint-disable-line
+    expectDay(date, true)
+    date.add(1, 'day')
   }
 
   // `date` is now the first day after the range
-  expectDay(date, false);
+  expectDay(date, false)
 }
 
 
 export function expectDay(date, bool) {
-  date = processWholeDay(date);
-  var els = $('td.fc-day[data-date="' + date.format() + '"]');
+  date = processWholeDay(date)
+  var els = $('td.fc-day[data-date="' + date.format() + '"]')
 
   if (bool) {
-    expect(els).toBeInDOM();
-  }
-  else {
-    expect(els).not.toBeInDOM();
+    expect(els).toBeInDOM()
+  } else {
+    expect(els).not.toBeInDOM()
   }
 }
 
 
 function processWholeDay(date) {
-  date = $.fullCalendar.moment.parseZone(date);
-  expect(date.hasTime()).toBe(false);
-  expect(date.hasZone()).toBe(false);
-  return date;
+  date = $.fullCalendar.moment.parseZone(date)
+  expect(date.hasTime()).toBe(false)
+  expect(date.hasZone()).toBe(false)
+  return date
 }

+ 14 - 14
tests/view-render/columnHeader.js

@@ -2,7 +2,7 @@
 describe('columnHeader', function() {
   pushOptions({
     defaultDate: '2014-05-11'
-  });
+  })
 
   describeOptions('defaultView', {
     'when month view': 'month',
@@ -13,28 +13,28 @@ describe('columnHeader', function() {
     describe('when off', function() {
       pushOptions({
         columnHeader: true
-      });
+      })
 
       it('should show header', function() {
-        initCalendar();
-        expect(hasHeader()).toBe(true);
-      });
-    });
+        initCalendar()
+        expect(hasHeader()).toBe(true)
+      })
+    })
 
     describe('when on', function() {
       pushOptions({
         columnHeader: false
-      });
+      })
 
       it('should not show header', function() {
-        initCalendar();
-        expect(hasHeader()).toBe(false);
-      });
-    });
-  });
+        initCalendar()
+        expect(hasHeader()).toBe(false)
+      })
+    })
+  })
 
   function hasHeader() {
-    return $('.fc-view > table > .fc-head').length === 1;
+    return $('.fc-view > table > .fc-head').length === 1
   }
 
-});
+})

+ 9 - 9
tests/view-render/columnHeaderHtml.js

@@ -3,9 +3,9 @@ describe('columnHeaderHtml', function() {
   pushOptions({
     defaultDate: '2014-05-11',
     columnHeaderHtml: function(date) {
-      return '<div class="test">' + date.format('dddd') + '</div>';
+      return '<div class="test">' + date.format('dddd') + '</div>'
     }
-  });
+  })
 
   describeOptions('defaultView', {
     'when month view': 'month',
@@ -14,15 +14,15 @@ describe('columnHeaderHtml', function() {
   }, function() {
 
     it('should contain custom HTML', function() {
-      initCalendar();
-      expect(hasCustomHtml()).toBe(true);
-    });
-  });
+      initCalendar()
+      expect(hasCustomHtml()).toBe(true)
+    })
+  })
 
   function hasCustomHtml() {
-    var firstHeader = $('.fc-day-header:first');
+    var firstHeader = $('.fc-day-header:first')
 
-    return firstHeader.find('.test').length === 1 && firstHeader.text() === 'Sunday';
+    return firstHeader.find('.test').length === 1 && firstHeader.text() === 'Sunday'
   }
 
-});
+})

+ 9 - 9
tests/view-render/columnHeaderText.js

@@ -3,9 +3,9 @@ describe('columnHeaderText', function() {
   pushOptions({
     defaultDate: '2014-05-11',
     columnHeaderText: function(date) {
-      return '<div>Custom ' + date.format('dddd') + '</div>';
+      return '<div>Custom ' + date.format('dddd') + '</div>'
     }
-  });
+  })
 
   describeOptions('defaultView', {
     'when month view': 'month',
@@ -14,15 +14,15 @@ describe('columnHeaderText', function() {
   }, function() {
 
     it('should contain custom HTML escaped text', function() {
-      initCalendar();
-      expect(hasCustomText()).toBe(true);
-    });
-  });
+      initCalendar()
+      expect(hasCustomText()).toBe(true)
+    })
+  })
 
   function hasCustomText() {
-    var firstHeader = $('.fc-day-header:first');
+    var firstHeader = $('.fc-day-header:first')
 
-    return firstHeader.text() === '<div>Custom Sunday</div>';
+    return firstHeader.text() === '<div>Custom Sunday</div>'
   }
 
-});
+})

+ 10 - 10
tests/view-render/renderMethod.js

@@ -2,18 +2,18 @@
 describe('render method', function() {
 
   it('updates size of a previously hidden element', function() {
-    var $el = $('<div style="display:none" />').appendTo('body');
+    var $el = $('<div style="display:none" />').appendTo('body')
 
     initCalendar({
       defaultView: 'month',
       contentHeight: 600
-    }, $el);
-  
-    $el.show();
-    currentCalendar.render();
-    expect($('.fc-view-container').outerHeight()).toBeCloseTo(600, 0);
-  
-    $el.remove();
-  });
+    }, $el)
 
-});
+    $el.show()
+    currentCalendar.render()
+    expect($('.fc-view-container').outerHeight()).toBeCloseTo(600, 0)
+
+    $el.remove()
+  })
+
+})

+ 13 - 13
tests/view-render/showNonCurrentDates.js

@@ -1,32 +1,32 @@
-import { expectDayRange } from './ViewRenderUtils';
+import { expectDayRange } from './ViewRenderUtils'
 
 
 describe('showNonCurrentDates', function() {
   pushOptions({
     showNonCurrentDates: false
-  });
+  })
 
   describe('when in month view', function() {
     pushOptions({
       defaultView: 'month',
       defaultDate: '2017-06-01'
-    });
+    })
 
     it('does not render other months\' dates', function() {
-      initCalendar();
-      expectDayRange('2017-06-01', '2017-07-01');
-    });
-  });
+      initCalendar()
+      expectDayRange('2017-06-01', '2017-07-01')
+    })
+  })
 
   describe('when in week view', function() {
     pushOptions({
       defaultView: 'agendaWeek',
       defaultDate: '2017-06-01'
-    });
+    })
 
     it('has no effect', function() {
-      initCalendar();
-      expectDayRange('2017-05-28', '2017-06-04');
-    });
-  });
-});
+      initCalendar()
+      expectDayRange('2017-05-28', '2017-06-04')
+    })
+  })
+})

+ 27 - 27
tests/view-render/slotDuration.js

@@ -1,4 +1,4 @@
-import * as TimeGridRenderUtils from './TimeGridRenderUtils';
+import * as TimeGridRenderUtils from './TimeGridRenderUtils'
 
 
 describe('slotDuration', function() {
@@ -7,58 +7,58 @@ describe('slotDuration', function() {
     defaultView: 'agendaDay',
     scrollTime: 0,
     slotLabelFormat: 'HH:mm'
-  });
+  })
 
   describe('when only major slots', function() {
     pushOptions({
       slotDuration: '01:00',
       slotLabelInterval: '01:00'
-    });
+    })
 
     describe('when in alignment with minTime', function() {
       pushOptions({
         minTime: '00:00',
         maxTime: '03:00'
-      });
+      })
       it('render slots correctly', function() {
-        initCalendar();
+        initCalendar()
         expect(TimeGridRenderUtils.getTimeAxisInfo()).toEqual([
           { text: '00:00', isMajor: true },
           { text: '01:00', isMajor: true },
           { text: '02:00', isMajor: true }
-        ]);
-      });
-    });
+        ])
+      })
+    })
 
     describe('when out of alignment with minTime', function() {
       pushOptions({
         minTime: '00:20',
         maxTime: '03:20'
-      });
+      })
       it('render slots correctly', function() {
-        initCalendar();
+        initCalendar()
         expect(TimeGridRenderUtils.getTimeAxisInfo()).toEqual([
           { text: '00:20', isMajor: true },
           { text: '01:20', isMajor: true },
           { text: '02:20', isMajor: true }
-        ]);
-      });
-    });
-  });
+        ])
+      })
+    })
+  })
 
   describe('when major and minor slots', function() {
     pushOptions({
       slotDuration: '00:30',
       slotLabelInterval: '01:00'
-    });
+    })
 
     describe('when in alignment with minTime', function() {
       pushOptions({
         minTime: '00:00',
         maxTime: '03:00'
-      });
+      })
       it('render slots correctly', function() {
-        initCalendar();
+        initCalendar()
         expect(TimeGridRenderUtils.getTimeAxisInfo()).toEqual([
           { text: '00:00', isMajor: true },
           { text: '', isMajor: false },
@@ -66,17 +66,17 @@ describe('slotDuration', function() {
           { text: '', isMajor: false },
           { text: '02:00', isMajor: true },
           { text: '', isMajor: false }
-        ]);
-      });
-    });
+        ])
+      })
+    })
 
     describe('when out of alignment with minTime', function() {
       pushOptions({
         minTime: '00:20',
         maxTime: '03:20'
-      });
+      })
       it('render slots correctly', function() {
-        initCalendar();
+        initCalendar()
         expect(TimeGridRenderUtils.getTimeAxisInfo()).toEqual([
           { text: '00:20', isMajor: true },
           { text: '', isMajor: false },
@@ -84,9 +84,9 @@ describe('slotDuration', function() {
           { text: '', isMajor: false },
           { text: '02:20', isMajor: true },
           { text: '', isMajor: false }
-        ]);
-      });
-    });
-  });
+        ])
+      })
+    })
+  })
 
-});
+})

+ 24 - 24
tests/view-render/validRange.js

@@ -1,4 +1,4 @@
-import { expectDayRange } from './ViewRenderUtils';
+import { expectDayRange } from './ViewRenderUtils'
 
 
 describe('validRange rendering', function() {
@@ -10,27 +10,27 @@ describe('validRange rendering', function() {
         defaultView: 'month',
         defaultDate: '2017-06-01',
         validRange: { start: '2017-06-07' }
-      });
+      })
 
       it('does not render days before', function() {
-        initCalendar();
-        expectDayRange('2017-06-07', '2017-07-09');
-      });
-    });
+        initCalendar()
+        expectDayRange('2017-06-07', '2017-07-09')
+      })
+    })
 
     describe('when in week view', function() {
       pushOptions({
         defaultView: 'agendaWeek',
         defaultDate: '2017-06-08',
         validRange: { start: '2017-06-06' }
-      });
+      })
 
       it('does not render days before', function() {
-        initCalendar();
-        expectDayRange('2017-06-06', '2017-06-11');
-      });
-    });
-  });
+        initCalendar()
+        expectDayRange('2017-06-06', '2017-06-11')
+      })
+    })
+  })
 
   describe('with hardcoded end constraint', function() {
 
@@ -39,25 +39,25 @@ describe('validRange rendering', function() {
         defaultView: 'month',
         defaultDate: '2017-06-01',
         validRange: { end: '2017-06-07' }
-      });
+      })
 
       it('does not render days on or after', function() {
-        initCalendar();
-        expectDayRange('2017-05-28', '2017-06-07');
-      });
-    });
+        initCalendar()
+        expectDayRange('2017-05-28', '2017-06-07')
+      })
+    })
 
     describe('when in week view', function() {
       pushOptions({
         defaultView: 'agendaWeek',
         defaultDate: '2017-06-08',
         validRange: { end: '2017-06-06' }
-      });
+      })
 
       it('does not render days on or after', function() {
-        initCalendar();
-        expectDayRange('2017-06-04', '2017-06-06');
-      });
-    });
-  });
-});
+        initCalendar()
+        expectDayRange('2017-06-04', '2017-06-06')
+      })
+    })
+  })
+})

+ 46 - 46
tests/view-type/changeView.js

@@ -1,82 +1,82 @@
-import { expectActiveRange } from '../view-dates/ViewDateUtils';
-import * as TimeGridRenderUtils from '../view-render/TimeGridRenderUtils';
+import { expectActiveRange } from '../view-dates/ViewDateUtils'
+import * as TimeGridRenderUtils from '../view-render/TimeGridRenderUtils'
 
 
 describe('changeView', function() {
   pushOptions({
     defaultDate: '2017-06-08',
     defaultView: 'month'
-  });
+  })
 
   it('can change views', function() {
-    initCalendar();
-    currentCalendar.changeView('agendaWeek');
-    expectActiveRange('2017-06-04', '2017-06-11');
-  });
+    initCalendar()
+    currentCalendar.changeView('agendaWeek')
+    expectActiveRange('2017-06-04', '2017-06-11')
+  })
 
   it('can change views and navigate date', function() {
-    initCalendar();
-    currentCalendar.changeView('agendaDay', '2017-06-26');
-    expectActiveRange('2017-06-26', '2017-06-27');
-  });
+    initCalendar()
+    currentCalendar.changeView('agendaDay', '2017-06-26')
+    expectActiveRange('2017-06-26', '2017-06-27')
+  })
 
   it('can change views and change activeRange', function() {
-    initCalendar();
+    initCalendar()
     currentCalendar.changeView('agenda', {
       start: '2017-07-04',
       end: '2017-07-08'
-    });
-    expectActiveRange('2017-07-04', '2017-07-08');
-  });
+    })
+    expectActiveRange('2017-07-04', '2017-07-08')
+  })
 
   describe('when switching away from view, then back', function() {
 
     // serves as a smoke test too
     it('correctly renders original view again', function(done) {
-      var renderCalls = 0;
+      var renderCalls = 0
 
       initCalendar({
         defaultView: 'month',
         eventAfterAllRender: function(view) {
-          renderCalls++;
+          renderCalls++
 
           switch (renderCalls) {
             case 1:
-              expect(view.type).toBe('month');
-              checkViewIntegrity();
-              currentCalendar.changeView('agendaWeek');
-              break;
+              expect(view.type).toBe('month')
+              checkViewIntegrity()
+              currentCalendar.changeView('agendaWeek')
+              break
             case 2:
-              expect(view.type).toBe('agendaWeek');
-              checkViewIntegrity();
-              expect(TimeGridRenderUtils.isStructureValid()).toBe(true);
-              currentCalendar.changeView('basicWeek');
-              break;
+              expect(view.type).toBe('agendaWeek')
+              checkViewIntegrity()
+              expect(TimeGridRenderUtils.isStructureValid()).toBe(true)
+              currentCalendar.changeView('basicWeek')
+              break
             case 3:
-              expect(view.type).toBe('basicWeek');
-              checkViewIntegrity();
-              currentCalendar.changeView('listWeek');
-              break;
+              expect(view.type).toBe('basicWeek')
+              checkViewIntegrity()
+              currentCalendar.changeView('listWeek')
+              break
             case 4:
-              expect(view.type).toBe('listWeek');
-              checkViewIntegrity();
-              currentCalendar.changeView('month');
-              break;
+              expect(view.type).toBe('listWeek')
+              checkViewIntegrity()
+              currentCalendar.changeView('month')
+              break
             case 5:
-              expect(view.type).toBe('month');
-              checkViewIntegrity();
-              done();
-              break;
+              expect(view.type).toBe('month')
+              checkViewIntegrity()
+              done()
+              break
           }
         }
-      });
+      })
 
       function checkViewIntegrity() {
-        var $el = $('.fc-view');
-        expect($el).toBeInDOM();
-        expect($el.children().length).toBeGreaterThan(0);
-        expect($el.text()).toBeTruthy();
+        var $el = $('.fc-view')
+        expect($el).toBeInDOM()
+        expect($el.children().length).toBeGreaterThan(0)
+        expect($el.text()).toBeTruthy()
       }
-    });
-  });
-});
+    })
+  })
+})

+ 9 - 9
tests/view-type/exposed-classes.js

@@ -2,15 +2,15 @@
 describe('internal View/Grid classes', function() {
 
   it('are exposed', function() {
-    var FC = $.fullCalendar;
+    var FC = $.fullCalendar
 
-    expect(typeof FC.AgendaView).toBe('function');
-    expect(typeof FC.BasicView).toBe('function');
-    expect(typeof FC.MonthView).toBe('function');
-    expect(typeof FC.ListView).toBe('function');
+    expect(typeof FC.AgendaView).toBe('function')
+    expect(typeof FC.BasicView).toBe('function')
+    expect(typeof FC.MonthView).toBe('function')
+    expect(typeof FC.ListView).toBe('function')
 
-    expect(typeof FC.DayGrid).toBe('function');
-    expect(typeof FC.TimeGrid).toBe('function');
-  });
+    expect(typeof FC.DayGrid).toBe('function')
+    expect(typeof FC.TimeGrid).toBe('function')
+  })
 
-});
+})