Skip to content

Commit

Permalink
Add test exercising public API to test BeforeInputEventPlugin + Fallb…
Browse files Browse the repository at this point in the history
…ackCompositionState (#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.
  • Loading branch information
GordyD authored and gaearon committed Feb 22, 2018
1 parent 2bd1222 commit cf58f29
Show file tree
Hide file tree
Showing 3 changed files with 830 additions and 317 deletions.

This file was deleted.

Loading

0 comments on commit cf58f29

Please sign in to comment.