mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
b5721b7b4f
When a category has default_list_filter=none, there were a number of issues which this commit resolves:
1. When using the breadcrumbs to navigate a `default_list_filter=none` category, adding a tag filter would not apply the no-subcategories filter, but the subcategories dropdown would still say 'none'. This commit adjusts `getCategoryAndTagUrl` so that `/none` is added to the URL
2. When landing on `/tags/c/{slug}/{id}/{tag}`, for a default_list_filter=none category, it would include subcategories. This commit introduces a client-side redirect to match the behavior of `/c/{slug}/{id}`
3. When directly navigating to `/c/{slug}/{id}`, it was correctly redirecting to `/c/{slug}/{id}/none`, BUT it was still using the preloaded data for the old route. This has been happening since e7a84948
. Prior to that, the preloaded data was discarded and a new JSON request was made to the server. This commit restores that discarding behavior. In future we may want to look into making this more efficient.
System specs are introduced to provide end-end testing of this functionality
27 lines
658 B
Ruby
27 lines
658 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class Discovery < PageObjects::Pages::Base
|
|
def topic_list
|
|
Components::TopicList.new
|
|
end
|
|
|
|
def category_drop
|
|
element = page.find(".category-breadcrumb li:first-of-type .category-drop")
|
|
Components::SelectKit.new(element)
|
|
end
|
|
|
|
def subcategory_drop
|
|
element = page.find(".category-breadcrumb li:nth-of-type(2) .category-drop")
|
|
Components::SelectKit.new(element)
|
|
end
|
|
|
|
def tag_drop
|
|
element = page.find(".category-breadcrumb .tag-drop")
|
|
Components::SelectKit.new(element)
|
|
end
|
|
end
|
|
end
|
|
end
|