Skip to content

Commit

Permalink
test: add v16.13.0 test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
taehwanno committed Sep 21, 2020
1 parent 5ff8bfa commit 8aec9dd
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
projects: ['default', 'v0.14.0', 'v15.0.0', 'v16.0.0', 'v16.4.0'].map(version => ({
projects: ['default', 'v0.14.0', 'v15.0.0', 'v16.0.0', 'v16.4.0', 'v16.13.0'].map((version) => ({
displayName: version,
testMatch: [`<rootDir>/tests/${version}/*.spec.js`],
})),
Expand Down
48 changes: 48 additions & 0 deletions tests/v16.13.0/index.spec.js
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);
});
});
79 changes: 79 additions & 0 deletions tests/v16.13.0/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions tests/v16.13.0/package.json
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"
}
}

0 comments on commit 8aec9dd

Please sign in to comment.