Skip to content

Commit 941f304

Browse files
committed
test(web): a preview annotation chip label cut beside an emoji
The chip label of a preview annotation cuts a long comment at 47 UTF-16 code units. When an emoji straddles that cut, the label keeps half of it and shows a replacement character before the ellipsis, and this test fails here.
1 parent 9def583 commit 941f304

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎apps/web/src/lib/composerContextRecords.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ describe("composerContextRecords", () => {
218218
expect(image).toMatchObject({ attachmentId: "uploaded-image" });
219219
});
220220

221+
it("shortens a long annotation comment label without splitting an emoji", () => {
222+
const record = previewAnnotationContextRecord({
223+
...annotation,
224+
comment: `${"a".repeat(46)}😀 and make the button bigger`,
225+
});
226+
expect(record.label).toBe(`${"a".repeat(46)}…`);
227+
});
228+
221229
it("restores multiple edits on one target without parsing display strings", () => {
222230
const styleChanges = [
223231
...annotation.styleChanges,

0 commit comments

Comments
 (0)