offer puppeteer extend-expect methods
while technically not part of dom-testing-library it'd be nice to offer the same convenience expectations. Maybe this belongs in jest-puppeteer?
import 'dom-testing-library/extend-expect'
// <span data-testid="greetings">Hello World</span>
expect(queryByTestId(container, 'greetings')).toBeInTheDOM()
expect(queryByTestId(container, 'greetings')).not.toHaveTextContent('Bye bye')
// ...
Any updates on this?
Btw. Meanwhile, what is the best way of asserting that an element is in the DOM without having the .toBeInTheDOM() function at hand?
Any updates on this?
Nope. Looking at this several years later, this does not seem very important IMO 😅 The text content handler would be nice but the first one doesn't seem to have any benefits over getByTestId unless there's something I'm missing...
what is the best way of asserting that an element is in the DOM without having the .toBeInTheDOM() function at hand?
await getByTestId(container, 'greetings') is my preferred pick for a nice error message with surrounding context.