Browse files

Animate unit tests now run end and clean up properly

  • Loading branch information...
1 parent 0e19f14 commit 5439f53dad0e458a1fa3d03a8e285cf2164d9f00 @brianchirls committed Mar 27, 2012
Showing with 12 additions and 3 deletions.
  1. +12 −3 test/popcorn-base.unit.js
View
15 test/popcorn-base.unit.js
@@ -309,7 +309,7 @@ test('animate', function() {
var popcorn, exp = 3;
Popcorn.basePlugin('test', function(options, base) {
- var ret = base.animate('prop');
+ var eventId, ret = base.animate('prop');
ok(ret, 'base.animate returns true when successful');
return {
start: function(event, options) {
@@ -338,13 +338,16 @@ test('animate', function() {
}
});
+ eventId = popcorn.getLastTrackEventId();
+ popcorn.removeTrackEvent(eventId);
+
popcorn.destroy();
Popcorn.removePlugin('test');
});
test('animated property with non-animated value', function() {
- var popcorn, exp = 2;
+ var popcorn, exp = 2, eventId;
Popcorn.basePlugin('test', function(options, base) {
@@ -374,13 +377,16 @@ test('animated property with non-animated value', function() {
prop: 10
});
+ eventId = popcorn.getLastTrackEventId();
+ popcorn.removeTrackEvent(eventId);
+
popcorn.destroy();
Popcorn.removePlugin('test');
});
test('animate with callback', function() {
- var popcorn, exp = 2;
+ var popcorn, exp = 2, eventId;
Popcorn.basePlugin('test', function(options, base) {
var value;
@@ -414,6 +420,9 @@ test('animate with callback', function() {
}
});
+ eventId = popcorn.getLastTrackEventId();
+ popcorn.removeTrackEvent(eventId);
+
popcorn.destroy();
Popcorn.removePlugin('test');
});

0 comments on commit 5439f53

Please sign in to comment.