aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngAnimate/animateSpec.js
diff options
context:
space:
mode:
authorMatias Niemelä2013-08-21 21:29:40 -0400
committerMisko Hevery2013-08-23 14:04:35 -0700
commitfb3a7db0809b959d50be4cb93a65a91200071dd5 (patch)
tree8179dc125231880b7b48b64d5bcf1cf0d14d1cba /test/ngAnimate/animateSpec.js
parent040aa11ceb510d8f8ec8349a3ca99d9db874daf0 (diff)
downloadangular.js-fb3a7db0809b959d50be4cb93a65a91200071dd5.tar.bz2
feat(ngMock): add support for creating dynamic style sheets within test code
Diffstat (limited to 'test/ngAnimate/animateSpec.js')
-rw-r--r--test/ngAnimate/animateSpec.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js
index 30bf6ba7..37026640 100644
--- a/test/ngAnimate/animateSpec.js
+++ b/test/ngAnimate/animateSpec.js
@@ -1118,11 +1118,15 @@ describe("ngAnimate", function() {
}));
it("should properly execute CSS animations/transitions and use callbacks when using addClass / removeClass",
- inject(function($animate, $rootScope, $sniffer, $rootElement, $timeout) {
+ inject(function($animate, $rootScope, $sniffer, $rootElement, $timeout, $window, $document) {
- var transition = 'transition:11s linear all;';
- var style = transition + ' ' + vendorPrefix + transition;
- var parent = jqLite('<div><span style="' + style + '"></span></div>');
+ var ss = createMockStyleSheet($document, $window);
+ ss.addRule('.klass-add', 'transition:11s linear all');
+ ss.addRule('.klass-add', vendorPrefix + 'transition:11s linear all');
+ ss.addRule('.klass-remove', 'transition:11s linear all');
+ ss.addRule('.klass-remove', vendorPrefix + 'transition:11s linear all');
+
+ var parent = jqLite('<div><span></span></div>');
$rootElement.append(parent);
body.append($rootElement);
var element = jqLite(parent.find('span'));