Skip to content

Build your personal knowledge base with Trilium Notes

test(calendar): relation as custom title with attribute relation

Elian Dorana8b119e4df0e
diff --git a/src/public/app/widgets/view_widgets/calendar_view.spec.ts b/src/public/app/widgets/view_widgets/calendar_view.spec.ts
index 6640d2fb60..4e6446c3f2 100644
--- a/src/public/app/widgets/view_widgets/calendar_view.spec.ts
+++ b/src/public/app/widgets/view_widgets/calendar_view.spec.ts
@@ -111,4 +111,18 @@ describe("Building events", () => {
expect(events[1]).toMatchObject({ title: "Note 2", start: "2025-05-07" });
});
+ it("discards relation as custom title with custom relation", async () => {
+ const noteIds = buildNotes([
+ { id: "myParentNote", title: "My parent note" },
+ { id: "mySharedTitle", title: "My custom title", "~myTitle": "myParentNote", "#calendar:title": "~myTitle" },
+ { title: "Note 1", "~myTitle": "mySharedTitle", "#startDate": "2025-05-05", "#calendar:title": "~myTitle" },
+ { title: "Note 2", "#startDate": "2025-05-07", "#calendar:title": "~myTitle" },
+ ]);
+ const events = await CalendarView.buildEvents(noteIds);
+
+ expect(events).toHaveLength(2);
+ expect(events[0]).toMatchObject({ title: "My shared custom title", start: "2025-05-05" });
+ expect(events[1]).toMatchObject({ title: "Note 2", start: "2025-05-07" });
+ });
+
});