mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 17:06:31 -06:00
parent
b55f2a6270
commit
e627d24c3b
@ -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"
|
||||
|
@ -2,13 +2,12 @@
|
||||
|
||||
describe "glimmer topic list", type: :system do
|
||||
fab!(: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 do
|
||||
|
||||
describe "/new" do
|
||||
it "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 do
|
||||
topic_list.has_highlighted_topic?(topic)
|
||||
end
|
||||
end
|
||||
|
||||
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
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user