From 8ed0d5b6aa2e29ebc8d2026cb04380ed3343baef Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Tue, 23 Jul 2013 23:02:15 -0400 Subject: chore($animate): replace show/hide with addClass/removeClass --- test/ng/animateSpec.js | 14 +------------- test/ng/directive/ngShowHideSpec.js | 8 ++++---- 2 files changed, 5 insertions(+), 17 deletions(-) (limited to 'test/ng') diff --git a/test/ng/animateSpec.js b/test/ng/animateSpec.js index 7f440bb5..c5914a74 100644 --- a/test/ng/animateSpec.js +++ b/test/ng/animateSpec.js @@ -31,22 +31,10 @@ describe("$animate", function() { expect(element.text()).toBe('21'); })); - it("should animate the show animation event", inject(function($animate) { - element.addClass('ng-hide'); - $animate.show(element); - expect(element).toBeShown(); - })); - - it("should animate the hide animation event", inject(function($animate) { - expect(element).toBeShown(); - $animate.hide(element); - expect(element).toBeHidden(); - })); - it("should still perform DOM operations even if animations are disabled", inject(function($animate) { $animate.enabled(false); expect(element).toBeShown(); - $animate.hide(element); + $animate.addClass(element, 'ng-hide'); expect(element).toBeHidden(); })); }); diff --git a/test/ng/directive/ngShowHideSpec.js b/test/ng/directive/ngShowHideSpec.js index f8193a12..be0a3895 100644 --- a/test/ng/directive/ngShowHideSpec.js +++ b/test/ng/directive/ngShowHideSpec.js @@ -81,14 +81,14 @@ describe('ngShow / ngHide animations', function() { ))($scope); $scope.$digest(); - item = $animate.process('show').element; + item = $animate.process('removeClass').element; expect(item.text()).toBe('data'); expect(item).toBeShown(); $scope.on = false; $scope.$digest(); - item = $animate.process('hide').element; + item = $animate.process('addClass').element; expect(item.text()).toBe('data'); expect(item).toBeHidden(); })); @@ -104,14 +104,14 @@ describe('ngShow / ngHide animations', function() { ))($scope); $scope.$digest(); - item = $animate.process('hide').element; + item = $animate.process('addClass').element; expect(item.text()).toBe('datum'); expect(item).toBeHidden(); $scope.off = false; $scope.$digest(); - item = $animate.process('show').element; + item = $animate.process('removeClass').element; expect(item.text()).toBe('datum'); expect(item).toBeShown(); })); -- cgit v1.2.3