mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-22 09:36:49 +08:00
In this PR `silenced` became a computed property - https://github.com/discourse/discourse/pull/33537 When we silence the user, one of the serialised attributes is `silenced`. When we tried to assign it with `setProperties`, Ember was throwing an error. This was fixed by explicitly defining the arguments. https://github.com/user-attachments/assets/e8126484-2980-4fd8-90a7-35594076e9d8
47 lines
1 KiB
Ruby
Vendored
47 lines
1 KiB
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class AdminUser < PageObjects::Pages::Base
|
|
def visit(user)
|
|
page.visit("/admin/users/#{user.id}/#{user.username}")
|
|
end
|
|
|
|
def has_suspend_button?
|
|
has_css?(".btn-danger.suspend-user")
|
|
end
|
|
|
|
def has_no_suspend_button?
|
|
has_no_css?(".btn-danger.suspend-user")
|
|
end
|
|
|
|
def has_silence_button?
|
|
has_css?(".btn-danger.silence-user")
|
|
end
|
|
|
|
def has_no_silence_button?
|
|
has_no_css?(".btn-danger.silence-user")
|
|
end
|
|
|
|
def click_suspend_button
|
|
find(".btn-danger.suspend-user").click
|
|
end
|
|
|
|
def click_unsuspend_button
|
|
find(".btn-danger.unsuspend-user").click
|
|
end
|
|
|
|
def click_silence_button
|
|
find(".btn-danger.silence-user").click
|
|
end
|
|
|
|
def click_unsilence_button
|
|
find(".btn-danger.unsilence-user").click
|
|
end
|
|
|
|
def similar_users_warning
|
|
find(".penalty-similar-users .alert-warning")["innerHTML"]
|
|
end
|
|
end
|
|
end
|
|
end
|