test: reenable lookup tests

This commit is contained in:
thecodrr
2020-11-21 10:24:21 +05:00
parent 584f928514
commit 94de6eca4a

View File

@@ -17,7 +17,7 @@ beforeEach(async () => {
//TODO
test("search notes", () =>
noteTest({
content: { delta: [{ insert: "5" }], text: "5" },
content: { type: "delta", data: [{ insert: "5" }] },
}).then(async ({ db }) => {
await db.notes.add(TEST_NOTE);
let filtered = await db.lookup.notes(db.notes.all, "5");
@@ -26,22 +26,22 @@ test("search notes", () =>
test("search notes with a locked note", () =>
noteTest({
content: { delta: [{ insert: "5" }], text: "5" },
content: { type: "delta", data: [{ insert: "5" }] },
}).then(async ({ db }) => {
const noteId = await db.notes.add(TEST_NOTE);
await db.vault.create("password");
await db.vault.add(noteId);
let filtered = await db.lookup.notes(db.notes.all, "I am a");
let filtered = await db.lookup.notes(db.notes.all, "5");
expect(filtered.length).toBe(1);
}));
test("search notes with an empty note", () =>
noteTest({
content: { delta: [{ insert: "5" }], text: "5" },
content: { type: "delta", data: [{ insert: "5" }] },
}).then(async ({ db }) => {
await db.notes.add({
title: "hello world",
content: { delta: [], text: "" },
content: { type: "delta", data: [{ insert: "\n" }] },
});
let filtered = await db.lookup.notes(db.notes.all, "hello world");
expect(filtered.length).toBe(1);