Skip to content

Commit

Permalink
unit test of toggleView using single parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ezequiel committed Oct 2, 2013
1 parent 74e6233 commit dd2af76
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/transition/tests/unit/transition.html
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,37 @@ <h1>Transition Tests</h1>
Y.Assert.areEqual(nodes.size(), count);
},

'should toggle using only the named toggle parameter': function() {
var node = Y.one('.demo'), test = this;

// fade out
node.toggleView('fade');

Y.later(1000, null, function() {
test.resume(function() {
Y.Assert.areEqual(0, node.getStyle('opacity'));
Y.Assert.areEqual('none', node.getStyle('display'));
node.destroy();
});
});

this.wait();

// fade in
node.toggleView('fade');

Y.later(1000, null, function() {
test.resume(function() {
Y.Assert.areEqual(1, node.getStyle('opacity'));
Y.Assert.areEqual('block', node.getStyle('display'));
node.destroy();
});
});

this.wait();

},

'should toggle using the named toggle': function() {
var nodes = Y.all('.demo'),
test = this,
Expand Down

0 comments on commit dd2af76

Please sign in to comment.