Pārlūkot izejas kodu

test for en-gb columnFormat bug

Adam Shaw 11 gadi atpakaļ
vecāks
revīzija
89de9d07be
2 mainītis faili ar 26 papildinājumiem un 6 dzēšanām
  1. 0 6
      lang/en-gb.js
  2. 26 0
      tests/automated/columnFormat.js

+ 0 - 6
lang/en-gb.js

@@ -1,6 +0,0 @@
-
-$.fullCalendar.lang("en-gb", {
-	columnFormat: {
-		week: 'ddd D/M'
-	}
-});

+ 26 - 0
tests/automated/columnFormat.js

@@ -87,6 +87,32 @@ describe('columnFormat', function() {
         });
         });
     });
     });
 
 
+    describe('when lang is en-gb', function() {
+
+        var viewWithFormat = [ { view: 'month', expected: 'Sun', selector: 'th.fc-day-header.fc-sun' },
+            { view: 'basicWeek', expected: 'Sun 11/5', selector: 'th.fc-day-header.fc-sun' },
+            { view: 'agendaWeek', expected: 'Sun 11/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() {
+            $('#cal').fullCalendar({
+                defaultDate: '2014-05-11',
+                lang: 'en-gb'
+            });
+        });
+
+        it('should have the translated dates', function() {
+            var cal = $('#cal');
+
+            for (var i = 0; i <  viewWithFormat.length; i++) {
+                var crtView = viewWithFormat[i];
+                cal.fullCalendar('changeView', crtView.view);
+                expect(cal.find(crtView.selector).text()).toBe(crtView.expected);
+            };
+        });
+    });
+
     describe('when lang is Korean', function() {
     describe('when lang is Korean', function() {
 
 
         var viewWithFormat = [ { view: 'month', expected: '일', selector: 'th.fc-day-header.fc-sun' },
         var viewWithFormat = [ { view: 'month', expected: '일', selector: 'th.fc-day-header.fc-sun' },