diff --git a/src/js/templates/smallPost.template.js b/src/js/templates/smallPost.template.js index 4ac868a3..34de0031 100644 --- a/src/js/templates/smallPost.template.js +++ b/src/js/templates/smallPost.template.js @@ -129,7 +129,9 @@ export function smallPostTemplate({ ? html`
` : ""} diff --git a/tests/unit/specs/templates/smallPost.template.test.js b/tests/unit/specs/templates/smallPost.template.test.js index 3ebd0d19..7d62ffbf 100644 --- a/tests/unit/specs/templates/smallPost.template.test.js +++ b/tests/unit/specs/templates/smallPost.template.test.js @@ -278,6 +278,32 @@ t.describe("smallPostTemplate - reply-to label", (it) => { ); }); + it("should render 'Replied to you' when replyToAuthor is the current user", () => { + const result = smallPostTemplate({ + post: post, + ...baseProps, + showReplyToLabel: true, + replyToAuthor: { + did: "did:plc:test", + displayName: "Reply Author Name", + handle: "replyauthor.bsky.social", + }, + }); + const container = document.createElement("div"); + render(result, container); + const label = container.querySelector(".reply-to-author"); + assert(label !== null); + const text = label.textContent.replace(/\s+/g, " ").trim(); + assert( + text.includes("Replied to you"), + `expected "Replied to you" in "${text}"`, + ); + assert( + !text.includes("Reply Author Name"), + `did not expect display name in "${text}"`, + ); + }); + it("should render 'Replied to user' when replyToAuthor is missing", () => { const result = smallPostTemplate({ post: post,