diff options
| author | Matias Niemelä | 2013-07-23 23:02:15 -0400 |
|---|---|---|
| committer | Misko Hevery | 2013-07-26 23:49:54 -0700 |
| commit | 8ed0d5b6aa2e29ebc8d2026cb04380ed3343baef (patch) | |
| tree | 2c14004d495badc36f6336a322160e9ec2c3cf5b /test/ng | |
| parent | 81923f1e41560327f7de6e8fddfda0d2612658f3 (diff) | |
| download | angular.js-8ed0d5b6aa2e29ebc8d2026cb04380ed3343baef.tar.bz2 | |
chore($animate): replace show/hide with addClass/removeClass
Diffstat (limited to 'test/ng')
| -rw-r--r-- | test/ng/animateSpec.js | 14 | ||||
| -rw-r--r-- | test/ng/directive/ngShowHideSpec.js | 8 |
2 files changed, 5 insertions, 17 deletions
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(); })); |
