Fix duplicate attachment row from attachments-box notify() (#4250)

This commit is contained in:
Abe Jellinek 2024-06-19 02:23:46 -04:00 committed by GitHub
parent fad3e25278
commit 310e741a01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 24 deletions

View file

@ -597,6 +597,9 @@ describe("Item pane", function () {
assert.equal(preview.previewType, "pdf");
// 2 rows
assert.equal(attachmentsBox.querySelectorAll("attachment-row").length, 2);
// Simulate an extra 'add' event on the attachment - still 2 rows
attachmentsBox.notify('add', 'item', [attachment2.id]);
assert.equal(attachmentsBox.querySelectorAll("attachment-row").length, 2);
// Created annotations should be update in preview and attachment row
let annotation = await createAnnotation('highlight', attachment2);