mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Disable filter when loading tags in edit nav menu tags modal (#23789)
Why this change? When we're in the midst of loading more tags, the filter dropdown is still enabled and may result in us firing off multiple requests to the server to load more tags. This makes the loading hard to reason about in the tests environment and has led to flaky tests. What does this change do? This changes disables the filter dropdown when more tags are being loading.
This commit is contained in:
committed by
GitHub
parent
f2a90afa4c
commit
8c07bbe084
@@ -157,6 +157,9 @@ RSpec.describe "Editing sidebar tags navigation", type: :system do
|
||||
expect(sidebar).to have_tags_section
|
||||
|
||||
modal = sidebar.click_edit_tags_button
|
||||
|
||||
expect(modal).to have_tag_checkboxes([tag1, tag2, tag3, tag4])
|
||||
|
||||
modal.filter_by_selected
|
||||
|
||||
expect(modal).to have_tag_checkboxes([tag1, tag2])
|
||||
|
||||
@@ -38,6 +38,10 @@ module PageObjects
|
||||
has_css?(context + ":not(.is-expanded)", wait: 0)
|
||||
end
|
||||
|
||||
def is_not_disabled?
|
||||
has_css?(@context + ":not(.disabled)", wait: 0)
|
||||
end
|
||||
|
||||
def has_selected_value?(value)
|
||||
component.find(".select-kit-header[data-value='#{value}']")
|
||||
end
|
||||
|
||||
@@ -67,7 +67,9 @@ module PageObjects
|
||||
private
|
||||
|
||||
def dropdown_filter
|
||||
PageObjects::Components::SelectKit.new(".sidebar__edit-navigation-menu__filter-dropdown")
|
||||
PageObjects::Components::SelectKit.new(
|
||||
".sidebar__edit-navigation-menu__filter-dropdown",
|
||||
).tap(&:is_not_disabled?)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user