From a00cc963358a79ae3cb5389e707e5924cb874ee2 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Wed, 4 Mar 2020 10:52:50 -0700 Subject: [PATCH] add note about find queries being preferred --- src/__tests__/wait-for-element.js | 2 +- src/wait-for-element.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/__tests__/wait-for-element.js b/src/__tests__/wait-for-element.js index 63c8ed55..2ed61b8d 100644 --- a/src/__tests__/wait-for-element.js +++ b/src/__tests__/wait-for-element.js @@ -22,7 +22,7 @@ test('waits for element to appear in the document', async () => { expect(console.warn.mock.calls).toMatchInlineSnapshot(` Array [ Array [ - "\`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", + "\`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", ], ] `) diff --git a/src/wait-for-element.js b/src/wait-for-element.js index 59a4cd77..e86c1860 100644 --- a/src/wait-for-element.js +++ b/src/wait-for-element.js @@ -9,7 +9,7 @@ async function waitForElement(callback, options) { if (!hasWarned) { hasWarned = true console.warn( - `\`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`, + `\`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`, ) } if (!callback) {