Skip to content

Commit

Permalink
Added test for non-bubbling event listener on root el
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-steele-idem committed Oct 15, 2017
1 parent 26ab32f commit 9ff4c90
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class {
onMount() {
this.mouseMoveEvent = undefined;
}
handleMouseMove() {
this.mouseMoveEvent = true;
}
}

<div on-mousemove("handleMouseMove")/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var expect = require('chai').expect;

module.exports = function(helpers) {
var component = helpers.mount(require('./index'), {});

expect(component.mouseMoveEvent).to.equal(undefined);

var rootEl = helpers.targetEl.querySelector('div');

helpers.triggerMouseMove(rootEl);

expect(component.mouseMoveEvent).to.equal(true);
};

0 comments on commit 9ff4c90

Please sign in to comment.