add notification test

This commit is contained in:
Salihu committed 2025-10-15 21:50:53 +01:00
1 parent a2cac8df2a
commit 092528f9cd
1 file changed
+31 -1
+31 -1
View File
@@ -49,7 +49,7 @@ describe("Notification", () => {
});
});
describe("should return mention reference", () => {
describe.only("should return mention reference", () => {
it("mentioned in document", async () => {
const document = await buildDocument();
const notification = await buildNotification({
@@ -81,6 +81,36 @@ describe("Notification", () => {
expect(references?.length).toBe(1);
expect(references![0]).toBe(expectedReference);
});
it("group mentioned in document", async () => {
const document = await buildDocument();
const notification = await buildNotification({
event: NotificationEventType.GroupMentionedInDocument,
documentId: document.id,
});
const references = await Notification.emailReferences(notification);
const expectedReference = Notification.emailMessageId(
`${document.id}-group-mentions`
);
expect(references?.length).toBe(1);
expect(references![0]).toBe(expectedReference);
});
it("group mentioned in comment", async () => {
const document = await buildDocument();
const notification = await buildNotification({
event: NotificationEventType.GroupMentionedInComment,
documentId: document.id,
});
const references = await Notification.emailReferences(notification);
const expectedReference = Notification.emailMessageId(
`${document.id}-group-mentions`
);
expect(references?.length).toBe(1);
expect(references![0]).toBe(expectedReference);
});
});
describe("should return comment reference", () => {