Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit d6129b1

Browse files
committed
chore(tests): cleanup the tests
Signed-off-by: Josh Kurz <josh.kurz@turner.com>
1 parent 0c8d6e1 commit d6129b1

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

test/calendar.spec.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('uiCalendar', function () {
8989
});
9090

9191
/* test the calendar's initial setup */
92-
it('expects the calendar to be set up with the correct options and events', function () {
92+
it('should set up the calendar with the correct options and events', function () {
9393
expect($.fn.fullCalendar.mostRecentCall.args[0].eventSources[0].length).toBe(4);
9494
expect($.fn.fullCalendar.mostRecentCall.args[0].eventSources[0][0].title).toBe('All Day Event');
9595
expect($.fn.fullCalendar.mostRecentCall.args[0].eventSources[0][0].url).toBe('http://www.angularjs.org');
@@ -99,7 +99,7 @@ describe('uiCalendar', function () {
9999
expect($.fn.fullCalendar.mostRecentCall.args[0].weekends).toEqual(false);
100100
});
101101
/* Test to make sure that when an event is added to the calendar everything is updated with the new event. */
102-
it('expects that when events are added to the calendar the fullcalendar will call its renderEvent method', function () {
102+
it('should call its renderEvent method', function () {
103103
expect($.fn.fullCalendar.mostRecentCall.args[0].eventSources[0].length).toEqual(4);
104104
expect($.fn.fullCalendar.callCount).toEqual(1);
105105
scope.addChild(scope.events);
@@ -112,7 +112,7 @@ describe('uiCalendar', function () {
112112
expect($.fn.fullCalendar.mostRecentCall.args[0]).toEqual('renderEvent');
113113
});
114114
/* Test to see if calendar is calling removeEvents when an event is removed */
115-
it('removes the correct event from the event source.', function () {
115+
it('should remove the correct event from the event source.', function () {
116116
//remove an event from the scope.
117117
scope.remove(scope.events2,0);
118118
scope.$apply();
@@ -129,15 +129,15 @@ describe('uiCalendar', function () {
129129
expect(callCount).toEqual(3);
130130
});
131131
/* Test to see if calendar is updating when a new eventSource is added. */
132-
it('updates the calendar if an eventSource is Added', function () {
132+
it('should update the calendar if an eventSource is Added', function () {
133133
scope.addSource(scope.events4);
134134
scope.$apply();
135135
//eventSources should auto update inside the calendar.
136136
var fullCalendarParam = $.fn.fullCalendar.mostRecentCall.args[0];
137137
expect(fullCalendarParam).toEqual('addEventSource');
138138
});
139139
/* Test to see if calendar is updating when an eventSource replaces another with an equal length. */
140-
it('updates the calendar if an eventSource has same length as prior eventSource', function () {
140+
it('should update the calendar if an eventSource has same length as prior eventSource', function () {
141141
//replace source with one that has the same length
142142
scope.eventSources.splice(1,1,scope.events3);
143143
scope.$apply();
@@ -156,14 +156,14 @@ describe('uiCalendar', function () {
156156
expect(callCount).toEqual(4);
157157
});
158158

159-
it('make sure the calendar can work with extended event sources', function () {
159+
it('should work with extended event sources', function () {
160160
scope.eventSources.push(scope.calEventsExt);
161161
scope.$apply();
162162
var fullCalendarParam = $.fn.fullCalendar.mostRecentCall.args[0];
163163
expect(fullCalendarParam).toEqual('addEventSource');
164164
});
165165

166-
it('make sure that if we just change the title of the event that it updates itself', function () {
166+
it('should make sure that if we just change the title of the event that it updates itself', function () {
167167
scope.events[0].title = 'change title';
168168
scope.$apply();
169169
var fullCalendarParam = $.fn.fullCalendar.mostRecentCall.args[0];
@@ -172,7 +172,7 @@ describe('uiCalendar', function () {
172172
expect(fullCalendarParam1).toEqual(scope.events[0]);
173173
});
174174

175-
it('make sure that if the calendars options change then the fullcalendar method is called with the new options', function () {
175+
it('should make sure that if the calendars options change then the fullcalendar method is called with the new options', function () {
176176
expect($.fn.fullCalendar.mostRecentCall.args[0].weekends).toEqual(false);
177177
scope.uiConfig.calendar.weekends = true;
178178
scope.$apply();
@@ -206,11 +206,11 @@ describe('uiCalendar', function () {
206206
scope.$apply();
207207
});
208208

209-
it('make sure changeWatcher is initialized', function () {
209+
it('should make sure changeWatcher is initialized', function () {
210210
expect(calendarCtrl.changeWatcher).not.toBe(undefined);
211211
});
212212

213-
it('makes sure the correct function is called when an event source is added or removed', function () {
213+
it('should make sure the correct function is called when an event source is added or removed', function () {
214214
var sourceWatcher = calendarCtrl.changeWatcher(scope.eventSources,calendarCtrl.sourcesFingerprint);
215215
expect(sourcesChanged).toBe(false);
216216
sourceWatcher.subscribe(scope);
@@ -225,7 +225,7 @@ describe('uiCalendar', function () {
225225
expect(sourcesChanged).toBe('removed');
226226
});
227227

228-
it('makes sure the correct function is called when a single event is added or removed', function () {
228+
it('should make sure the correct function is called when a single event is added or removed', function () {
229229
var eventsWatcher = calendarCtrl.changeWatcher(calendarCtrl.allEvents,calendarCtrl.eventsFingerprint);
230230
expect(sourcesChanged).toBe(false);
231231
eventsWatcher.subscribe(scope);
@@ -244,7 +244,7 @@ describe('uiCalendar', function () {
244244
expect(sourcesChanged).toBe('changed');
245245
});
246246

247-
it('makes sure the correct function is called when the calendarWatchEvent function is return variable is altered', function () {
247+
it('should make sure the correct function is called when the calendarWatchEvent function is return variable is altered', function () {
248248
scope.testX = 0;
249249

250250
scope.calendarWatchEvent = function(){
@@ -266,7 +266,7 @@ describe('uiCalendar', function () {
266266
expect(sourcesChanged).toBe('changed');
267267
});
268268

269-
it('makes sure that eventSources in extended form are tracked properly', function () {
269+
it('should make sure that eventSources in extended form are tracked properly', function () {
270270
scope.testX = 0;
271271
scope.eventSources.push(scope.calEventsExt);
272272
var calendarCtrl2 = $controller('uiCalendarCtrl', {$scope: scope, $element: null});
@@ -301,22 +301,22 @@ describe('uiCalendar', function () {
301301
scope.$apply();
302302
});
303303

304-
it('make sure the calendar sets the myCalendar object to the defining scope', function () {
304+
it('should make sure the calendar sets the myCalendar object to the defining scope', function () {
305305
expect(scope.myCalendar).not.toBe(undefined);
306306
});
307307
});
308308

309309
describe('Local variable config testing and option overriding', function(){
310310

311-
it('sets names for $locale by default', function() {
311+
it('should set names for $locale by default', function() {
312312
spyOn($.fn, 'fullCalendar');
313313
$locale.DATETIME_FORMATS.MONTH[0] = 'enero';
314314
$compile('<div ui-calendar="uiConfig.calendar" ng-model="eventSources"></div>')(scope);
315315
scope.$apply();
316316
expect($.fn.fullCalendar.mostRecentCall.args[0].monthNames[0]).toBe('enero');
317317
});
318318

319-
it('allows overriding names for $locale', function() {
319+
it('should allow overriding names for $locale', function() {
320320
spyOn($.fn, 'fullCalendar');
321321
scope.uiConfig.calendar.monthNames = $locale.DATETIME_FORMATS.MONTH.slice();
322322
scope.uiConfig.calendar.monthNames[0] = 'custom name';
@@ -326,7 +326,7 @@ describe('uiCalendar', function () {
326326
});
327327

328328
/* Test to make sure header options can be overwritten */
329-
it('overwrites default header options', function () {
329+
it('should overwrite default header options', function () {
330330
spyOn($.fn, 'fullCalendar');
331331
scope.uiConfig2 = {
332332
calendar:{
@@ -350,7 +350,7 @@ describe('uiCalendar', function () {
350350
scope.$apply();
351351
});
352352

353-
it('makes sure that all config functions are called in an angular context', inject(function($timeout, $rootScope){
353+
it('should make sure that all config functions are called in an angular context', inject(function($timeout, $rootScope){
354354
var functionCount = 0;
355355
scope.uiConfig = {
356356
calendar:{
@@ -385,7 +385,7 @@ describe('uiCalendar', function () {
385385
});
386386
}));
387387

388-
it('makes sure that any function that already has an apply in it does not break the calendar (backwards compatible)', inject(function($timeout, $rootScope){
388+
it('should make sure that any function that already has an apply in it does not break the calendar (backwards compatible)', inject(function($timeout, $rootScope){
389389

390390
var functionCount = 0;
391391
scope.uiConfig = {

0 commit comments

Comments
 (0)