mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
FIX: Invalid route path for staff info warnings link (#19461)
This regressed in 4da2e3fef4102e0d3d2f24a4b0c54d4431755391
This commit is contained in:

committed by
GitHub

parent
618fb5b34d
commit
5d2e2677c0
@ -3,6 +3,11 @@
|
||||
module PageObjects
|
||||
module Pages
|
||||
class User < PageObjects::Pages::Base
|
||||
def visit(user)
|
||||
page.visit("/u/#{user.username}")
|
||||
self
|
||||
end
|
||||
|
||||
def find(selector)
|
||||
page.find(".user-content-wrapper #{selector}")
|
||||
end
|
||||
@ -14,6 +19,16 @@ module PageObjects
|
||||
def active_user_secondary_navigation
|
||||
find(".user-secondary-navigation li a.active")
|
||||
end
|
||||
|
||||
def has_warning_messages_path?(user)
|
||||
page.has_current_path?("/u/#{user.username}/messages/warnings")
|
||||
end
|
||||
|
||||
def click_staff_info_warnings_link(warnings_count: 0)
|
||||
staff_counters = page.find(".staff-counters")
|
||||
staff_counters.click_link("#{warnings_count} #{I18n.t("js.user.staff_counters.warnings_received")}")
|
||||
self
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user