Skip to content

Commit 4269fcb

Browse files
committed
test: add valid cases
1 parent c7a7bdd commit 4269fcb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/lib/rules/no-node-access.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import rule, {
55
Options,
66
MessageIds,
77
} from '../../../lib/rules/no-node-access';
8-
import { EVENT_HANDLER_METHODS } from '../../../lib/utils';
8+
import { EVENT_HANDLER_METHODS, EVENTS_SIMULATORS } from '../../../lib/utils';
99
import { createRuleTester } from '../test-utils';
1010

1111
const ruleTester = createRuleTester();
@@ -163,6 +163,14 @@ ruleTester.run(RULE_NAME, rule, {
163163
expect(screen.getByText('SomeComponent')).toBeInTheDocument();
164164
`,
165165
},
166+
...EVENTS_SIMULATORS.map((simulator) => ({
167+
code: `
168+
import { screen } from '${testingFramework}';
169+
170+
const buttonText = screen.getByText('submit');
171+
${simulator}.click(buttonText);
172+
`,
173+
})),
166174
]
167175
),
168176
invalid: SUPPORTED_TESTING_FRAMEWORKS.flatMap((testingFramework) => [

0 commit comments

Comments
 (0)