mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
Refresh materialized view in search test
This commit is contained in:
parent
1482ee148e
commit
db793a3c6c
1 changed files with 5 additions and 0 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue