| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- describe('button text', function() {
- pushOptions({
- header: {
- left: 'prevYear,prev,today,next,nextYear',
- center: '',
- right: 'month,basicWeek,basicDay,agendaWeek,agendaDay'
- }
- })
- describe('with default locale', function() {
- describe('with default buttonIcons', function() {
- it('should contain default text values', function() {
- initCalendar()
- // will have button icons, to text will be empty
- expect($('.fc-next-button')).toHaveText('')
- expect($('.fc-nextYear-button')).toHaveText('')
- expect($('.fc-prev-button')).toHaveText('')
- expect($('.fc-prevYear-button')).toHaveText('')
- expect($('.fc-today-button')).toHaveText('today')
- expect($('.fc-month-button')).toHaveText('month')
- expect($('.fc-basicWeek-button')).toHaveText('week')
- expect($('.fc-agendaWeek-button')).toHaveText('week')
- expect($('.fc-basicDay-button')).toHaveText('day')
- expect($('.fc-agendaDay-button')).toHaveText('day')
- })
- it('should contain specified text values', function() {
- initCalendar({
- buttonText: {
- prev: '<-',
- next: '->',
- prevYear: '<--',
- nextYear: '-->',
- today: 'tidei',
- month: 'mun',
- week: 'wiki',
- day: 'dei'
- }
- })
- expect($('.fc-next-button')).toHaveText('->')
- expect($('.fc-nextYear-button')).toHaveText('-->')
- expect($('.fc-prev-button')).toHaveText('<-')
- expect($('.fc-prevYear-button')).toHaveText('<--')
- expect($('.fc-today-button')).toHaveText('tidei')
- expect($('.fc-month-button')).toHaveText('mun')
- expect($('.fc-agendaDay-button')).toHaveText('dei')
- expect($('.fc-agendaWeek-button')).toHaveText('wiki')
- expect($('.fc-basicDay-button')).toHaveText('dei')
- expect($('.fc-basicWeek-button')).toHaveText('wiki')
- })
- })
- describe('with buttonIcons turned off', function() {
- pushOptions({
- buttonIcons: false
- })
- it('should contain default text values', function() {
- initCalendar()
- // will have actual text now
- expect($('.fc-next-button')).toHaveText('next')
- expect($('.fc-nextYear-button')).toHaveText('next year')
- expect($('.fc-prev-button')).toHaveText('prev')
- expect($('.fc-prevYear-button')).toHaveText('prev year')
- expect($('.fc-today-button')).toHaveText('today')
- expect($('.fc-month-button')).toHaveText('month')
- expect($('.fc-basicWeek-button')).toHaveText('week')
- expect($('.fc-agendaWeek-button')).toHaveText('week')
- expect($('.fc-basicDay-button')).toHaveText('day')
- expect($('.fc-agendaDay-button')).toHaveText('day')
- })
- it('should contain specified text values', function() {
- initCalendar({
- buttonText: {
- prev: '<-',
- next: '->',
- prevYear: '<--',
- nextYear: '-->',
- today: 'tidei',
- month: 'mun',
- week: 'wiki',
- day: 'dei'
- }
- })
- expect($('.fc-next-button')).toHaveText('->')
- expect($('.fc-nextYear-button')).toHaveText('-->')
- expect($('.fc-prev-button')).toHaveText('<-')
- expect($('.fc-prevYear-button')).toHaveText('<--')
- expect($('.fc-today-button')).toHaveText('tidei')
- expect($('.fc-month-button')).toHaveText('mun')
- expect($('.fc-agendaDay-button')).toHaveText('dei')
- expect($('.fc-agendaWeek-button')).toHaveText('wiki')
- expect($('.fc-basicDay-button')).toHaveText('dei')
- expect($('.fc-basicWeek-button')).toHaveText('wiki')
- })
- })
- })
- describe('when locale is not default', function() {
- pushOptions({
- locale: 'fr'
- })
- describe('with default buttonIcons', function() {
- it('should contain default text values', function() {
- initCalendar()
- // will contain icons, so will contain no text
- expect($('.fc-next-button')).toHaveText('')
- expect($('.fc-nextYear-button')).toHaveText('')
- expect($('.fc-prev-button')).toHaveText('')
- expect($('.fc-prevYear-button')).toHaveText('')
- expect($('.fc-today-button')).toHaveText('Aujourd\'hui')
- expect($('.fc-month-button')).toHaveText('Mois')
- expect($('.fc-basicWeek-button')).toHaveText('Semaine')
- expect($('.fc-agendaWeek-button')).toHaveText('Semaine')
- expect($('.fc-basicDay-button')).toHaveText('Jour')
- expect($('.fc-agendaDay-button')).toHaveText('Jour')
- })
- it('should contain specified text values', function() {
- initCalendar({
- buttonText: {
- prev: '<-',
- next: '->',
- prevYear: '<--',
- nextYear: '-->',
- today: 'tidei',
- month: 'mun',
- week: 'wiki',
- day: 'dei'
- }
- })
- expect($('.fc-next-button')).toHaveText('->')
- expect($('.fc-nextYear-button')).toHaveText('-->')
- expect($('.fc-prev-button')).toHaveText('<-')
- expect($('.fc-prevYear-button')).toHaveText('<--')
- expect($('.fc-today-button')).toHaveText('tidei')
- expect($('.fc-month-button')).toHaveText('mun')
- expect($('.fc-agendaDay-button')).toHaveText('dei')
- expect($('.fc-agendaWeek-button')).toHaveText('wiki')
- expect($('.fc-basicDay-button')).toHaveText('dei')
- expect($('.fc-basicWeek-button')).toHaveText('wiki')
- })
- })
- describe('with buttonIcons turned off', function() {
- pushOptions({
- buttonIcons: false
- })
- it('should contain default text values', function() {
- initCalendar()
- // will have the locale's actual text now
- expect($('.fc-next-button')).toHaveText('Suivant')
- expect($('.fc-prev-button')).toHaveText('Précédent')
- /// / locales files don't have data for prev/next *year*
- // expect($('.fc-nextYear-button')).toHaveText('Suivant');
- // expect($('.fc-prevYear-button')).toHaveText('Précédent');
- expect($('.fc-today-button')).toHaveText('Aujourd\'hui')
- expect($('.fc-month-button')).toHaveText('Mois')
- expect($('.fc-basicWeek-button')).toHaveText('Semaine')
- expect($('.fc-agendaWeek-button')).toHaveText('Semaine')
- expect($('.fc-basicDay-button')).toHaveText('Jour')
- expect($('.fc-agendaDay-button')).toHaveText('Jour')
- })
- it('should contain specified text values', function() {
- initCalendar({
- buttonText: {
- prev: '<-',
- next: '->',
- prevYear: '<--',
- nextYear: '-->',
- today: 'tidei',
- month: 'mun',
- week: 'wiki',
- day: 'dei'
- }
- })
- expect($('.fc-next-button')).toHaveText('->')
- expect($('.fc-nextYear-button')).toHaveText('-->')
- expect($('.fc-prev-button')).toHaveText('<-')
- expect($('.fc-prevYear-button')).toHaveText('<--')
- expect($('.fc-today-button')).toHaveText('tidei')
- expect($('.fc-month-button')).toHaveText('mun')
- expect($('.fc-agendaDay-button')).toHaveText('dei')
- expect($('.fc-agendaWeek-button')).toHaveText('wiki')
- expect($('.fc-basicDay-button')).toHaveText('dei')
- expect($('.fc-basicWeek-button')).toHaveText('wiki')
- })
- })
- })
- })
|