Skip to content

Commit cf58f29

Browse files
GordyDgaearon
authored andcommitted
Add test exercising public API to test BeforeInputEventPlugin + FallbackCompositionState (#11849)
* Add test exercising public API to test BeforeInputEventPlugin + FallbackCompositionState - I've adopted a similar approach to the existing test for BeforeInputEventPlugin - I've simulated events and then assert the event handler for onBeforeInput is fired or not fired based on the test conditions - The scenarios are tested against IE11, Webkite and Presto environment simulations - I've encorporated what I understand to be the functionality in the FallbackCompositionState test * Prettier * Linting fixes * Remove test for contenteditable in Presto - the contenteditable type is not supported in Presto powered browsers (Opera). * Remove mention of Presto as this explicit condition is no longer handled in BeforeInputEventPlugin. We still need to exercise usage of FallbackCompositionState though so let's keep a test where the env does not support Composition and Text events. * Add tests for envs with only CompositionEvent support * Remove internal tests no longer needed * Shorten test case names to satisfy lint rules * Add tests for onCompositionStart and onCompositionUpdte events The BeforeInputEventPlugin is responsible for emitting these events so we need to add tests for this. This also ensure we exercise the code path that, L207, that was not previously exercised with the public tests.
1 parent 2bd1222 commit cf58f29

File tree

3 files changed

+830
-317
lines changed

3 files changed

+830
-317
lines changed

packages/react-dom/src/events/__tests__/BeforeInputEventPlugin-test.internal.js

Lines changed: 0 additions & 226 deletions
This file was deleted.

0 commit comments

Comments
 (0)