fix(comments) : show notified threads in inbox and stop edit notifications

This commit is contained in:
2026-10-12 23:03:17 +07:00 Unverified
parent 1fe35546d3
commit 05350e7aab
8 changed files with 316 additions and 35 deletions
@@ -34,6 +34,17 @@ describe("Thai comment UI", () => {
expect(html).not.toContain("No matching comments");
});
it("renders the notification conversation once in the regular inbox table", () => {
const selected = { ...comment, id: "selected", text: "การสนทนาที่เลือก" };
const html = renderToStaticMarkup(<AdminCommentInbox initial={{ items: [comment, selected], nextCursor: null, viewer }}
targets={[]} initialTarget={comment.target} initialComment={selected.id} />);
expect(html).not.toContain("การสนทนาจากการแจ้งเตือน");
expect(html.match(/id="comment-selected"/g)).toHaveLength(1);
expect(html.indexOf('id="comment-selected"')).toBeLessThan(html.indexOf('id="comment-test"'));
expect(html.slice(html.indexOf("<tbody"), html.indexOf("</tbody>"))).toContain('id="comment-selected"');
expect(html).not.toContain("<article");
});
it("renders editing controls in Thai while preserving the draft", () => {
const html = renderToStaticMarkup(<CommentComposer target="guide:test" editing={comment} onSaved={() => {}} />);
expect(html).toContain("บันทึกการแก้ไข");