added unit test for new target and type keys in Kinetic event object

This commit is contained in:
Eric Rowell 2014-03-20 22:04:59 -07:00
parent 47ecb4559d
commit ddf34d0af9

View File

@ -881,7 +881,8 @@ suite('MouseEvents', function() {
radius: 70, radius: 70,
strokeWidth: 4, strokeWidth: 4,
fill: 'red', fill: 'red',
stroke: 'black' stroke: 'black',
id: 'myCircle'
}); });
var group1 = new Kinetic.Group(); var group1 = new Kinetic.Group();
@ -919,7 +920,9 @@ suite('MouseEvents', function() {
e.push('group2'); e.push('group2');
}); });
layer.on('click', function(evt) { layer.on('click', function(evt) {
console.log(evt) //console.log(evt)
assert.equal(evt.target.id(), 'myCircle');
assert.equal(evt.type, 'click');
e.push('layer'); e.push('layer');
}); });
stage.on('click', function(evt) { stage.on('click', function(evt) {