FIX: ensures loading more doesn’t erase filter on browse (#19675)

This commit is contained in:
Joffrey JAFFEUX
2023-01-02 14:40:13 +01:00
committed by GitHub
parent e82689c1bf
commit b97fff444e
2 changed files with 44 additions and 14 deletions

View File

@ -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