discourse/spec/system/page_objects/pages/admin_user.rb
Krzysztof Kotlarek f63fe5ab69
FIX: JS error when silencing and unsilencing the user (#33851)
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
2025-07-25 14:33:07 +08:00

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