Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offer puppeteer extend-expect methods #2

Open
patrickhulce opened this issue Jun 29, 2018 · 2 comments
Open

offer puppeteer extend-expect methods #2

patrickhulce opened this issue Jun 29, 2018 · 2 comments
Labels

Comments

@patrickhulce
Copy link
Collaborator

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')
// ...
@crs1138
Copy link

crs1138 commented Dec 3, 2021

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?

@patrickhulce
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants