mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
FIX: ensures loading more doesn’t erase filter on browse (#19675)
This commit is contained in:
@ -149,6 +149,18 @@ RSpec.describe "Browse page", type: :system, js: true do
|
||||
expect(browse_view).to have_no_content(category_channel_4.name)
|
||||
end
|
||||
|
||||
context "when loading more" do
|
||||
fab!(:valid_channel) { Fabricate(:chat_channel, status: :open) }
|
||||
fab!(:invalid_channel) { Fabricate(:chat_channel, status: :closed) }
|
||||
|
||||
it "keeps the filter" do
|
||||
visit("/chat/browse/open")
|
||||
|
||||
expect(page).to have_content(valid_channel.title)
|
||||
expect(page).to have_no_content(invalid_channel.title)
|
||||
end
|
||||
end
|
||||
|
||||
include_examples "never visible channels" do
|
||||
before { visit("/chat/browse/open") }
|
||||
end
|
||||
@ -164,6 +176,18 @@ RSpec.describe "Browse page", type: :system, js: true do
|
||||
expect(browse_view).to have_no_content(category_channel_4.name)
|
||||
end
|
||||
|
||||
context "when loading more" do
|
||||
fab!(:valid_channel) { Fabricate(:chat_channel, status: :closed) }
|
||||
fab!(:invalid_channel) { Fabricate(:chat_channel, status: :open) }
|
||||
|
||||
it "keeps the filter" do
|
||||
visit("/chat/browse/closed")
|
||||
|
||||
expect(page).to have_content(valid_channel.title)
|
||||
expect(page).to have_no_content(invalid_channel.title)
|
||||
end
|
||||
end
|
||||
|
||||
include_examples "never visible channels" do
|
||||
before { visit("/chat/browse/closed") }
|
||||
end
|
||||
@ -181,6 +205,18 @@ RSpec.describe "Browse page", type: :system, js: true do
|
||||
expect(browse_view).to have_content(category_channel_4.name)
|
||||
end
|
||||
|
||||
context "when loading more" do
|
||||
fab!(:valid_channel) { Fabricate(:chat_channel, status: :archived) }
|
||||
fab!(:invalid_channel) { Fabricate(:chat_channel, status: :open) }
|
||||
|
||||
it "keeps the filter" do
|
||||
visit("/chat/browse/archived")
|
||||
|
||||
expect(page).to have_content(valid_channel.title)
|
||||
expect(page).to have_no_content(invalid_channel.title)
|
||||
end
|
||||
end
|
||||
|
||||
include_examples "never visible channels" do
|
||||
before { visit("/chat/browse/archived") }
|
||||
end
|
||||
|
Reference in New Issue
Block a user