Skip to content

Commit

Permalink
Change DOM event test
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhannes committed Nov 6, 2016
1 parent 0a81824 commit 3532aef
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/events.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ describe( "Events", () => {
select( "div.test" ).trigger( "click" );

expect( test ).to.be.true;

} );

it( "should fire multiple events correctly", function () {
Expand All @@ -24,7 +23,18 @@ describe( "Events", () => {
select( "div.test" ).trigger( "click" );

expect( test ).to.be.equal( 4 );
} );

it( "should detect events on selector", function () {
let test = false;

select( "div.test" ).on( "click", () => { test = true; } );

// here we change the DOM after the select.on event handler
document.body.innerHTML = "<div class='test'></div>";
select( "div.test" ).trigger( "click" );

expect( test ).to.be.true;
} );

} );

0 comments on commit 3532aef

Please sign in to comment.