From db793a3c6c33f38d2190bcf36e5249b5361e8dd6 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 12 Feb 2025 16:20:04 -0600 Subject: [PATCH] Refresh materialized view in search test --- src/utils/search.test.ts | 5 +++++ 1 file changed, 5 insertions(+) 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(),