mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 02:13:40 +08:00
3f6adca2d7
* DEV: convert change owner modal to glimmer component * DEV: add system test for change owner modal
29 lines
673 B
Ruby
29 lines
673 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Modals
|
|
class ChangeOwner < PageObjects::Pages::Base
|
|
USERS_DROPDOWN = ".select-kit"
|
|
|
|
def modal
|
|
find(".change-ownership-modal")
|
|
end
|
|
def select_new_owner(user)
|
|
within(modal) do
|
|
users_dropdown.expand
|
|
users_dropdown.search(user.username)
|
|
users_dropdown.select_row_by_value(user.username)
|
|
end
|
|
end
|
|
|
|
def confirm_new_owner
|
|
within(modal) { find(".modal-footer .btn").click }
|
|
end
|
|
|
|
def users_dropdown
|
|
@users_dropdown ||= PageObjects::Components::SelectKit.new(USERS_DROPDOWN)
|
|
end
|
|
end
|
|
end
|
|
end
|