Skip to content

Make the tests for the summary text more accepting of line breaks.#2

Open
yeojunjie wants to merge 2 commits intoreactpractice-dev:mainfrom
yeojunjie:patch-1
Open

Make the tests for the summary text more accepting of line breaks.#2
yeojunjie wants to merge 2 commits intoreactpractice-dev:mainfrom
yeojunjie:patch-1

Conversation

@yeojunjie
Copy link

Solutions which include

<p>Displaying {pokemons.length} of {totalNumOfPokemons} results.</p>

will show up as

<p>
  "Displaying "
  "5"
  " of "
  "1302"
  " results."
</p>

which is not detected by .findByText as it currently is.

This modification makes the tests for the summary text more accepting of line breaks caused by using {} within <p></p>.

@corinadev
Copy link

Thank you for your contribution!

Are you sure it's the line breaks that cause the tests to fail? The official solution also shows the summary wrapped in <p> tags and does pass 🤔
Take a look here: https://github.com/reactpractice-dev/load-more-pokemons/blob/solution/src/pokemon-list.jsx

If you will share your solution, I'd be happy to take a look to see what else might be the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants