mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
DEV: convert PrivateMessageMap widget to glimmer components (#25837)
* DEV: add map system test for private message map * DEV: convert PrivateMessageMap to glimmer components
This commit is contained in:
57
spec/system/page_objects/components/private_message_map.rb
Normal file
57
spec/system/page_objects/components/private_message_map.rb
Normal file
@ -0,0 +1,57 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Components
|
||||
class PrivateMessageMap < PageObjects::Components::Base
|
||||
PRIVATE_MESSAGE_MAP_KLASS = ".private-message-map"
|
||||
def is_visible?
|
||||
has_css?(PRIVATE_MESSAGE_MAP_KLASS)
|
||||
end
|
||||
|
||||
def participants_details
|
||||
find("#{PRIVATE_MESSAGE_MAP_KLASS} .participants").all(".user")
|
||||
end
|
||||
|
||||
def participants_count
|
||||
participants_details.length
|
||||
end
|
||||
|
||||
def controls
|
||||
find("#{PRIVATE_MESSAGE_MAP_KLASS} .controls")
|
||||
end
|
||||
|
||||
def toggle_edit_participants_button
|
||||
controls.click_button(class: "add-remove-participant-btn")
|
||||
end
|
||||
|
||||
def has_add_participants_button?
|
||||
controls.has_button?(class: "add-participant-btn")
|
||||
end
|
||||
|
||||
def has_no_add_participants_button?
|
||||
controls.has_no_button?(class: "add-participant-btn")
|
||||
end
|
||||
def click_add_participants_button
|
||||
controls.click_button(class: "add-participant-btn")
|
||||
end
|
||||
|
||||
def click_remove_participant_button(user)
|
||||
find_link(user.username).sibling(".remove-invited").click
|
||||
end
|
||||
|
||||
def has_participant_details_for?(user)
|
||||
find("#{PRIVATE_MESSAGE_MAP_KLASS} .participants").has_link?(
|
||||
class: "user-link",
|
||||
href: "/u/#{user.username}",
|
||||
)
|
||||
end
|
||||
|
||||
def has_no_participant_details_for?(user)
|
||||
find("#{PRIVATE_MESSAGE_MAP_KLASS} .participants").has_no_link?(
|
||||
class: "user-link",
|
||||
href: "/u/#{user.username}",
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user