Skip to content

Commit

Permalink
[#55581] spec for user hover cards on member page
Browse files Browse the repository at this point in the history
  • Loading branch information
EinLama committed Nov 22, 2024
1 parent 5c524e3 commit f3869f7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/features/members/membership_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,22 @@
expect(members_page).not_to have_group group.name
end

it "shows more information when hovering over an avatar" do
members_page.in_user_row(peter) do |row|
# Hover over the avatar of peter to open the hover card
row.find(".op-principal--avatar").hover
end

members_page.in_user_hover_card do |card|
card.find(".op-user-hover-card-user-info", text: peter.name)
card.find(".op-user-hover-card-user-info", text: peter.mail)
card.find(".op-user-hover-card-group-list", text: "Member of #{peter.groups.first.name}")

button = card.find(".Button", text: "Open profile")
expect(button["href"]).to eq(user_url(peter))
end
end

context "as a member" do
current_user { peter }

Expand Down
4 changes: 4 additions & 0 deletions spec/support/pages/members.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def in_user_row(user, &)
page.within(".principal-#{user.id}", &)
end

def in_user_hover_card(&)
page.within("#op-hover-card-body .op-user-hover-card", &)
end

##
# Adds the given user to this project.
#
Expand Down

0 comments on commit f3869f7

Please sign in to comment.