From 033424401d355878ab87ba62982697a525b6b224 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sat, 8 Aug 2020 09:40:18 +0200 Subject: [PATCH 1/8] test: Add current behavior for event types of onFocus/onBlur --- .../__tests__/SyntheticFocusEvent-test.js | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 packages/react-dom/src/events/__tests__/SyntheticFocusEvent-test.js diff --git a/packages/react-dom/src/events/__tests__/SyntheticFocusEvent-test.js b/packages/react-dom/src/events/__tests__/SyntheticFocusEvent-test.js new file mode 100644 index 000000000000..c455b38b9e76 --- /dev/null +++ b/packages/react-dom/src/events/__tests__/SyntheticFocusEvent-test.js @@ -0,0 +1,70 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +describe('SyntheticFocusEvent', () => { + let React; + let ReactDOM; + let container; + + beforeEach(() => { + jest.resetModules(); + React = require('react'); + ReactDOM = require('react-dom'); + + container = document.createElement('div'); + document.body.appendChild(container); + }); + + afterEach(() => { + document.body.removeChild(container); + container = null; + }); + + test('onFocus events have the focus type', () => { + const log = []; + ReactDOM.render( +