Closed
Description
@testing-library/react
version: ^10.0.0-beta.2react
version: 16.13.0node
version: 12npm
(oryarn
) version: 1.12.2
Relevant code or config:
it.only('should not submit with empty fields', async () => {
const { username } = renderLogin();
user.type(username, variables.username);
user.click(screen.getByText(/Login/i));
await screen.findByText('Password is required');
screen.debug();
});
What you did:
Run above test with latest beta version
What happened:
Test passes however in my console I get a deprecation warning for API I didn't use
console.warn node_modules/@testing-library/dom/dist/wait-for-element.js:17
`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
Suggested solution:
Only show above warning if waitForElement is used
Metadata
Metadata
Assignees
Labels
No labels