Skip to content

Commit

Permalink
Fix test now we use capture phase
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
trueadm committed Jul 3, 2020
1 parent 9bb50d1 commit 1326bb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions packages/react-dom/src/events/DOMModernPluginEventSystem.js
Expand Up @@ -42,12 +42,10 @@ import {

import getEventTarget from './getEventTarget';
import {
TOP_FOCUS,
TOP_LOAD,
TOP_ABORT,
TOP_CANCEL,
TOP_INVALID,
TOP_BLUR,
TOP_SCROLL,
TOP_CLOSE,
TOP_RESET,
Expand Down Expand Up @@ -178,8 +176,6 @@ function extractEvents(
}

export const capturePhaseEvents: Set<DOMTopLevelEventType> = new Set([
TOP_FOCUS,
TOP_BLUR,
TOP_SCROLL,
TOP_LOAD,
TOP_ABORT,
Expand Down
Expand Up @@ -854,9 +854,9 @@ describe('DOMModernPluginEventSystem', () => {
divElement.focus();
expect(onFocus).toHaveBeenCalledTimes(3);
expect(onFocusCapture).toHaveBeenCalledTimes(3);
expect(log[2]).toEqual(['capture', divElement]);
expect(log[3]).toEqual(['bubble', divElement]);
expect(log[4]).toEqual(['capture', buttonElement]);
expect(log[2]).toEqual(['capture', buttonElement]);
expect(log[3]).toEqual(['capture', divElement]);
expect(log[4]).toEqual(['bubble', divElement]);
expect(log[5]).toEqual(['bubble', buttonElement]);
});

Expand Down

0 comments on commit 1326bb2

Please sign in to comment.