Skip to content

Commit 7de4ee1

Browse files
committed
test: add tests
1 parent 920f7ac commit 7de4ee1

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ ruleTester.run(RULE_NAME, rule, {
231231
},
232232
{
233233
code: `
234-
// case: custom module set but not imported using ${testingFramework} (aggressive reporting limited)
235234
import { screen } from '${testingFramework}';
236235
237236
const ui = {
@@ -241,6 +240,32 @@ ruleTester.run(RULE_NAME, rule, {
241240
const select = ui.select.get();
242241
expect(select).toHaveClass(selectClasses.select);
243242
});
243+
`,
244+
},
245+
{
246+
settings: { 'testing-library/utils-module': 'test-utils' },
247+
code: `
248+
// case: custom module set but not imported using ${testingFramework} (aggressive reporting limited)
249+
import { screen, render } from 'test-utils';
250+
import MyComponent from './MyComponent'
251+
252+
test('...', async () => {
253+
const { user } = render(<MyComponent />)
254+
await user.click(screen.getByRole("button"))
255+
});
256+
`,
257+
},
258+
{
259+
settings: { 'testing-library/utils-module': 'test-utils' },
260+
code: `
261+
// case: custom module set but not imported using ${testingFramework} (aggressive reporting limited)
262+
import { screen, render } from 'test-utils';
263+
import MyComponent from './MyComponent'
264+
265+
test('...', async () => {
266+
const result = render(<MyComponent />)
267+
await result.user.click(screen.getByRole("button"))
268+
});
244269
`,
245270
},
246271
]

0 commit comments

Comments
 (0)