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

toHaveText fails with percentage character #4567

Open
1 task
angelica-snowit opened this issue Sep 4, 2024 · 1 comment
Open
1 task

toHaveText fails with percentage character #4567

angelica-snowit opened this issue Sep 4, 2024 · 1 comment

Comments

@angelica-snowit
Copy link

angelica-snowit commented Sep 4, 2024

What happened?

I have this statement
await expect(element(by.id('price-discount')).atIndex(0)).toHaveText('%');

that fails with this message:
Test Failed: Failed expectation: TOHAVETEXT(text == “”) WITH MATCHER(id == “price-discount”) AT INDEX(0)

The % character disappears.
Adding text before or after lead to the same result.

What was the expected behaviour?

The test should pass if text is "%"

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: 20.25.6
React Native version: 0.75.2
Has Fabric (React Native's new rendering system) enabled: no
Node version: v20.17.0
Test-runner (select one): jest

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
paste logs here!

More data, please!

No response

@asafkorem
Copy link
Contributor

might work with \u0025 or \%

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

No branches or pull requests

2 participants