Detox icon indicating copy to clipboard operation
Detox copied to clipboard

toHaveText fails with percentage character

Open angelica-snowit opened this issue 1 year ago • 1 comments

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

angelica-snowit avatar Sep 04 '24 13:09 angelica-snowit

might work with \u0025 or \%

asafkorem avatar Sep 16 '24 11:09 asafkorem

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this repository, read this discussion.

stale[bot] avatar Jan 22 '25 00:01 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Feb 01 '25 01:02 stale[bot]