You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.
Following this discussion #45 (comment) which led to a solution with min-document, here is a minimal repro example with jsdom. The event does not get fired.
varjsdom=require('jsdom').jsdom;varmercury=require('mercury');varh=mercury.h;varevent=require('synthetic-dom-events');varcallCount=0;varclick=mercury.input();click(function(){callCount++;});functionrender(onClick){returnh('button',{'ev-click': mercury.event(onClick)},'Click Me');};describe('integration tests',function(){vardocument,$;beforeEach(function(done){vardoc=jsdom('<html><body></body></html>');varwindow=doc.parentWindow;document=window.document;jsdom.jQueryify(doc.parentWindow,"../node_modules/jquery/dist/jquery.js",function(){$=window.$;done();});});describe('clicking the button',function(){beforeEach(function(done){vardiv=document.createElement('div');mercury.app(div,mercury.value(click),render,{document: document});document.body.appendChild(div);$('button').click();// Also tried $('button').trigger('click');setTimeout(done);});it('increments the counter',function(){expect(callCount).to.equal(1);});});});
The text was updated successfully, but these errors were encountered:
The handler fn in dom-delegator is never getting called, so it seems like either the jquery click()/trigger() are not causing the right events for the delegator to pick up, or the delegator is not initialized correctly.
Following this discussion #45 (comment) which led to a solution with
min-document
, here is a minimal repro example withjsdom
. The event does not get fired.The text was updated successfully, but these errors were encountered: