|
|
@@ -1,4 +1,5 @@
|
|
|
-import { getLegacyWeekNumberCounts } from "../lib/wrappers/DayGridWrapper"
|
|
|
+import DayGridViewWrapper from '../lib/wrappers/DayGridViewWrapper'
|
|
|
+import TimeGridViewWrapper from '../lib/wrappers/TimeGridViewWrapper'
|
|
|
|
|
|
describe('weekNumbers', function() {
|
|
|
|
|
|
@@ -9,354 +10,74 @@ describe('weekNumbers', function() {
|
|
|
})
|
|
|
|
|
|
describe('with default weekNumbers', function() { // which is false!
|
|
|
-
|
|
|
- describe('and default weekNumbersWithinDays', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar()
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to false', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: false
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
+ it('should not display week numbers at all', function() {
|
|
|
+ let calendar = initCalendar()
|
|
|
+ let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid
|
|
|
+ expect(dayGridWrapper.getWeekNumberEls().length).toEqual(0)
|
|
|
})
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to true', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: true
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
})
|
|
|
|
|
|
describe('with weekNumbers to false', function() {
|
|
|
-
|
|
|
pushOptions({
|
|
|
weekNumbers: false
|
|
|
})
|
|
|
|
|
|
- describe('and default weekNumbersWithinDays', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: true
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to false', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: false
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to true', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: true
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
+ it('should not display week numbers at all', function() {
|
|
|
+ let calendar = initCalendar()
|
|
|
+ let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid
|
|
|
+ expect(dayGridWrapper.getWeekNumberEls().length).toEqual(0)
|
|
|
})
|
|
|
-
|
|
|
})
|
|
|
|
|
|
describe('with weekNumbers to true', function() {
|
|
|
-
|
|
|
pushOptions({
|
|
|
weekNumbers: true
|
|
|
})
|
|
|
|
|
|
- describe('and default weekNumbersWithinDays', function() {
|
|
|
- it('should display week numbers along the side only', function() {
|
|
|
- initCalendar()
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.colWeekNumbers).toEqual(6)
|
|
|
- expect(counts.cellWeekNumbers).toEqual(0)
|
|
|
- expect(counts.cornerWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to false', function() {
|
|
|
- it('should display week numbers along the side only', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: false
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.colWeekNumbers).toEqual(6)
|
|
|
- expect(counts.cellWeekNumbers).toEqual(0)
|
|
|
- expect(counts.cornerWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to true', function() {
|
|
|
- it('should display week numbers in the day cells only', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: true
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.colWeekNumbers).toEqual(0)
|
|
|
- expect(counts.cellWeekNumbers).toEqual(6)
|
|
|
- expect(counts.cornerWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
+ it('should display week numbers in the day cells only', function() {
|
|
|
+ let calendar = initCalendar()
|
|
|
+ let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid
|
|
|
+ expect(dayGridWrapper.getWeekNumberEls().length).toBeGreaterThan(0)
|
|
|
})
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
- describe('when using dayGridWeek view', function() {
|
|
|
-
|
|
|
- pushOptions({
|
|
|
- defaultView: 'dayGridWeek'
|
|
|
- })
|
|
|
-
|
|
|
- describe('with default weekNumbers', function() {
|
|
|
-
|
|
|
- describe('and default weekNumbersWithinDays', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar()
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to false', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: false
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to true', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: true
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
- describe('with weekNumbers to false', function() {
|
|
|
-
|
|
|
- pushOptions({
|
|
|
- weekNumbers: false
|
|
|
- })
|
|
|
-
|
|
|
- describe('and default weekNumbersWithinDays', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar()
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to false', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: false
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to true', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: true
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
- describe('with weekNumbers to true', function() {
|
|
|
-
|
|
|
- pushOptions({
|
|
|
- weekNumbers: true
|
|
|
- })
|
|
|
-
|
|
|
- describe('and default weekNumbersWithinDays', function() {
|
|
|
- it('should display week numbers along the side only', function() {
|
|
|
- initCalendar()
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.colWeekNumbers).toEqual(1)
|
|
|
- expect(counts.cellWeekNumbers).toEqual(0)
|
|
|
- expect(counts.cornerWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to false', function() {
|
|
|
- it('should display week numbers along the side only', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: false
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.colWeekNumbers).toEqual(1)
|
|
|
- expect(counts.cellWeekNumbers).toEqual(0)
|
|
|
- expect(counts.cornerWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to true', function() {
|
|
|
- it('should display week numbers in the day cells only', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: true
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.colWeekNumbers).toEqual(0)
|
|
|
- expect(counts.cellWeekNumbers).toEqual(1)
|
|
|
- expect(counts.cornerWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
describe('when using an timeGrid view', function() {
|
|
|
-
|
|
|
pushOptions({
|
|
|
defaultView: 'timeGridWeek'
|
|
|
})
|
|
|
|
|
|
describe('with default weekNumbers', function() {
|
|
|
-
|
|
|
- describe('and default weekNumbersWithinDays', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar()
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to false', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: false
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
+ it('should not display week numbers at all', function() {
|
|
|
+ let calendar = initCalendar()
|
|
|
+ let viewWrapper = new TimeGridViewWrapper(calendar)
|
|
|
+ expect(viewWrapper.getHeaderWeekNumberLink()).toBeFalsy()
|
|
|
})
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to true', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: true
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
})
|
|
|
|
|
|
describe('with weekNumbers to false', function() {
|
|
|
-
|
|
|
pushOptions({
|
|
|
weekNumbers: false
|
|
|
})
|
|
|
|
|
|
- describe('and default weekNumbersWithinDays', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar()
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to false', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: false
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to true', function() {
|
|
|
- it('should not display week numbers at all', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: true
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(0)
|
|
|
- })
|
|
|
+ it('should not display week numbers at all', function() {
|
|
|
+ let calendar = initCalendar()
|
|
|
+ let viewWrapper = new TimeGridViewWrapper(calendar)
|
|
|
+ expect(viewWrapper.getHeaderWeekNumberLink()).toBeFalsy()
|
|
|
})
|
|
|
-
|
|
|
})
|
|
|
|
|
|
describe('with weekNumbers to true', function() {
|
|
|
-
|
|
|
pushOptions({
|
|
|
weekNumbers: true
|
|
|
})
|
|
|
|
|
|
- describe('and default weekNumbersWithinDays', function() {
|
|
|
- it('should display week numbers in the top left corner only', function() {
|
|
|
- initCalendar()
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(1)
|
|
|
- expect(counts.colWeekNumbers).toEqual(0)
|
|
|
- expect(counts.cellWeekNumbers).toEqual(0)
|
|
|
- expect(counts.cornerWeekNumbers).toEqual(1)
|
|
|
- })
|
|
|
+ it('should display week numbers in the top left corner only', function() {
|
|
|
+ let calendar = initCalendar()
|
|
|
+ let viewWrapper = new TimeGridViewWrapper(calendar)
|
|
|
+ expect(viewWrapper.getHeaderWeekNumberLink()).toBeTruthy()
|
|
|
})
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to false', function() {
|
|
|
- it('should display week numbers in the top left corner only', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: false
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(1)
|
|
|
- expect(counts.colWeekNumbers).toEqual(0)
|
|
|
- expect(counts.cellWeekNumbers).toEqual(0)
|
|
|
- expect(counts.cornerWeekNumbers).toEqual(1)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- describe('and weekNumbersWithinDays set to true', function() {
|
|
|
- it('should display week numbers in the top left corner only', function() {
|
|
|
- initCalendar({
|
|
|
- weekNumbersWithinDays: true
|
|
|
- })
|
|
|
- let counts = getLegacyWeekNumberCounts()
|
|
|
- expect(counts.allWeekNumbers).toEqual(1)
|
|
|
- expect(counts.colWeekNumbers).toEqual(0)
|
|
|
- expect(counts.cellWeekNumbers).toEqual(0)
|
|
|
- expect(counts.cornerWeekNumbers).toEqual(1)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
})
|
|
|
|
|
|
})
|