diff options
| author | Matias Niemelä | 2014-01-22 12:38:26 -0500 |
|---|---|---|
| committer | Matias Niemelä | 2014-01-24 12:21:29 -0500 |
| commit | ca6b7d0fa2e355ebd764230260758cee9a4ebe1e (patch) | |
| tree | 98992bed78ed529da0617fd94c0d1f1573ff7078 /test/ngAnimate/animateSpec.js | |
| parent | 40dc806e03b81cf8bdbb24d67c8e8e3c8af42324 (diff) | |
| download | angular.js-ca6b7d0fa2e355ebd764230260758cee9a4ebe1e.tar.bz2 | |
feat($animate): provide support for a close callback
Closes #5685
Closes #5053
Closes #4993
Diffstat (limited to 'test/ngAnimate/animateSpec.js')
| -rw-r--r-- | test/ngAnimate/animateSpec.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index 6d9367bd..a5123929 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -1519,7 +1519,13 @@ describe("ngAnimate", function() { steps.push(['after', data.className, data.event]); }); - $animate.addClass(element, 'klass'); + element.on('$animate:close', function(e, data) { + steps.push(['close', data.className, data.event]); + }); + + $animate.addClass(element, 'klass', function() { + steps.push(['done', 'klass', 'addClass']); + }); $timeout.flush(1); @@ -1529,6 +1535,13 @@ describe("ngAnimate", function() { $timeout.flush(1); expect(steps.pop()).toEqual(['after', 'klass', 'addClass']); + + browserTrigger(element,'transitionend', { timeStamp: Date.now() + 1000, elapsedTime: 1 }); + $timeout.flush(1); + + expect(steps.shift()).toEqual(['close', 'klass', 'addClass']); + + expect(steps.shift()).toEqual(['done', 'klass', 'addClass']); })); it('should fire the DOM callbacks even if no animation is rendered', |
