From 031da1f96b3e0074e682e35ac909256c37c91864 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Mon, 17 Jun 2013 22:40:01 -0400 Subject: fix($animator): ensure animations are always disabled for an element that is not attached to the DOM --- test/ng/directive/ngSwitchSpec.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'test/ng/directive/ngSwitchSpec.js') diff --git a/test/ng/directive/ngSwitchSpec.js b/test/ng/directive/ngSwitchSpec.js index 9ccb3b12..ab231ec2 100644 --- a/test/ng/directive/ngSwitchSpec.js +++ b/test/ng/directive/ngSwitchSpec.js @@ -216,18 +216,22 @@ describe('ngSwitch', function() { describe('ngSwitch ngAnimate', function() { var vendorPrefix, window; - var body, element; + var body, element, $rootElement; function html(html) { - body.html(html); - element = body.children().eq(0); + $rootElement.html(html); + element = $rootElement.children().eq(0); return element; } - beforeEach(function() { + beforeEach(module(function() { // we need to run animation on attached elements; - body = jqLite(document.body); - }); + return function(_$rootElement_) { + $rootElement = _$rootElement_; + body = jqLite(document.body); + body.append($rootElement); + }; + })); afterEach(function(){ dealoc(body); -- cgit v1.2.3