Skip to content

[iOS] Fix duplicated testID#4186

Merged
m-bert merged 2 commits into
mainfrom
@mbert/duplicated-testid
May 22, 2026
Merged

[iOS] Fix duplicated testID#4186
m-bert merged 2 commits into
mainfrom
@mbert/duplicated-testid

Conversation

@m-bert
Copy link
Copy Markdown
Collaborator

@m-bert m-bert commented May 21, 2026

Description

This PR fixes duplicated testID prop on iOS. Same accessibilityLabel was assigned to both, wrapper and button, therefore frameworks like Detox failed due to multiple elements with the same ID.

Fixes #3698

Test plan

Tested on branch with e2e tests.

Copilot AI review requested due to automatic review settings May 21, 2026 09:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an iOS/Fabric issue where testID was applied to both the wrapper component view and the underlying button, causing e2e frameworks (e.g. Detox) to see multiple matches for a single by.id(...) query.

Changes:

  • Clears accessibilityIdentifier from the wrapper view after Fabric’s super updateProps applies testID, so only the actual _buttonView keeps the identifier.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@m-bert m-bert requested a review from j-piasecki May 22, 2026 08:27
@m-bert m-bert merged commit 7feab6e into main May 22, 2026
7 checks passed
@m-bert m-bert deleted the @mbert/duplicated-testid branch May 22, 2026 09:48
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.

Duplicated testID on RectButton (iOS and Fabric only)

4 participants