0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/apps/comments-ui/test/e2e
Ronald Langeveld 04f0b9fc3f
Fixed comment likes being incorrect when logged in as an Admin (#21833)
ref https://linear.app/ghost/issue/PLG-296/

When logged in as an Admin, comments-ui switches comment reads from the Members API over to the Admin API so that hidden comments can be displayed to allow moderation activities. However, the Admin API not using member authentication and CORS preventing the front-end members auth cookie being passed over to the Admin API domain meant that the logged-in member's likes were missing when fetching via the Admin API as there is no available reference to the logged in member.

This change works around the problem by introducing an `impersonate_member_uuid` param to the comments read/browse endpoints of the Admin API. When passed, the provided uuid is used to simulate that member being logged in so that likes are correctly shown.

- Introduced `impersonation_member_id` parameter to resolve issues with admin API not returning correct "liked" status for comments when an admin is logged in.
- Updated API endpoints in `comment-replies.js` and `comments.js` to handle `impersonation_member_id`.
- Adjusted `CommentsController` to validate and process the `impersonation_member_id` parameter before passing it to database queries.
- Enhanced test coverage to ensure proper handling of the new parameter and accurate "liked" status behavior.
2024-12-10 14:44:15 +00:00
..
actions.test.ts Added highlight animation when scrolling to replied-to comment (#21781) 2024-12-05 17:46:16 +00:00
admin-moderation.test.ts Fixed comment likes being incorrect when logged in as an Admin (#21833) 2024-12-10 14:44:15 +00:00
autoclose-forms.test.ts Wired up Admin Comment Endpoints to UI (#21661) 2024-11-21 10:52:36 +00:00
content.test.ts Prevented top-level comment input from closing when it has text (#21795) 2024-12-09 13:42:24 +00:00
cta.test.ts
editor.test.ts Prevented top-level comment input from closing when it has text (#21795) 2024-12-09 13:42:24 +00:00
labs.test.ts Added feature flagging system for Comments UI (#20984) 2024-09-12 18:36:37 +09:00
lazy-loading.test.ts
main-form.test.ts Prevented top-level comment input from closing when it has text (#21795) 2024-12-09 13:42:24 +00:00
options.test.ts Ensured replies remain visible when parent comment is being edited (#21756) 2024-12-02 22:17:15 +00:00
pagination.test.ts