mirror of
https://github.com/discourse/discourse.git
synced 2026-07-29 15:54:48 -05:00
DEV: convert change owner modal to glimmer component (#23668)
* DEV: convert change owner modal to glimmer component * DEV: add system test for change owner modal
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
describe "Change Owner Modal", type: :system do
|
||||
fab!(:post) { Fabricate(:post, raw: "This is some post to change owner for") }
|
||||
fab!(:other_user) { Fabricate(:user) }
|
||||
fab!(:admin) { Fabricate(:admin) }
|
||||
let(:user) { post.user }
|
||||
let(:topic) { post.topic }
|
||||
let(:topic_page) { PageObjects::Pages::Topic.new }
|
||||
let(:change_owner_modal) { PageObjects::Modals::ChangeOwner.new }
|
||||
|
||||
before { sign_in(admin) }
|
||||
|
||||
def visit_topic_and_open_change_owner_modal(post)
|
||||
topic_page.visit_topic(topic)
|
||||
topic_page.expand_post_actions(post)
|
||||
topic_page.expand_post_admin_actions(post)
|
||||
topic_page.click_post_admin_action_button(post, :change_owner)
|
||||
end
|
||||
|
||||
it "changes owner of a post" do
|
||||
visit_topic_and_open_change_owner_modal(post)
|
||||
change_owner_modal.select_new_owner(other_user)
|
||||
change_owner_modal.confirm_new_owner
|
||||
expect(page).not_to have_css ".change-ownership-modal"
|
||||
|
||||
displayed_username = topic_page.post_by_number(post).find(".first.username").text
|
||||
expect(displayed_username).to eq other_user.username
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user