Skip to content

Commit a00cc96

Browse files
committed
add note about find queries being preferred
1 parent 393ba2f commit a00cc96

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/__tests__/wait-for-element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test('waits for element to appear in the document', async () => {
2222
expect(console.warn.mock.calls).toMatchInlineSnapshot(`
2323
Array [
2424
Array [
25-
"\`waitForElement\` has been deprecated. Use \`wait\` instead (it's the same API, so you can find/replace): https://testing-library.com/docs/dom-testing-library/api-async#wait",
25+
"\`waitForElement\` has been deprecated. Use a \`find*\` query (preferred: https://testing-library.com/docs/dom-testing-library/api-queries#findby) or use \`wait\` instead (it's the same API, so you can find/replace): https://testing-library.com/docs/dom-testing-library/api-async#wait",
2626
],
2727
]
2828
`)

src/wait-for-element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async function waitForElement(callback, options) {
99
if (!hasWarned) {
1010
hasWarned = true
1111
console.warn(
12-
`\`waitForElement\` has been deprecated. Use \`wait\` instead (it's the same API, so you can find/replace): https://testing-library.com/docs/dom-testing-library/api-async#wait`,
12+
`\`waitForElement\` has been deprecated. Use a \`find*\` query (preferred: https://testing-library.com/docs/dom-testing-library/api-queries#findby) or use \`wait\` instead (it's the same API, so you can find/replace): https://testing-library.com/docs/dom-testing-library/api-async#wait`,
1313
)
1414
}
1515
if (!callback) {

0 commit comments

Comments
 (0)