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

Commit 7d2d257

Browse files
committed
chore(animateSpec): provide meaningful CSS class names in animation tests
1 parent b89584d commit 7d2d257

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

test/ngAnimate/animateSpec.js

+25-25
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ describe("ngAnimate", function() {
132132
var captured = false;
133133
module(function($provide, $animateProvider) {
134134
$provide.value('$rootElement', rootElm);
135-
$animateProvider.register('.ani', function() {
135+
$animateProvider.register('.capture-animation', function() {
136136
return {
137137
addClass : function(element, className, done) {
138138
captured = true;
@@ -147,7 +147,7 @@ describe("ngAnimate", function() {
147147

148148
$animate.enabled(true);
149149

150-
var element = $compile('<div class="ani"></div>')($rootScope);
150+
var element = $compile('<div class="capture-animation"></div>')($rootScope);
151151
rootElm.append(element);
152152

153153
expect(captured).toBe(false);
@@ -695,17 +695,17 @@ describe("ngAnimate", function() {
695695

696696
$animate.enabled(true);
697697

698-
ss.addRule('.ani.ng-enter, .ani.ng-leave, .ani-fake.ng-enter, .ani-fake.ng-leave',
698+
ss.addRule('.real-animation.ng-enter, .real-animation.ng-leave, .real-animation-fake.ng-enter, .real-animation-fake.ng-leave',
699699
'-webkit-animation:1s my_animation;' +
700700
'animation:1s my_animation;');
701701

702-
ss.addRule('.ani.ng-enter-stagger, .ani.ng-leave-stagger',
702+
ss.addRule('.real-animation.ng-enter-stagger, .real-animation.ng-leave-stagger',
703703
'-webkit-animation-delay:0.1s;' +
704704
'-webkit-animation-duration:0s;' +
705705
'animation-delay:0.1s;' +
706706
'animation-duration:0s;');
707707

708-
ss.addRule('.ani-fake.ng-enter-stagger, .ani-fake.ng-leave-stagger',
708+
ss.addRule('.fake-animation.ng-enter-stagger, .fake-animation.ng-leave-stagger',
709709
'-webkit-animation-delay:0.1s;' +
710710
'-webkit-animation-duration:1s;' +
711711
'animation-delay:0.1s;' +
@@ -716,7 +716,7 @@ describe("ngAnimate", function() {
716716
var elements = [];
717717
for(var i = 0; i < 5; i++) {
718718
var newScope = $rootScope.$new();
719-
var element = $compile('<div class="ani"></div>')(newScope);
719+
var element = $compile('<div class="real-animation"></div>')(newScope);
720720
$animate.enter(element, container);
721721
elements.push(element);
722722
};
@@ -733,7 +733,7 @@ describe("ngAnimate", function() {
733733
for(var i = 0; i < 5; i++) {
734734
dealoc(elements[i]);
735735
var newScope = $rootScope.$new();
736-
var element = $compile('<div class="ani-fake"></div>')(newScope);
736+
var element = $compile('<div class="fake-animation"></div>')(newScope);
737737
$animate.enter(element, container);
738738
elements[i] = element;
739739
};
@@ -755,11 +755,11 @@ describe("ngAnimate", function() {
755755

756756
$animate.enabled(true);
757757

758-
ss.addRule('.ani.ng-enter, .ani.ng-leave',
758+
ss.addRule('.stagger-animation.ng-enter, .stagger-animation.ng-leave',
759759
'-webkit-animation:my_animation 1s 1s, your_animation 1s 2s;' +
760760
'animation:my_animation 1s 1s, your_animation 1s 2s;');
761761

762-
ss.addRule('.ani.ng-enter-stagger, .ani.ng-leave-stagger',
762+
ss.addRule('.stagger-animation.ng-enter-stagger, .stagger-animation.ng-leave-stagger',
763763
'-webkit-animation-delay:0.1s;' +
764764
'animation-delay:0.1s;');
765765

@@ -768,7 +768,7 @@ describe("ngAnimate", function() {
768768
var elements = [];
769769
for(var i = 0; i < 4; i++) {
770770
var newScope = $rootScope.$new();
771-
var element = $compile('<div class="ani"></div>')(newScope);
771+
var element = $compile('<div class="stagger-animation"></div>')(newScope);
772772
$animate.enter(element, container);
773773
elements.push(element);
774774
};
@@ -985,17 +985,17 @@ describe("ngAnimate", function() {
985985

986986
$animate.enabled(true);
987987

988-
ss.addRule('.ani.ng-enter, .ani.ng-leave, .ani-fake.ng-enter, .ani-fake.ng-leave',
988+
ss.addRule('.real-animation.ng-enter, .real-animation.ng-leave, .real-animation-fake.ng-enter, .real-animation-fake.ng-leave',
989989
'-webkit-transition:1s linear all;' +
990990
'transition:1s linear all;');
991991

992-
ss.addRule('.ani.ng-enter-stagger, .ani.ng-leave-stagger',
992+
ss.addRule('.real-animation.ng-enter-stagger, .real-animation.ng-leave-stagger',
993993
'-webkit-transition-delay:0.1s;' +
994994
'-webkit-transition-duration:0s;' +
995995
'transition-delay:0.1s;' +
996996
'transition-duration:0s;');
997997

998-
ss.addRule('.ani-fake.ng-enter-stagger, .ani-fake.ng-leave-stagger',
998+
ss.addRule('.fake-animation.ng-enter-stagger, .fake-animation.ng-leave-stagger',
999999
'-webkit-transition-delay:0.1s;' +
10001000
'-webkit-transition-duration:1s;' +
10011001
'transition-delay:0.1s;' +
@@ -1006,7 +1006,7 @@ describe("ngAnimate", function() {
10061006
var elements = [];
10071007
for(var i = 0; i < 5; i++) {
10081008
var newScope = $rootScope.$new();
1009-
var element = $compile('<div class="ani"></div>')(newScope);
1009+
var element = $compile('<div class="real-animation"></div>')(newScope);
10101010
$animate.enter(element, container);
10111011
elements.push(element);
10121012
};
@@ -1023,7 +1023,7 @@ describe("ngAnimate", function() {
10231023
for(var i = 0; i < 5; i++) {
10241024
dealoc(elements[i]);
10251025
var newScope = $rootScope.$new();
1026-
var element = $compile('<div class="ani-fake"></div>')(newScope);
1026+
var element = $compile('<div class="fake-animation"></div>')(newScope);
10271027
$animate.enter(element, container);
10281028
elements[i] = element;
10291029
};
@@ -1045,11 +1045,11 @@ describe("ngAnimate", function() {
10451045

10461046
$animate.enabled(true);
10471047

1048-
ss.addRule('.ani.ng-enter, .ani.ng-leave',
1048+
ss.addRule('.stagger-animation.ng-enter, .ani.ng-leave',
10491049
'-webkit-transition:1s linear color 2s, 3s linear font-size 4s;' +
10501050
'transition:1s linear color 2s, 3s linear font-size 4s;');
10511051

1052-
ss.addRule('.ani.ng-enter-stagger, .ani.ng-leave-stagger',
1052+
ss.addRule('.stagger-animation.ng-enter-stagger, .ani.ng-leave-stagger',
10531053
'-webkit-transition-delay:0.1s;' +
10541054
'transition-delay:0.1s;');
10551055

@@ -1058,7 +1058,7 @@ describe("ngAnimate", function() {
10581058
var elements = [];
10591059
for(var i = 0; i < 4; i++) {
10601060
var newScope = $rootScope.$new();
1061-
var element = $compile('<div class="ani"></div>')(newScope);
1061+
var element = $compile('<div class="stagger-animation"></div>')(newScope);
10621062
$animate.enter(element, container);
10631063
elements.push(element);
10641064
};
@@ -1080,13 +1080,13 @@ describe("ngAnimate", function() {
10801080

10811081
$animate.enabled(true);
10821082

1083-
ss.addRule('.ani.ng-enter, .ani.ng-leave',
1083+
ss.addRule('.stagger-animation.ng-enter, .stagger-animation.ng-leave',
10841084
'-webkit-animation:my_animation 1s 1s, your_animation 1s 2s;' +
10851085
'animation:my_animation 1s 1s, your_animation 1s 2s;' +
10861086
'-webkit-transition:1s linear all 1s;' +
10871087
'transition:1s linear all 1s;');
10881088

1089-
ss.addRule('.ani.ng-enter-stagger, .ani.ng-leave-stagger',
1089+
ss.addRule('.stagger-animation.ng-enter-stagger, .stagger-animation.ng-leave-stagger',
10901090
'-webkit-transition-delay:0.1s;' +
10911091
'transition-delay:0.1s;' +
10921092
'-webkit-animation-delay:0.2s;' +
@@ -1097,7 +1097,7 @@ describe("ngAnimate", function() {
10971097
var elements = [];
10981098
for(var i = 0; i < 3; i++) {
10991099
var newScope = $rootScope.$new();
1100-
var element = $compile('<div class="ani"></div>')(newScope);
1100+
var element = $compile('<div class="stagger-animation"></div>')(newScope);
11011101
$animate.enter(element, container);
11021102
elements.push(element);
11031103
};
@@ -1763,16 +1763,16 @@ describe("ngAnimate", function() {
17631763

17641764
if (!$sniffer.animations) return;
17651765

1766-
ss.addRule('.ani.ng-enter', '-webkit-animation: my_animation 2s linear;' +
1767-
'animation: my_animation 2s linear');
1766+
ss.addRule('.sleek-animation.ng-enter', '-webkit-animation: my_animation 2s linear;' +
1767+
'animation: my_animation 2s linear');
17681768

17691769
ss.addRule('.trans.ng-enter', '-webkit-transition:1s linear all;' +
17701770
'transition:1s linear all');
17711771

17721772
var propertyKey = ($sniffer.vendorPrefix == 'Webkit' ? '-webkit-' : '') + 'transition-property';
17731773

17741774
var element = html($compile('<div>...</div>')($rootScope));
1775-
var child = $compile('<div class="ani">...</div>')($rootScope);
1775+
var child = $compile('<div class="skeep-animation">...</div>')($rootScope);
17761776
child.css(propertyKey,'background-color');
17771777

17781778
$animate.enter(child, element);
@@ -1784,7 +1784,7 @@ describe("ngAnimate", function() {
17841784
expect(child.css(propertyKey)).toBe('background-color');
17851785
child.remove();
17861786

1787-
child = $compile('<div class="ani">...</div>')($rootScope);
1787+
child = $compile('<div class="sleek-animation">...</div>')($rootScope);
17881788
child.attr('class','trans');
17891789
$animate.enter(child, element);
17901790
$rootScope.$digest();

0 commit comments

Comments
 (0)