discourse/plugins/discourse-reactions/spec/system
Régis Hanol 579c368cf5
FIX: Properly URL-encode reaction value when fetching reaction users (#40218)
The `findReactionUsers` model method built its query string via plain
template-literal concatenation, e.g. `?reaction_value=${value}`. For
reactions whose value contains URL-reserved characters — most notably
the default `+1` (thumbs-up) — this produced `?reaction_value=+1`, which
Rack decodes as `reaction_value=" 1"`. The controller then queried for
that mangled value, returned an empty `reaction_users` array, and the
hover tooltip on the small emoji in the post reactions counter rendered
its loading spinner indefinitely (the `{{#each ... else}}` branch fires
when the users collection stays undefined).

Switch to passing the value through ajax's `data:` option so jQuery
serializes it via `$.param` (which uses `encodeURIComponent`). This
matches what the sibling `fetchReactionsUsersList` (new menu) already
does and means the request reaches the backend as `%2B1`.

While here, update the `PostReactionsList` page object to use
`[id="..."]` instead of the bare `#id` CSS selector, so it tolerates
reaction values that contain characters disallowed in unescaped ID
selectors. This unlocks a regression spec that hovers over a `+1`
reaction and verifies the user list populates.

Ref - t/184216
2026-05-21 15:54:41 +02:00
..
page_objects FIX: Properly URL-encode reaction value when fetching reaction users (#40218) 2026-05-21 15:54:41 +02:00
core_features_spec.rb DEV: Update rubocop (#38721) 2026-03-20 00:39:52 +01:00
reaction_notifications_spec.rb DEV: Update rubocop (#38721) 2026-03-20 00:39:52 +01:00
reactions_activity_spec.rb DEV: Update rubocop (#38721) 2026-03-20 00:39:52 +01:00
reactions_post_list_spec.rb UX: open post reactions menu with initial filter (#39656) 2026-05-07 10:46:53 +04:00
reactions_post_spec.rb FIX: Properly URL-encode reaction value when fetching reaction users (#40218) 2026-05-21 15:54:41 +02:00