From ed8d576eea88871ca57dd2bf18d22eaedf06fed8 Mon Sep 17 00:00:00 2001 From: 01zulfi <85733202+01zulfi@users.noreply.github.com> Date: Tue, 17 Jun 2025 09:45:23 +0500 Subject: [PATCH] core: fix notebooks parentId() tests (#8213) Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com> --- packages/core/__tests__/notebooks.test.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/__tests__/notebooks.test.js b/packages/core/__tests__/notebooks.test.js index 3b9793864..fba60d650 100644 --- a/packages/core/__tests__/notebooks.test.js +++ b/packages/core/__tests__/notebooks.test.js @@ -55,10 +55,14 @@ test("updating notebook with empty title should throw", () => test("parentId() returns parentId if notebook is a subnotebook", () => notebookTest().then(async ({ db, id }) => { const subId = await db.notebooks.add({ title: "Sub", id }); - expect(db.notebooks.parentId(subId)).toBe(id); + await db.relations.add( + { type: "notebook", id }, + { type: "notebook", id, subId } + ); + expect(await db.notebooks.parentId(subId)).toBe(id); })); test("parentId() returns undefined if notebook is not a subnotebook", () => notebookTest().then(async ({ db, id }) => { - expect(db.notebooks.parentId(id)).toBeUndefined(); + expect(await db.notebooks.parentId(id)).toBeUndefined(); }));