Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Fixup bulk assigment specs #582

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.