Skip to content

Commit 02dc49e

Browse files
author
Dmitry Drozdov
committed
feat(prefer-user-event): fix typo
1 parent 6707e14 commit 02dc49e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/rules/prefer-user-event.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ The following table lists all the possible equivalents from the low-level API `f
118118
| ---------------- | ----------------------------------------------------------------------------------------------------------- |
119119
| `click` | <ul><li>`click`</li><li>`type`</li><li>`selectOptions`</li><li>`deselectOptions`</li></ul> |
120120
| `change` | <ul><li>`upload`</li><li>`type`</li><li>`clear`</li><li>`selectOptions`</li><li>`deselectOptions`</li></ul> |
121+
| `changeText` | <ul><li>`type`</li></ul> |
121122
| `dblClick` | <ul><li>`dblClick`</li></ul> |
122123
| `input` | <ul><li>`type`</li><li>`upload`</li><li>`selectOptions`</li><li>`deselectOptions`</li><li>`paste`</li></ul> |
123124
| `keyDown` | <ul><li>`type`</li><li>`tab`</li></ul> |
@@ -140,4 +141,3 @@ The following table lists all the possible equivalents from the low-level API `f
140141
| `pointerUp` | <ul><li>`click`</li><li>`dblClick`</li><li>`selectOptions`</li><li>`deselectOptions`</li></ul> |
141142
| `press` | <ul><li>`press`</li></ul> |
142143
| `scroll` | <ul><li>`scrollTo`</li></ul> |
143-
| `type` | <ul><li>`type`</li></ul> |

lib/rules/prefer-user-event.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type UserEventMethodsType = (typeof UserEventMethods)[number];
3333
export const MAPPING_TO_USER_EVENT: Record<string, UserEventMethodsType[]> = {
3434
click: ['click', 'type', 'selectOptions', 'deselectOptions'],
3535
change: ['upload', 'type', 'clear', 'selectOptions', 'deselectOptions'],
36+
changeText: ['type'],
3637
dblClick: ['dblClick'],
3738
input: ['type', 'upload', 'selectOptions', 'deselectOptions', 'paste'],
3839
keyDown: ['type', 'tab'],
@@ -55,7 +56,6 @@ export const MAPPING_TO_USER_EVENT: Record<string, UserEventMethodsType[]> = {
5556
pointerUp: ['click', 'dblClick', 'selectOptions', 'deselectOptions'],
5657
press: ['press'],
5758
scroll: ['scrollTo'],
58-
type: ['type'],
5959
};
6060

6161
function buildErrorMessage(fireEventMethod: string) {

0 commit comments

Comments
 (0)