aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatias Niemelä2014-01-22 12:38:26 -0500
committerMatias Niemelä2014-01-24 12:21:29 -0500
commitca6b7d0fa2e355ebd764230260758cee9a4ebe1e (patch)
tree98992bed78ed529da0617fd94c0d1f1573ff7078 /test
parent40dc806e03b81cf8bdbb24d67c8e8e3c8af42324 (diff)
downloadangular.js-ca6b7d0fa2e355ebd764230260758cee9a4ebe1e.tar.bz2
feat($animate): provide support for a close callback
Closes #5685 Closes #5053 Closes #4993
Diffstat (limited to 'test')
-rw-r--r--test/ngAnimate/animateSpec.js15
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',