fix(autocomplete): derive the input test ids from testID - #1931
Open
bataevvlad wants to merge 1 commit into
Open
bataevvlad wants to merge 1 commit into
bataevvlad wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Autocompletepasses the consumertestIDto its optionsPopoverand gives itsInputthe 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 testingtextInputRefin #1927: the showcase'sinput-native-ref-autocompletefield was exposed as@@autocomplete/input/input).Fix
The input's test id is derived from
testID:@<testID>/input, whichInputturns into@@<testID>/input/inputfor the field and@@<testID>/input/containerfor its container. Without atestIDit keeps@autocomplete/input. The showcase autocomplete usestestID='autocomplete', so its ids and theautocomplete.adreplay are unchanged. ThePopoverkeeps the consumertestID. JSDoc and a docs row describe the ids.Verification
autocomplete.spec.tsx): two autocompletes expose@@from/input/inputand@@to/input/input; notestIDkeeps@@autocomplete/input/input. The first fails on master.AutocompleteBlur(testID='autocomplete-blur') exposes@@autocomplete-blur/input/inputnext to@@autocomplete/input/input;fillby the new id filters the list.AutocompleteBluron master (fixed by test(e2e): keep modals inside the snapshot budget #1918), so the id itself was checked on Android and in jest.Changeset:
@ui-kitten/componentspatch.