Fix incorrect copy-paste in test (#19657)
Dan Abramov committed
Aug 20, 2020 at 01:47 UTC
08e69f65b44f5e5501c796be6f7b272441ebd0e6
1 file changed
+4
-4
packages/react-dom/src/events/__tests__/DOMPluginEventSystem-test.internal.js
+4
-4
@@ -967,8 +967,8 @@ describe('DOMPluginEventSystem', () => {
967
<div ref={middleDivRef}>
968
<div
969
ref={divRef}
970
- onClick={onFocus}
971
- onClickCapture={onFocusCapture}
970
+ onFocus={onFocus}
971
+ onFocusCapture={onFocusCapture}
972
tabIndex={0}>
973
Click me!
974
</div>
@@ -980,7 +980,7 @@ describe('DOMPluginEventSystem', () => {
980
React.useLayoutEffect(() => {
981
// This should prevent the portalElement listeners from
982
// capturing the events in the bubble phase.
983
- middleDivRef.current.addEventListener('click', e => {
983
+ middleDivRef.current.addEventListener('focusin', e => {
984
e.stopPropagation();
985
});
986
});
@@ -1007,7 +1007,7 @@ describe('DOMPluginEventSystem', () => {
1007
const divElement = divRef.current;
1008
divElement.focus();
1009
expect(onFocus).toHaveBeenCalledTimes(1);
1010
- expect(onFocusCapture).toHaveBeenCalledTimes(1);
1010
+ expect(onFocusCapture).toHaveBeenCalledTimes(3);
1011
1012
document.body.removeChild(portalElement);
1013
});