source: imaps-frontend/node_modules/jsx-ast-utils/__tests__/src/eventHandlers-test.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/* eslint-env mocha */
2import assert from 'assert';
3import includes from 'array-includes';
4import eventHandlers, { eventHandlersByType } from '../../src/eventHandlers';
5
6describe('eventHandlers', () => {
7 it('should contain a list of common JSX event handlers', () => {
8 assert([
9 'onCopy',
10 'onCut',
11 'onPaste',
12 'onCompositionEnd',
13 'onCompositionStart',
14 'onCompositionUpdate',
15 'onKeyDown',
16 'onKeyPress',
17 'onKeyUp',
18 'onFocus',
19 'onBlur',
20 'onChange',
21 'onInput',
22 'onSubmit',
23 'onClick',
24 'onContextMenu',
25 'onDblClick',
26 'onDoubleClick',
27 'onDrag',
28 'onDragEnd',
29 'onDragEnter',
30 'onDragExit',
31 'onDragLeave',
32 'onDragOver',
33 'onDragStart',
34 'onDrop',
35 'onMouseDown',
36 'onMouseEnter',
37 'onMouseLeave',
38 'onMouseMove',
39 'onMouseOut',
40 'onMouseOver',
41 'onMouseUp',
42 'onSelect',
43 'onTouchCancel',
44 'onTouchEnd',
45 'onTouchMove',
46 'onTouchStart',
47 'onScroll',
48 'onWheel',
49 'onAbort',
50 'onCanPlay',
51 'onCanPlayThrough',
52 'onDurationChange',
53 'onEmptied',
54 'onEncrypted',
55 'onEnded',
56 'onError',
57 'onLoadedData',
58 'onLoadedMetadata',
59 'onLoadStart',
60 'onPause',
61 'onPlay',
62 'onPlaying',
63 'onProgress',
64 'onRateChange',
65 'onSeeked',
66 'onSeeking',
67 'onStalled',
68 'onSuspend',
69 'onTimeUpdate',
70 'onVolumeChange',
71 'onWaiting',
72 'onLoad',
73 'onError',
74 'onAnimationStart',
75 'onAnimationEnd',
76 'onAnimationIteration',
77 'onTransitionEnd',
78 ].every((handlerName) => includes(eventHandlers, handlerName)));
79 });
80});
81
82describe('eventHandlersByType', () => {
83 it('should be keyed by type', () => {
84 assert([
85 'clipboard',
86 'composition',
87 'keyboard',
88 'focus',
89 'form',
90 'mouse',
91 'selection',
92 'touch',
93 'ui',
94 'wheel',
95 'media',
96 'image',
97 'animation',
98 'transition',
99 ].every((type) => !!eventHandlersByType[type]));
100 });
101});
Note: See TracBrowser for help on using the repository browser.