Skip to content

Commit 101485b

Browse files
committed
test: prefer-query-by-disappearance
1 parent 588a72c commit 101485b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/lib/rules/prefer-query-by-disappearance.test.ts

+22
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ ruleTester.run(RULE_NAME, rule, {
1515
await waitForElementToBeRemoved(button)
1616
`,
1717
},
18+
{
19+
code: `
20+
import { screen } from '@marko/testing-library';
21+
22+
const button = screen.getByRole('button')
23+
await waitForElementToBeRemoved(button)
24+
`,
25+
},
1826
{
1927
code: `
2028
import { screen } from '@testing-library/react';
@@ -221,6 +229,20 @@ ruleTester.run(RULE_NAME, rule, {
221229
},
222230
],
223231
},
232+
{
233+
code: `
234+
import { screen, waitForElementToBeRemoved } from '@marko/testing-library';
235+
236+
await waitForElementToBeRemoved(() => screen.getByText("hello"))
237+
`,
238+
errors: [
239+
{
240+
messageId: 'preferQueryByDisappearance',
241+
line: 4,
242+
column: 41,
243+
},
244+
],
245+
},
224246
{
225247
code: `
226248
import { screen, waitForElementToBeRemoved } from '@testing-library/react';

0 commit comments

Comments
 (0)