Skip to content

Commit

Permalink
fix spec to accept any space between emoji and counter
Browse files Browse the repository at this point in the history
  • Loading branch information
toy committed Feb 7, 2025
1 parent 4989d7c commit 213216d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
end

def expect_emoji_reaction(reaction:, count:, tooltip_text:, aria_label:)
expect(page).to have_test_selector("reaction-#{reaction}", text: "#{EmojiReaction.emoji(reaction)} #{count}",
expect(page).to have_test_selector("reaction-#{reaction}", text: /#{EmojiReaction.emoji(reaction)}\s+#{count}\b/,
aria: { label: aria_label })
expect(page).to have_test_selector("reaction-tooltip-#{reaction}", text: tooltip_text)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/support/components/work_packages/emoji_reactions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def expect_emoji_reactions_for_journal(journal, emojis_with_expected_options)
capybara_options = expected_emoji_options.except(:count)
end

expect(page).to have_selector(:link_or_button, text: "#{emoji} #{expected_emoji_count}", **capybara_options)
expect(page).to have_selector(:link_or_button, text: /#{emoji}\s+#{expected_emoji_count}\b/, **capybara_options)
end
end
end
Expand Down

0 comments on commit 213216d

Please sign in to comment.