Skip to content

Commit 69d9dff

Browse files
committed
test: add tests for valid cases
1 parent ddd100f commit 69d9dff

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,34 @@ ruleTester.run(RULE_NAME, rule, {
341341
});
342342
`,
343343
},
344+
{
345+
code: `
346+
import { screen } from '${testingFramework}';
347+
348+
class Hoge {
349+
submit() {}
350+
click() {}
351+
}
352+
353+
test('...', () => {
354+
const pm = new Hoge();
355+
pm.click();
356+
pm.submit();
357+
});`,
358+
},
359+
{
360+
code: `
361+
import { user } from 'hoge'
362+
import { screen } from '${testingFramework}';
363+
364+
test('...', () => {
365+
const button = screen.getByRole('button');
366+
user.click(button)
367+
user.select(button)
368+
user.submit(button)
369+
})
370+
`,
371+
},
344372
]
345373
),
346374
invalid: SUPPORTED_TESTING_FRAMEWORKS.flatMap((testingFramework) => [

0 commit comments

Comments
 (0)