-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
139 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import ReactTestUtils from 'react-dom/test-utils'; | ||
|
||
import pkg from './package.json'; | ||
import createExpect from '../create-expect'; | ||
|
||
/** | ||
* See https://github.com/facebook/react/blob/v16.4.0/packages/events/SyntheticEvent.js | ||
*/ | ||
describe(`${pkg.name} isReactSyntheticEvent`, () => { | ||
const expectIsReactSyntheticEvent = createExpect(React, ReactDOM, ReactTestUtils); | ||
|
||
it('should return true when argument is instance of react synthetic event', () => { | ||
// Clipboard Event | ||
expectIsReactSyntheticEvent('copy').toBe(true); | ||
// Composition Events | ||
expectIsReactSyntheticEvent('compositionEnd').toBe(true); | ||
// Keyboard Event | ||
expectIsReactSyntheticEvent('keyDown').toBe(true); | ||
// Focus Event | ||
expectIsReactSyntheticEvent('focus').toBe(true); | ||
// Form Event | ||
expectIsReactSyntheticEvent('change').toBe(true); | ||
// Mouse Event | ||
expectIsReactSyntheticEvent('click').toBe(true); | ||
// Pointer Event | ||
expectIsReactSyntheticEvent('pointerDown').toBe(true); | ||
// Selection Event | ||
expectIsReactSyntheticEvent('select').toBe(true); | ||
// Touch Event | ||
expectIsReactSyntheticEvent('touchCancel').toBe(true); | ||
// UI Event | ||
expectIsReactSyntheticEvent('scroll').toBe(true); | ||
// Wheel Event | ||
expectIsReactSyntheticEvent('wheel').toBe(true); | ||
// Media Event | ||
expectIsReactSyntheticEvent('abort').toBe(true); | ||
// Image Event | ||
expectIsReactSyntheticEvent('load').toBe(true); | ||
// Animation Event | ||
expectIsReactSyntheticEvent('animationStart').toBe(true); | ||
// Transition Event | ||
expectIsReactSyntheticEvent('transitionEnd').toBe(true); | ||
// Other Event | ||
expectIsReactSyntheticEvent('toggle').toBe(true); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "v16.13.0", | ||
"version": "1.0.0", | ||
"private": true, | ||
"author": "Taehwan Noh <taehwanno.dev@gmail.com>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"react": "16.13.0", | ||
"react-dom": "16.13.0" | ||
} | ||
} |