discourse/spec/system/page_objects/components/user_card.rb
Osama Sayegh 99abfb21f0
FIX: Mention with a status should open the user card (#33979)
Currently, clicking on a mention of user who has set a custom status
causes the user card to fail to load. This happens because when the
username is extracted from the mention `<a>` element, the space between
the username and the status emoji is captured with the username and is
sent to the server which fails to lookup the user due to the erroneously
appended space.

To fix this, we should cleanup the captured username and remove
surrounding spaces using `trim()`.
2025-07-31 02:32:24 +03:00

15 lines
297 B
Ruby

# frozen_string_literal: true
module PageObjects
module Components
class UserCard < PageObjects::Components::Base
def visible?
has_css?("#user-card")
end
def showing_user?(username)
has_css?("#user-card.user-card-#{username}")
end
end
end
end