Skip to content

fix(autocomplete): derive the input test ids from testID - #1931

Open
bataevvlad wants to merge 1 commit into
masterfrom
fix/autocomplete-input-test-id
Open

bataevvlad wants to merge 1 commit into
masterfrom
fix/autocomplete-input-test-id

Conversation

@bataevvlad

Copy link
Copy Markdown
Collaborator

Problem

Autocomplete passes the consumer testID to its options Popover and gives its Input the fixed test id @autocomplete/input. Every autocomplete's field is therefore @@autocomplete/input/input, so two autocompletes on one screen cannot be told apart in tests (found while testing textInputRef in #1927: the showcase's input-native-ref-autocomplete field was exposed as @@autocomplete/input/input).

Fix

The input's test id is derived from testID: @<testID>/input, which Input turns into @@<testID>/input/input for the field and @@<testID>/input/container for its container. Without a testID it keeps @autocomplete/input. The showcase autocomplete uses testID='autocomplete', so its ids and the autocomplete.ad replay are unchanged. The Popover keeps the consumer testID. JSDoc and a docs row describe the ids.

Verification

  • Specs (autocomplete.spec.tsx): two autocompletes expose @@from/input/input and @@to/input/input; no testID keeps @@autocomplete/input/input. The first fails on master.
  • Android emulator (Pixel 7, API 34): AutocompleteBlur (testID='autocomplete-blur') exposes @@autocomplete-blur/input/input next to @@autocomplete/input/input; fill by the new id filters the list.
  • iOS simulator (iPhone 17): typing in both showcase autocompletes still works. The iOS accessibility tree is cut off before AutocompleteBlur on master (fixed by test(e2e): keep modals inside the snapshot budget #1918), so the id itself was checked on Android and in jest.
  • Gates: autocomplete specs (26 pass), lint (0 errors).

Changeset: @ui-kitten/components patch.

This branch has not been deployed

No deployments
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.

1 participant