Skip to content

Commit 64c976f

Browse files
committed
test: add test cases
1 parent 46480ff commit 64c976f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/lib/rules/prefer-find-by.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ ruleTester.run(RULE_NAME, rule, {
5151
it('tests', async () => {
5252
const submitButton = await screen.${queryMethod}('foo')
5353
})
54+
`,
55+
})),
56+
...ASYNC_QUERIES_COMBINATIONS.map((queryMethod) => ({
57+
code: `
58+
import {waitFor} from '${testingFramework}';
59+
it('tests', async () => {
60+
await waitFor(async () => {
61+
const button = screen.${queryMethod}("button", { name: "Submit" })
62+
expect(button).toBeInTheDocument()
63+
})
64+
})
5465
`,
5566
})),
5667
...SYNC_QUERIES_COMBINATIONS.map((queryMethod) => ({
@@ -164,6 +175,17 @@ ruleTester.run(RULE_NAME, rule, {
164175
const { container } = render()
165176
await waitFor(() => expect(container.querySelector('baz')).toBeInTheDocument());
166177
})
178+
`,
179+
},
180+
{
181+
code: `
182+
import {waitFor} from '${testingFramework}';
183+
it('tests', async () => {
184+
await waitFor(async () => {
185+
const button = await foo("button", { name: "Submit" })
186+
expect(button).toBeInTheDocument()
187+
})
188+
})
167189
`,
168190
},
169191
]),

0 commit comments

Comments
 (0)