|
|
@@ -4,11 +4,11 @@ describe('columnHeaderFormat', function() {
|
|
|
describe('when not set', function() {
|
|
|
|
|
|
var viewWithFormat = [
|
|
|
- { view: 'month', expected: 'Sun', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'basicWeek', expected: 'Sun 5/11', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'agendaWeek', expected: 'Sun 5/11', selector: 'th.fc-widget-header.fc-sun' },
|
|
|
- { view: 'basicDay', expected: 'Sunday', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'agendaDay', expected: 'Sunday', selector: 'th.fc-widget-header.fc-sun' }
|
|
|
+ { view: 'month', expected: /^Sun$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'basicWeek', expected: /^Sun 5[/ ]11$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'agendaWeek', expected: /^Sun 5[/ ]11$/, selector: 'th.fc-widget-header.fc-sun' },
|
|
|
+ { view: 'basicDay', expected: /^Sunday$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'agendaDay', expected: /^Sunday$/, selector: 'th.fc-widget-header.fc-sun' }
|
|
|
]
|
|
|
|
|
|
beforeEach(function() {
|
|
|
@@ -22,7 +22,7 @@ describe('columnHeaderFormat', function() {
|
|
|
for (var i = 0; i < viewWithFormat.length; i++) {
|
|
|
var crtView = viewWithFormat[i]
|
|
|
currentCalendar.changeView(crtView.view)
|
|
|
- expect($(currentCalendar.el).find(crtView.selector).text()).toBe(crtView.expected)
|
|
|
+ expect($(currentCalendar.el).find(crtView.selector).text()).toMatch(crtView.expected)
|
|
|
};
|
|
|
})
|
|
|
})
|
|
|
@@ -30,9 +30,9 @@ describe('columnHeaderFormat', function() {
|
|
|
describe('when columnHeaderFormat is set on a per-view basis', function() {
|
|
|
|
|
|
var viewWithFormat = [
|
|
|
- { view: 'month', expected: 'Sunday', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'agendaDay', expected: 'Sunday, May 11', selector: 'th.fc-widget-header.fc-sun' },
|
|
|
- { view: 'basicWeek', expected: 'Sunday, 5/11', selector: 'th.fc-day-header.fc-sun' }
|
|
|
+ { view: 'month', expected: /^Sunday$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'agendaDay', expected: /^Sunday, May 11$/, selector: 'th.fc-widget-header.fc-sun' },
|
|
|
+ { view: 'basicWeek', expected: /^Sunday, 5[/ ]11$/, selector: 'th.fc-day-header.fc-sun' }
|
|
|
]
|
|
|
|
|
|
beforeEach(function() {
|
|
|
@@ -51,7 +51,7 @@ describe('columnHeaderFormat', function() {
|
|
|
for (var i = 0; i < viewWithFormat.length; i++) {
|
|
|
var crtView = viewWithFormat[i]
|
|
|
currentCalendar.changeView(crtView.view)
|
|
|
- expect($(currentCalendar.el).find(crtView.selector).text()).toBe(crtView.expected)
|
|
|
+ expect($(currentCalendar.el).find(crtView.selector).text()).toMatch(crtView.expected)
|
|
|
};
|
|
|
})
|
|
|
})
|
|
|
@@ -59,11 +59,11 @@ describe('columnHeaderFormat', function() {
|
|
|
describe('when locale is French', function() {
|
|
|
|
|
|
var viewWithFormat = [
|
|
|
- { view: 'month', expected: 'dim.', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'basicWeek', expected: 'dim. 11/05', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'agendaWeek', expected: 'dim. 11/05', selector: 'th.fc-widget-header.fc-sun' },
|
|
|
- { view: 'basicDay', expected: 'dimanche', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'agendaDay', expected: 'dimanche', selector: 'th.fc-widget-header.fc-sun' }
|
|
|
+ { view: 'month', expected: /^dim\.$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'basicWeek', expected: /^dim\. 11[/ ]0?5$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'agendaWeek', expected: /^dim\. 11[/ ]0?5$/, selector: 'th.fc-widget-header.fc-sun' },
|
|
|
+ { view: 'basicDay', expected: /^dimanche$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'agendaDay', expected: /^dimanche$/, selector: 'th.fc-widget-header.fc-sun' }
|
|
|
]
|
|
|
|
|
|
beforeEach(function() {
|
|
|
@@ -78,7 +78,7 @@ describe('columnHeaderFormat', function() {
|
|
|
for (var i = 0; i < viewWithFormat.length; i++) {
|
|
|
var crtView = viewWithFormat[i]
|
|
|
currentCalendar.changeView(crtView.view)
|
|
|
- expect($(currentCalendar.el).find(crtView.selector).text()).toBe(crtView.expected)
|
|
|
+ expect($(currentCalendar.el).find(crtView.selector).text()).toMatch(crtView.expected)
|
|
|
};
|
|
|
})
|
|
|
})
|
|
|
@@ -86,11 +86,11 @@ describe('columnHeaderFormat', function() {
|
|
|
describe('when locale is en-gb', function() {
|
|
|
|
|
|
var viewWithFormat = [
|
|
|
- { view: 'month', expected: 'Sun', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'basicWeek', expected: 'Sun 11/05', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'agendaWeek', expected: 'Sun 11/05', selector: 'th.fc-widget-header.fc-sun' },
|
|
|
- { view: 'basicDay', expected: 'Sunday', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'agendaDay', expected: 'Sunday', selector: 'th.fc-widget-header.fc-sun' }
|
|
|
+ { view: 'month', expected: /^Sun$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'basicWeek', expected: /^Sun 11[/ ]0?5$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'agendaWeek', expected: /^Sun 11[/ ]0?5$/, selector: 'th.fc-widget-header.fc-sun' },
|
|
|
+ { view: 'basicDay', expected: /^Sunday$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'agendaDay', expected: /^Sunday$/, selector: 'th.fc-widget-header.fc-sun' }
|
|
|
]
|
|
|
|
|
|
beforeEach(function() {
|
|
|
@@ -105,7 +105,7 @@ describe('columnHeaderFormat', function() {
|
|
|
for (var i = 0; i < viewWithFormat.length; i++) {
|
|
|
var crtView = viewWithFormat[i]
|
|
|
currentCalendar.changeView(crtView.view)
|
|
|
- expect($(currentCalendar.el).find(crtView.selector).text()).toBe(crtView.expected)
|
|
|
+ expect($(currentCalendar.el).find(crtView.selector).text()).toMatch(crtView.expected)
|
|
|
};
|
|
|
})
|
|
|
})
|
|
|
@@ -113,11 +113,11 @@ describe('columnHeaderFormat', function() {
|
|
|
describe('when locale is Korean', function() {
|
|
|
|
|
|
var viewWithFormat = [
|
|
|
- { view: 'month', expected: '일', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'basicWeek', expected: '5. 11. (일)', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'agendaWeek', expected: '5. 11. (일)', selector: 'th.fc-widget-header.fc-sun' },
|
|
|
- { view: 'basicDay', expected: '일요일', selector: 'th.fc-day-header.fc-sun' },
|
|
|
- { view: 'agendaDay', expected: '일요일', selector: 'th.fc-widget-header.fc-sun' }
|
|
|
+ { view: 'month', expected: /^일$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'basicWeek', expected: /^5[.월] 11[.일] \(?일\)?$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'agendaWeek', expected: /^5[.월] 11[.일] \(?일\)?$/, selector: 'th.fc-widget-header.fc-sun' },
|
|
|
+ { view: 'basicDay', expected: /^일요일$/, selector: 'th.fc-day-header.fc-sun' },
|
|
|
+ { view: 'agendaDay', expected: /^일요일$/, selector: 'th.fc-widget-header.fc-sun' }
|
|
|
]
|
|
|
|
|
|
beforeEach(function() {
|
|
|
@@ -131,7 +131,7 @@ describe('columnHeaderFormat', function() {
|
|
|
for (var i = 0; i < viewWithFormat.length; i++) {
|
|
|
var crtView = viewWithFormat[i]
|
|
|
currentCalendar.changeView(crtView.view)
|
|
|
- expect($(currentCalendar.el).find(crtView.selector).text()).toBe(crtView.expected)
|
|
|
+ expect($(currentCalendar.el).find(crtView.selector).text()).toMatch(crtView.expected)
|
|
|
};
|
|
|
})
|
|
|
})
|
|
|
@@ -191,7 +191,9 @@ describe('columnHeaderFormat', function() {
|
|
|
defaultView: 'multiDay',
|
|
|
defaultDate: '2014-12-25'
|
|
|
})
|
|
|
- expect($('.fc-day-header:first')).toHaveText('Thu 12/25')
|
|
|
+ expect(
|
|
|
+ $('.fc-day-header:first').text()
|
|
|
+ ).toMatch(/^Thu 12[/ ]25$/)
|
|
|
})
|
|
|
})
|
|
|
})
|