feat: add document content search

This commit is contained in:
2026-08-14 17:57:00 +02:00
parent 6f183daca8
commit a15b463589
4 changed files with 29 additions and 5 deletions
+9
View File
@@ -29,11 +29,20 @@ async function createEvent(page: Page, title: string, narrative: string, occurre
}
test('a cloned Glass Harbor level can be solved without modifying its template', async ({ page, request }) => {
test.setTimeout(90_000)
const levels = await (await request.get('/api/levels')).json() as { id: string }[]
const playable = levels.find(level => level.id.startsWith('glass-harbor-case-'))
if (!playable) throw new Error('Glass Harbor playable clone was not seeded')
await page.goto(`/?level=${playable.id}`)
await expect(page.getByRole('heading', { name: 'The Glass Harbor Diversion' })).toBeVisible()
await expect(page.locator('.documents-panel')).toHaveClass(/\bclosed\b/)
await page.locator('.open-files').click()
await page.getByRole('searchbox', { name: 'Search inside documents', exact: true }).fill('Elias')
await expect(page.locator('.doc-row')).toHaveCount(1)
await expect(page.locator('.doc-row')).toContainText('Carrier Dispatch Manifest · H&F 14')
await page.getByRole('button', { name: 'Clear document search', exact: true }).click()
await expect(page.locator('.doc-row')).toHaveCount(8)
await page.getByRole('button', { name: 'Close documents', exact: true }).click()
await expect(page.locator('.evidence-card.folder')).toHaveCount(3)
await expect(page.locator('.timeline .marker')).toHaveCount(8)
await expect(page.locator('.timeline-label button')).toHaveText('1987-10-01 — 1987-10-31')