From a8b119e4df0e9db2921ec22216cb88544490eb42 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 28 Feb 2025 20:13:37 +0200 Subject: [PATCH] test(calendar): relation as custom title with attribute relation --- .../app/widgets/view_widgets/calendar_view.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 6640d2fb6..4e6446c3f 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" }); + }); + });