Skip to content

Commit

Permalink
DEV: Fixup bulk assigment specs (#582)
Browse files Browse the repository at this point in the history
Followup e577671
  • Loading branch information
martin-brennan authored Jul 23, 2024
1 parent e577671 commit cef8807
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 100 deletions.
3 changes: 1 addition & 2 deletions spec/system/bulk_assign_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
end

describe "from topic list" do
# TODO (martin) Unskip when core PR is merged to make new bulk select method the default
xit "can assign and unassign topics" do
it "can assign and unassign topics" do
## Assign
visit "/latest"
topic = topics.first
Expand Down
29 changes: 26 additions & 3 deletions spec/system/group_assigned_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

let(:topic_list) { PageObjects::Components::TopicList.new }
let(:topic_list_header) { PageObjects::Components::TopicListHeader.new }
let(:topic_bulk_modal) { PageObjects::Modals::TopicBulkActions.new }
let(:assign_modal) { PageObjects::Modals::Assign.new }

before do
group.add(admin)
Expand All @@ -17,14 +19,35 @@
sign_in(admin)
end

# TODO (martin) Unskip when core PR is merged to make new bulk select method the default
xit "allows to bulk select assigned topics" do
it "allows to bulk select assigned topics" do
visit "/g/#{group.name}/assigned/everyone"

topic_list_header.click_bulk_select_button
topic_list.click_topic_checkbox(topic)
find(".bulk-select-actions").click

# Click Assign Button
topic_list_header.click_bulk_select_topics_dropdown
expect(topic_list_header).to have_assign_topics_button
topic_list_header.click_assign_topics_button
expect(topic_list_header).to have_bulk_select_modal

# Assign User
assignee = admin.username
select_kit = PageObjects::Components::SelectKit.new("#assignee-chooser")

# This initial collapse is needed because for some reason the modal is
# opening with `is-expanded` property, but it isn't actually expanded.
select_kit.collapse

select_kit.expand_if_needed
select_kit.search(assignee)
select_kit.select_row_by_value(assignee)
select_kit.collapse

# Click Confirm
topic_list_header.click_bulk_topics_confirm

expect(topic_bulk_modal).to be_closed
expect(Assignment.find_by(topic: topic).assigned_to).to eq(admin)
end
end
95 changes: 0 additions & 95 deletions test/javascripts/acceptance/bulk-actions-test.js

This file was deleted.

0 comments on commit cef8807

Please sign in to comment.