Commit 5e9ecb2f authored by Sanad Liaquat's avatar Sanad Liaquat Committed by Peter Hegman

Use new vue attributes in MembersFilter

Use searchInputAttributes and searchButtonAttributes in filtered
search bar
Update e2e code to use data-qa-selectors
parent 432bded5
...@@ -18,6 +18,8 @@ export default { ...@@ -18,6 +18,8 @@ export default {
name: 'MembersFilteredSearchBar', name: 'MembersFilteredSearchBar',
components: { FilteredSearchBar }, components: { FilteredSearchBar },
availableTokens: AVAILABLE_FILTERED_SEARCH_TOKENS, availableTokens: AVAILABLE_FILTERED_SEARCH_TOKENS,
searchButtonAttributes: { 'data-qa-selector': 'search_button' },
searchInputAttributes: { 'data-qa-selector': 'search_bar_input' },
inject: { inject: {
namespace: {}, namespace: {},
sourceId: {}, sourceId: {},
...@@ -127,8 +129,9 @@ export default { ...@@ -127,8 +129,9 @@ export default {
:recent-searches-storage-key="filteredSearchBar.recentSearchesStorageKey" :recent-searches-storage-key="filteredSearchBar.recentSearchesStorageKey"
:search-input-placeholder="filteredSearchBar.placeholder" :search-input-placeholder="filteredSearchBar.placeholder"
:initial-filter-value="initialFilterValue" :initial-filter-value="initialFilterValue"
:search-button-attributes="$options.searchButtonAttributes"
:search-input-attributes="$options.searchInputAttributes"
data-testid="members-filtered-search-bar" data-testid="members-filtered-search-bar"
data-qa-selector="members_filtered_search_bar_content"
@onFilter="handleFilter" @onFilter="handleFilter"
/> />
</template> </template>
...@@ -79,6 +79,16 @@ export default { ...@@ -79,6 +79,16 @@ export default {
required: false, required: false,
default: '', default: '',
}, },
searchButtonAttributes: {
type: Object,
required: false,
default: () => ({}),
},
searchInputAttributes: {
type: Object,
required: false,
default: () => ({}),
},
}, },
data() { data() {
let selectedSortOption = this.sortOptions[0]?.sortDirection?.descending; let selectedSortOption = this.sortOptions[0]?.sortDirection?.descending;
...@@ -320,6 +330,8 @@ export default { ...@@ -320,6 +330,8 @@ export default {
:available-tokens="tokens" :available-tokens="tokens"
:history-items="filteredRecentSearches" :history-items="filteredRecentSearches"
:suggestions-list-class="suggestionsListClass" :suggestions-list-class="suggestionsListClass"
:search-button-attributes="searchButtonAttributes"
:search-input-attributes="searchInputAttributes"
class="flex-grow-1" class="flex-grow-1"
@history-item-selected="handleHistoryItemSelected" @history-item-selected="handleHistoryItemSelected"
@clear="onClear" @clear="onClear"
......
...@@ -10,15 +10,14 @@ module QA ...@@ -10,15 +10,14 @@ module QA
super super
base.view 'app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue' do base.view 'app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue' do
element :members_filtered_search_bar_content element :search_bar_input
element :search_button
end end
end end
def search_member(username) def search_member(username)
# TODO: Update the two actions below to use direct qa selectors once this is implemented: fill_element :search_bar_input, username
# https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1688 click_element :search_button
find_element(:members_filtered_search_bar_content).find('input').set(username)
find('.gl-search-box-by-click-search-button').click
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment