mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-05-18 05:05:36 +02:00
core: fix notebooks parentId() tests (#8213)
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -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();
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user