Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit acd9e7b

Browse files
committed
fixup! fix(ngAnimate): correctly animate transcluded clones with templateUrl
1 parent a281b5a commit acd9e7b

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

test/ngAnimate/animateSpec.js

+44-44
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ describe('animations', function() {
168168
inject(function($animate, $rootScope) {
169169
$animate.enter(element, parent);
170170
$rootScope.$digest();
171-
expect(capturedAnimation).toBeFalsy();
171+
expect(capturedAnimation).toBe(null);
172172
expect(element[0].parentNode).toEqual(parent[0]);
173173

174174
hidden = false;
@@ -188,7 +188,7 @@ describe('animations', function() {
188188

189189
$animate.enter(element, parent);
190190
$rootScope.$digest();
191-
expect(capturedAnimation).toBeFalsy();
191+
expect(capturedAnimation).toBe(null);
192192

193193
element.addClass('only-allow-this-animation');
194194

@@ -208,7 +208,7 @@ describe('animations', function() {
208208

209209
$animate.enter(svgElement, parent);
210210
$rootScope.$digest();
211-
expect(capturedAnimation).toBeFalsy();
211+
expect(capturedAnimation).toBe(null);
212212

213213
svgElement.attr('class', 'element only-allow-this-animation-svg');
214214

@@ -290,7 +290,7 @@ describe('animations', function() {
290290
$animate.leave(element);
291291
$rootScope.$digest();
292292

293-
expect(capturedAnimation).toBeFalsy();
293+
expect(capturedAnimation).toBe(null);
294294
expect(element[0].parentNode).toBeFalsy();
295295
});
296296
});
@@ -314,9 +314,9 @@ describe('animations', function() {
314314

315315
$animate.enter(element, parent);
316316

317-
expect(capturedAnimation).toBeFalsy();
317+
expect(capturedAnimation).toBe(null);
318318
$rootScope.$digest();
319-
expect(capturedAnimation).toBeFalsy();
319+
expect(capturedAnimation).toBe(null);
320320
}));
321321

322322
it('should disable all animations on the given element',
@@ -328,15 +328,15 @@ describe('animations', function() {
328328
expect($animate.enabled(element)).toBeFalsy();
329329

330330
$animate.addClass(element, 'red');
331-
expect(capturedAnimation).toBeFalsy();
331+
expect(capturedAnimation).toBe(null);
332332
$rootScope.$digest();
333-
expect(capturedAnimation).toBeFalsy();
333+
expect(capturedAnimation).toBe(null);
334334

335335
$animate.enabled(element, true);
336336
expect($animate.enabled(element)).toBeTruthy();
337337

338338
$animate.addClass(element, 'blue');
339-
expect(capturedAnimation).toBeFalsy();
339+
expect(capturedAnimation).toBe(null);
340340
$rootScope.$digest();
341341
expect(capturedAnimation).toBeTruthy();
342342
}));
@@ -347,14 +347,14 @@ describe('animations', function() {
347347
$animate.enabled(parent, false);
348348

349349
$animate.enter(element, parent);
350-
expect(capturedAnimation).toBeFalsy();
350+
expect(capturedAnimation).toBe(null);
351351
$rootScope.$digest();
352-
expect(capturedAnimation).toBeFalsy();
352+
expect(capturedAnimation).toBe(null);
353353

354354
$animate.enabled(parent, true);
355355

356356
$animate.enter(element, parent);
357-
expect(capturedAnimation).toBeFalsy();
357+
expect(capturedAnimation).toBe(null);
358358
$rootScope.$digest();
359359
expect(capturedAnimation).toBeTruthy();
360360
}));
@@ -370,11 +370,11 @@ describe('animations', function() {
370370

371371
$animate.addClass(element, 'red');
372372
$rootScope.$digest();
373-
expect(capturedAnimation).toBeFalsy();
373+
expect(capturedAnimation).toBe(null);
374374

375375
$animate.addClass(child, 'red');
376376
$rootScope.$digest();
377-
expect(capturedAnimation).toBeFalsy();
377+
expect(capturedAnimation).toBe(null);
378378

379379
$animate.enabled(element, true);
380380

@@ -402,7 +402,7 @@ describe('animations', function() {
402402
$rootScope.items = [1,2,3,4,5];
403403
$rootScope.$digest();
404404

405-
expect(capturedAnimation).toBeFalsy();
405+
expect(capturedAnimation).toBe(null);
406406
}));
407407

408408
it('should not attempt to perform an animation on a text node element',
@@ -414,7 +414,7 @@ describe('animations', function() {
414414
$animate.addClass(textNode, 'some-class');
415415
$rootScope.$digest();
416416

417-
expect(capturedAnimation).toBeFalsy();
417+
expect(capturedAnimation).toBe(null);
418418
}));
419419

420420
it('should not attempt to perform an animation on an empty jqLite collection',
@@ -426,7 +426,7 @@ describe('animations', function() {
426426
$animate.addClass(emptyNode, 'some-class');
427427
$rootScope.$digest();
428428

429-
expect(capturedAnimation).toBeFalsy();
429+
expect(capturedAnimation).toBe(null);
430430
})
431431
);
432432

@@ -439,7 +439,7 @@ describe('animations', function() {
439439

440440
$animate.leave(textNode);
441441
$rootScope.$digest();
442-
expect(capturedAnimation).toBeFalsy();
442+
expect(capturedAnimation).toBe(null);
443443
expect(textNode[0].parentNode).not.toBe(parentNode);
444444
}));
445445

@@ -455,7 +455,7 @@ describe('animations', function() {
455455

456456
$animate.leave(commentNode);
457457
$rootScope.$digest();
458-
expect(capturedAnimation).toBeFalsy();
458+
expect(capturedAnimation).toBe(null);
459459
expect(commentNode[0].parentNode).not.toBe(parentNode);
460460
}));
461461

@@ -687,13 +687,13 @@ describe('animations', function() {
687687

688688
$animate.removeClass(element, 'something-to-remove');
689689
$rootScope.$digest();
690-
expect(capturedAnimation).toBeFalsy();
690+
expect(capturedAnimation).toBe(null);
691691

692692
element.addClass('something-to-add');
693693

694694
$animate.addClass(element, 'something-to-add');
695695
$rootScope.$digest();
696-
expect(capturedAnimation).toBeFalsy();
696+
expect(capturedAnimation).toBe(null);
697697
}));
698698
});
699699

@@ -709,7 +709,7 @@ describe('animations', function() {
709709
parent.append(element);
710710
$animate.animate(element, null, toStyle);
711711
$rootScope.$digest();
712-
expect(capturedAnimation).toBeFalsy();
712+
expect(capturedAnimation).toBe(null);
713713
});
714714
});
715715

@@ -720,7 +720,7 @@ describe('animations', function() {
720720
parent.append(element);
721721
$animate.animate(element, fromStyle);
722722
$rootScope.$digest();
723-
expect(capturedAnimation).toBeFalsy();
723+
expect(capturedAnimation).toBe(null);
724724
}));
725725

726726
it('should perform an animation if only from styles are provided as well as any valid classes',
@@ -732,7 +732,7 @@ describe('animations', function() {
732732
var options = { removeClass: 'goop' };
733733
$animate.animate(element, fromStyle, null, null, options);
734734
$rootScope.$digest();
735-
expect(capturedAnimation).toBeFalsy();
735+
expect(capturedAnimation).toBe(null);
736736

737737
fromStyle = { color: 'blue' };
738738
options = { addClass: 'goop' };
@@ -836,11 +836,11 @@ describe('animations', function() {
836836

837837
var elm1 = $compile('<div class="animated"></div>')($rootScope);
838838

839-
expect(capturedAnimation).toBeFalsy();
839+
expect(capturedAnimation).toBe(null);
840840
$animate.addClass(elm1, 'klass2');
841-
expect(capturedAnimation).toBeFalsy();
841+
expect(capturedAnimation).toBe(null);
842842
$rootScope.$digest();
843-
expect(capturedAnimation).toBeFalsy();
843+
expect(capturedAnimation).toBe(null);
844844
}));
845845

846846
it('should skip animations if the element is attached to the $rootElement, but not apart of the body',
@@ -854,30 +854,30 @@ describe('animations', function() {
854854
newParent.append($rootElement);
855855
$rootElement.append(elm1);
856856

857-
expect(capturedAnimation).toBeFalsy();
857+
expect(capturedAnimation).toBe(null);
858858
$animate.addClass(elm1, 'klass2');
859-
expect(capturedAnimation).toBeFalsy();
859+
expect(capturedAnimation).toBe(null);
860860
$rootScope.$digest();
861-
expect(capturedAnimation).toBeFalsy();
861+
expect(capturedAnimation).toBe(null);
862862
}));
863863

864864
it('should skip the animation if the element is removed from the DOM before the post digest kicks in',
865865
inject(function($animate, $rootScope) {
866866

867867
$animate.enter(element, parent);
868-
expect(capturedAnimation).toBeFalsy();
868+
expect(capturedAnimation).toBe(null);
869869

870870
element.remove();
871871
$rootScope.$digest();
872-
expect(capturedAnimation).toBeFalsy();
872+
expect(capturedAnimation).toBe(null);
873873
}));
874874

875875
it('should be blocked when there is an ongoing structural parent animation occurring',
876876
inject(function($rootScope, $rootElement, $animate) {
877877

878878
parent.append(element);
879879

880-
expect(capturedAnimation).toBeFalsy();
880+
expect(capturedAnimation).toBe(null);
881881
$animate.move(parent, parent2);
882882
$rootScope.$digest();
883883

@@ -887,7 +887,7 @@ describe('animations', function() {
887887

888888
$animate.addClass(element, 'blue');
889889
$rootScope.$digest();
890-
expect(capturedAnimation).toBeFalsy();
890+
expect(capturedAnimation).toBe(null);
891891
}));
892892

893893
it('should disable all child animations for atleast one turn when a structural animation is issued',
@@ -937,7 +937,7 @@ describe('animations', function() {
937937

938938
parent.append(element);
939939

940-
expect(capturedAnimation).toBeFalsy();
940+
expect(capturedAnimation).toBe(null);
941941
$animate.addClass(parent, 'rogers');
942942
$rootScope.$digest();
943943

@@ -960,7 +960,7 @@ describe('animations', function() {
960960
$animate.addClass(element, 'rumlow');
961961
$animate.move(parent, null, parent2);
962962

963-
expect(capturedAnimation).toBeFalsy();
963+
expect(capturedAnimation).toBe(null);
964964
expect(capturedAnimationHistory.length).toBe(0);
965965
$rootScope.$digest();
966966

@@ -1213,12 +1213,12 @@ describe('animations', function() {
12131213
inject(function($animate, $rootScope) {
12141214

12151215
$animate.enter(element, parent);
1216-
expect(capturedAnimation).toBeFalsy();
1216+
expect(capturedAnimation).toBe(null);
12171217

12181218
$animate.addClass(element, 'red');
12191219
expect(element).not.toHaveClass('red');
12201220

1221-
expect(capturedAnimation).toBeFalsy();
1221+
expect(capturedAnimation).toBe(null);
12221222
$rootScope.$digest();
12231223

12241224
expect(capturedAnimation[1]).toBe('enter');
@@ -1247,7 +1247,7 @@ describe('animations', function() {
12471247
$animate.removeClass(element, 'red');
12481248
$rootScope.$digest();
12491249

1250-
expect(capturedAnimation).toBeFalsy();
1250+
expect(capturedAnimation).toBe(null);
12511251

12521252
$animate.addClass(element, 'blue');
12531253
$rootScope.$digest();
@@ -1364,7 +1364,7 @@ describe('animations', function() {
13641364
$animate.removeClass(element, 'four');
13651365

13661366
$rootScope.$digest();
1367-
expect(capturedAnimation).toBeFalsy();
1367+
expect(capturedAnimation).toBe(null);
13681368
}));
13691369

13701370
it('but not skip the animation if it is a structural animation and if there are no classes to be animated',
@@ -1652,7 +1652,7 @@ describe('animations', function() {
16521652

16531653
$animate.addClass(animateElement, 'red');
16541654
$rootScope.$digest();
1655-
expect(capturedAnimation).toBeFalsy();
1655+
expect(capturedAnimation).toBe(null);
16561656

16571657
// Pin the element to the app root to enable animations
16581658
$animate.pin(pinElement, $rootElement);
@@ -1696,13 +1696,13 @@ describe('animations', function() {
16961696

16971697
$animate.addClass(animateElement, 'red');
16981698
$rootScope.$digest();
1699-
expect(capturedAnimation).toBeFalsy();
1699+
expect(capturedAnimation).toBe(null);
17001700

17011701
$animate.pin(pinElement, pinTargetElement);
17021702

17031703
$animate.addClass(animateElement, 'blue');
17041704
$rootScope.$digest();
1705-
expect(capturedAnimation).toBeFalsy();
1705+
expect(capturedAnimation).toBe(null);
17061706

17071707
dealoc(pinElement);
17081708
});
@@ -1740,7 +1740,7 @@ describe('animations', function() {
17401740

17411741
$animate.addClass(animateElement, 'blue');
17421742
$rootScope.$digest();
1743-
expect(capturedAnimation).toBeFalsy();
1743+
expect(capturedAnimation).toBe(null);
17441744

17451745
$animate.enabled(pinHostElement, true);
17461746

0 commit comments

Comments
 (0)