diff --git a/src/utils/search.test.ts b/src/utils/search.test.ts index 0b2e36ab..d3c92011 100644 --- a/src/utils/search.test.ts +++ b/src/utils/search.test.ts @@ -1,4 +1,5 @@ import { assertEquals } from '@std/assert'; +import { sql } from 'kysely'; import { createTestDB } from '@/test.ts'; import { getPubkeysBySearch } from '@/utils/search.ts'; @@ -14,6 +15,8 @@ Deno.test('fuzzy search works', async () => { following_count: 0, }).execute(); + await sql`REFRESH MATERIALIZED VIEW top_authors`.execute(db.kysely); + assertEquals( await getPubkeysBySearch(db.kysely, { q: 'pat rick', limit: 1, offset: 0, following: new Set() }), new Set(), @@ -43,6 +46,8 @@ Deno.test('fuzzy search works with offset', async () => { following_count: 0, }).execute(); + await sql`REFRESH MATERIALIZED VIEW top_authors`.execute(db.kysely); + assertEquals( await getPubkeysBySearch(db.kysely, { q: 'dosreis.com', limit: 1, offset: 1, following: new Set() }), new Set(),