Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 5a44eb2

Browse files
Foxandxsswesleycho
authored andcommitted
chore(tests): bump to 1.4.5
Closes #4303
1 parent 9b094a0 commit 5a44eb2

File tree

3 files changed

+37
-9
lines changed

3 files changed

+37
-9
lines changed

Diff for: src/collapse/test/collapse.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('collapse directive', function() {
101101
var collapseHeight = element.height();
102102
scope.exp = true;
103103
scope.$digest();
104-
expect(element.height()).toBeGreaterThan(collapseHeight);
104+
expect(element.height()).toBe(collapseHeight);
105105
});
106106

107107
it('should shrink accordingly when content size inside collapse decreases', function() {

Diff for: src/dropdown/test/dropdown.spec.js

+17-8
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,14 @@ describe('dropdownToggle', function() {
325325
it('should call it correctly when toggles', function() {
326326
$rootScope.isopen = true;
327327
$rootScope.$digest();
328-
$animate.triggerCallbacks();
328+
329+
$animate.flush();
330+
$rootScope.$digest();
329331
expect($rootScope.toggleHandler).toHaveBeenCalledWith(true);
330332

331333
clickDropdownToggle();
332-
$animate.triggerCallbacks();
334+
$animate.flush();
335+
$rootScope.$digest();
333336
expect($rootScope.toggleHandler).toHaveBeenCalledWith(false);
334337
});
335338
});
@@ -343,19 +346,22 @@ describe('dropdownToggle', function() {
343346
});
344347

345348
it('should not have been called initially', function() {
346-
$animate.triggerCallbacks();
347349
expect($rootScope.toggleHandler).not.toHaveBeenCalled();
348350
});
349351

350352
it('should call it correctly when toggles', function() {
351353
$rootScope.isopen = false;
352354
$rootScope.$digest();
353-
$animate.triggerCallbacks();
355+
356+
$animate.flush();
357+
$rootScope.$digest();
354358
expect($rootScope.toggleHandler).toHaveBeenCalledWith(false);
355359

356360
$rootScope.isopen = true;
357361
$rootScope.$digest();
358-
$animate.triggerCallbacks();
362+
363+
$animate.flush();
364+
$rootScope.$digest();
359365
expect($rootScope.toggleHandler).toHaveBeenCalledWith(true);
360366
});
361367
});
@@ -368,17 +374,20 @@ describe('dropdownToggle', function() {
368374
});
369375

370376
it('should not have been called initially', function() {
371-
$animate.triggerCallbacks();
372377
expect($rootScope.toggleHandler).not.toHaveBeenCalled();
373378
});
374379

375380
it('should call it when clicked', function() {
376381
clickDropdownToggle();
377-
$animate.triggerCallbacks();
382+
383+
$animate.flush();
384+
$rootScope.$digest();
378385
expect($rootScope.toggleHandler).toHaveBeenCalledWith(true);
379386

380387
clickDropdownToggle();
381-
$animate.triggerCallbacks();
388+
389+
$animate.flush();
390+
$rootScope.$digest();
382391
expect($rootScope.toggleHandler).toHaveBeenCalledWith(false);
383392
});
384393
});

Diff for: src/modal/test/modal.spec.js

+19
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ describe('$modal', function () {
155155
$rootScope.$digest();
156156
if (!noFlush) {
157157
$animate.flush();
158+
$rootScope.$digest();
159+
$animate.flush();
160+
$rootScope.$digest();
158161
}
159162
return closed;
160163
}
@@ -164,6 +167,9 @@ describe('$modal', function () {
164167
$rootScope.$digest();
165168
if (!noFlush) {
166169
$animate.flush();
170+
$rootScope.$digest();
171+
$animate.flush();
172+
$rootScope.$digest();
167173
}
168174
return closed;
169175
}
@@ -233,6 +239,8 @@ describe('$modal', function () {
233239
triggerKeyDown($document, 27);
234240
$animate.flush();
235241
$rootScope.$digest();
242+
$animate.flush();
243+
$rootScope.$digest();
236244

237245
expect($document).toHaveModalsOpen(0);
238246
});
@@ -253,6 +261,8 @@ describe('$modal', function () {
253261
triggerKeyDown(button, 27);
254262
$animate.flush();
255263
$rootScope.$digest();
264+
$animate.flush();
265+
$rootScope.$digest();
256266

257267
expect($document).toHaveModalsOpen(0);
258268

@@ -268,6 +278,8 @@ describe('$modal', function () {
268278
$document.find('body > div.modal').click();
269279
$animate.flush();
270280
$rootScope.$digest();
281+
$animate.flush();
282+
$rootScope.$digest();
271283

272284
expect($document).toHaveModalsOpen(0);
273285
});
@@ -286,6 +298,8 @@ describe('$modal', function () {
286298
triggerKeyDown($document, 27);
287299
$animate.flush();
288300
$rootScope.$digest();
301+
$animate.flush();
302+
$rootScope.$digest();
289303

290304
expect(document.activeElement.tagName).toBe('A');
291305
expect($document).toHaveModalsOpen(0);
@@ -310,6 +324,8 @@ describe('$modal', function () {
310324
triggerKeyDown($document, 27);
311325
$animate.flush();
312326
$rootScope.$digest();
327+
$animate.flush();
328+
$rootScope.$digest();
313329

314330
expect(document.activeElement.tagName).toBe('BODY');
315331
expect($document).toHaveModalsOpen(0);
@@ -339,6 +355,9 @@ describe('$modal', function () {
339355
expect(modal.result).toBeRejectedWith('$uibUnscheduledDestruction');
340356

341357
$animate.flush();
358+
$rootScope.$digest();
359+
$animate.flush();
360+
$rootScope.$digest();
342361
expect($document).toHaveModalsOpen(0);
343362
});
344363

0 commit comments

Comments
 (0)