discourse/plugins/discourse-reactions/test/javascripts/acceptance
small-lovely-cat 48e7df1b35
FIX: discourse-reactions rollback not working (#36989)
The discourse-reactions plugin has a rollback function, when the
`toggle.json` request fails, the page should rollback the reactions to
the original state.

However, the function is broken, and the original `_rollbackState()`
function never works as the state itself changes when `toggleReaction`
is called. And the reaction state never goes back without
refreshing/reloading the window, leading to the heart/reactions leaving
on the page even when the request failed.

This commit fixs this by adding a new function `_captureState()`,
keeping the state in a const value, and revert it to the page data when
necessary.

Also, a spec for this is added to prevent regression.
2026-01-08 14:23:59 +10:00
..
deleted-post-test.js
discourse-reactions-custom-emoji-test.js DEV: Purge the widget rendering system (#36109) 2025-11-26 16:10:02 -03:00
discourse-reactions-disabled-test.js DEV: Purge the widget rendering system (#36109) 2025-11-26 16:10:02 -03:00
discourse-reactions-enabled-test.js DEV: Purge the widget rendering system (#36109) 2025-11-26 16:10:02 -03:00
discourse-reactions-icon-aliases-test.gjs DEV: map reactions plugin heart to d-icon aliases (#36467) 2025-12-05 09:37:45 -05:00
discourse-reactions-notifications-test.js
discourse-reactions-post-test.js DEV: Purge the widget rendering system (#36109) 2025-11-26 16:10:02 -03:00
discourse-reactions-received-test.js FIX: render emojis in topic titles on reactions pages 2025-12-15 13:06:17 +01:00
discourse-reactions-rollback-test.js FIX: discourse-reactions rollback not working (#36989) 2026-01-08 14:23:59 +10:00