From fd9f4a526fbcabc89f93f661bad1e58d073e282a Mon Sep 17 00:00:00 2001 From: Andre Wiggins Date: Wed, 22 Nov 2023 12:08:45 -0800 Subject: [PATCH] Remove focus from event capturing tests Using focus as a test event for capturing is failing in some browsers (I tested Edge & Chrome). Adding timeouts seemed to fix it, but instead of trying to workaround flakiness, I'm removing focus testing as it doesn't seem necessary for this test. --- test/browser/events.test.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/test/browser/events.test.js b/test/browser/events.test.js index 3f64e4378a..8a2732adf9 100644 --- a/test/browser/events.test.js +++ b/test/browser/events.test.js @@ -155,29 +155,23 @@ describe('event handling', () => { // Skip test if browser doesn't support passive events if (supportsPassiveEvents()) { it('should use capturing for event props ending with *Capture', () => { - let click = sinon.spy(), - focus = sinon.spy(); + let click = sinon.spy(); render( -
-
, scratch ); - let root = scratch.firstChild; - root.firstElementChild.click(); - root.firstElementChild.focus(); + let btn = scratch.firstChild.firstElementChild; + btn.click(); expect(click, 'click').to.have.been.calledOnce; - // Focus delegation requires a 50b hack I'm not sure we want to incur - expect(focus, 'focus').to.have.been.calledOnce; - // IE doesn't set it if (!/Edge/.test(navigator.userAgent)) { expect(click).to.have.been.calledWithMatch({ eventPhase: 0 }); // capturing - expect(focus).to.have.been.calledWithMatch({ eventPhase: 0 }); // capturing } });