A platform for community discussion. Free, open, simple.
FIX: Bulk (glimmer) topic selection on mobile (#28100)
Jarek Radosze627d24c3b51
diff --git a/app/assets/javascripts/discourse/app/components/topic-list/topic-list-item.gjs b/app/assets/javascripts/discourse/app/components/topic-list/topic-list-item.gjsindex d4cdbf8e8d6..d0a77f9d5be 100644--- a/app/assets/javascripts/discourse/app/components/topic-list/topic-list-item.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list/topic-list-item.gjs@@ -432,6 +432,8 @@ export default class TopicListItem extends Component {{{#if @bulkSelectEnabled}}<label for="bulk-select-{{@topic.id}}"><input+ {{on "click" this.onBulkSelectToggle}}+ checked={{this.isSelected}}type="checkbox"id="bulk-select-{{@topic.id}}"class="bulk-select"diff --git a/spec/system/topic_list/glimmer_spec.rb b/spec/system/topic_list/glimmer_spec.rbindex 2ee7b0a176f..c29881f8757 100644--- a/spec/system/topic_list/glimmer_spec.rb+++ b/spec/system/topic_list/glimmer_spec.rb@@ -2,13 +2,12 @@describe "glimmer topic list", type: :system dofab!(:user)- fab!(:group) { Fabricate(:group, users: [user]) }let(:topic_list) { PageObjects::Components::TopicList.new }let(:topic_page) { PageObjects::Pages::Topic.new }before do- SiteSetting.experimental_glimmer_topic_list_groups = group.name+ SiteSetting.experimental_glimmer_topic_list_groups = Group::AUTO_GROUPS[:everyone]sign_in(user)end@@ -23,7 +22,7 @@ describe "glimmer topic list", type: :system dodescribe "/new" doit "shows the list and the toggle buttons" do- SiteSetting.experimental_new_new_view_groups = group.name+ SiteSetting.experimental_new_new_view_groups = Group::AUTO_GROUPS[:everyone]Fabricate(:topic)Fabricate(:new_reply_topic, current_user: user)@@ -99,4 +98,34 @@ describe "glimmer topic list", type: :system dotopic_list.has_highlighted_topic?(topic)endend++ describe "bulk topic selection" do+ fab!(:user) { Fabricate(:moderator) }++ it "shows the buttons and checkboxes" do+ topics = Fabricate.times(2, :topic)+ visit("/latest")++ find("button.bulk-select").click+ expect(topic_list).to have_topic_checkbox(topics.first)+ expect(page).to have_no_css("button.bulk-select-topics-dropdown-trigger")++ topic_list.click_topic_checkbox(topics.first)+ expect(page).to have_css("button.bulk-select-topics-dropdown-trigger")+ end++ context "when on mobile", mobile: true do+ it "shows the buttons and checkboxes" do+ topics = Fabricate.times(2, :topic)+ visit("/latest")++ find("button.bulk-select").click+ expect(topic_list).to have_topic_checkbox(topics.first)+ expect(page).to have_no_css("button.bulk-select-topics-dropdown-trigger")++ topic_list.click_topic_checkbox(topics.first)+ expect(page).to have_css("button.bulk-select-topics-dropdown-trigger")+ end+ end+ endend