Skip to content

expect assertion fails when filtered by table name #529

Answered by jrolfs
InduKrish asked this question in Q&A
Discussion options

You must be logged in to vote

Your text match is probably too specific when matching against a parent element. See https://testing-library.com/docs/queries/about#textmatch. Please try to reference the Testing Library documentation when troubleshooting queries.

const header = await this.screen.findByTestId("editable-nested-table-GroupCode");
const base =   await this.within(header).findByText(/LINEHOLDER/); // <--- Use a `RegExp` here?

await expect(base).toContainText(text);

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jrolfs
Comment options

@InduKrish
Comment options

Answer selected by jrolfs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #520 on September 23, 2022 00:47.