|
|
@@ -1,5 +1,4 @@
|
|
|
describe('day names', function() {
|
|
|
- var settings = {}
|
|
|
var testableClasses = [
|
|
|
'basicDay',
|
|
|
'agendaDay'
|
|
|
@@ -16,11 +15,8 @@ describe('day names', function() {
|
|
|
var referenceDate = '2014-05-25 06:00' // A sunday
|
|
|
var locales = [ 'es', 'fr', 'de', 'zh-cn', 'nl' ]
|
|
|
|
|
|
- beforeEach(function() {
|
|
|
- affix('#cal')
|
|
|
- settings = {
|
|
|
- now: moment(referenceDate).toISOString()
|
|
|
- }
|
|
|
+ pushOptions({
|
|
|
+ now: moment(referenceDate).toISOString()
|
|
|
})
|
|
|
|
|
|
afterEach(function() {
|
|
|
@@ -29,21 +25,19 @@ describe('day names', function() {
|
|
|
|
|
|
testableClasses.forEach(function(viewClass, index, viewClasses) {
|
|
|
describe('when view is basicDay', function() {
|
|
|
- beforeEach(function() {
|
|
|
- settings.defaultView = 'basicDay'
|
|
|
+ pushOptions({
|
|
|
+ defaultView: 'basicDay'
|
|
|
})
|
|
|
-
|
|
|
describe('when locale is default', function() {
|
|
|
- beforeEach(function() {
|
|
|
- settings.locale = 'en'
|
|
|
+ pushOptions({
|
|
|
+ locale: 'en'
|
|
|
})
|
|
|
-
|
|
|
dayClasses.forEach(function(cls, index, classes) {
|
|
|
var weekdays = moment.weekdays()
|
|
|
it('should be ' + weekdays[index], function() {
|
|
|
- settings.now = moment(referenceDate).add(index, 'days')
|
|
|
- $('#cal').fullCalendar(settings)
|
|
|
-
|
|
|
+ initCalendar({
|
|
|
+ now: moment(referenceDate).add(index, 'days')
|
|
|
+ })
|
|
|
expect($('.fc-view thead ' + dayClasses[index])).toHaveText(weekdays[index])
|
|
|
})
|
|
|
})
|
|
|
@@ -57,9 +51,10 @@ describe('day names', function() {
|
|
|
|
|
|
dayClasses.forEach(function(cls, index, classes) {
|
|
|
it('should be the translation for ' + moment.weekdays()[index], function() {
|
|
|
- settings.locale = locale
|
|
|
- settings.now = moment(referenceDate).add(index, 'days')
|
|
|
- $('#cal').fullCalendar(settings)
|
|
|
+ initCalendar({
|
|
|
+ locale: locale,
|
|
|
+ now: moment(referenceDate).add(index, 'days')
|
|
|
+ })
|
|
|
|
|
|
expect($('.fc-view thead ' + dayClasses[index])).toHaveText(moment.weekdays()[index])
|
|
|
})
|
|
|
@@ -80,11 +75,10 @@ describe('day names', function() {
|
|
|
|
|
|
dayClasses.forEach(function(cls, idx, classes) {
|
|
|
it('should be ' + weekdays[idx], function() {
|
|
|
- settings.dayNames = [].slice.call(weekdays) // copy. in case there is a mutation
|
|
|
- settings.now = moment(referenceDate).add(idx, 'days')
|
|
|
-
|
|
|
- $('#cal').fullCalendar(settings)
|
|
|
-
|
|
|
+ initCalendar({
|
|
|
+ dayNames: [].slice.call(weekdays), // copy. in case there is a mutation
|
|
|
+ now: moment(referenceDate).add(idx, 'days')
|
|
|
+ })
|
|
|
expect($('.fc-view thead ' + cls)).toHaveText(weekdays[idx])
|
|
|
})
|
|
|
})
|