diff --git a/spec/components/work_packages/activities_tab/journals/item_component/reactions_spec.rb b/spec/components/work_packages/activities_tab/journals/item_component/reactions_spec.rb index 762e3fc0bb17..8411e985769b 100644 --- a/spec/components/work_packages/activities_tab/journals/item_component/reactions_spec.rb +++ b/spec/components/work_packages/activities_tab/journals/item_component/reactions_spec.rb @@ -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 diff --git a/spec/support/components/work_packages/emoji_reactions.rb b/spec/support/components/work_packages/emoji_reactions.rb index a69d6a892031..ad600da023a7 100644 --- a/spec/support/components/work_packages/emoji_reactions.rb +++ b/spec/support/components/work_packages/emoji_reactions.rb @@ -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