test(ai-vault-search): follow the read-only status segment in the e2e spec

The segment no longer opens a popover with controls; it names the resting
phase and opens the settings pane. The spec now clicks through to the pane's
own Resume button. Also merges a duplicate import that failed the focused
code-quality plugins.
This commit is contained in:
Jinwoo-H
2026-09-08 00:55:23 -04:00
parent 0f93c6d06b
commit 3d19e156b1
2 changed files with 12 additions and 14 deletions
@@ -3,12 +3,14 @@
import { createElement, StrictMode, type ReactNode } from 'react'
import { act, cleanup, renderHook } from '@testing-library/react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { createSearchCoverageStore } from './ai-vault-search-coverage-store'
import {
AI_VAULT_SEARCH_COVERAGE_RETRY_MAX_MS,
createSearchCoverageStore
} from './ai-vault-search-coverage-store'
import type {
AiVaultSearchCoverage,
AiVaultSearchIndexingProgress
} from '../../../../shared/ai-vault-search-types'
import { AI_VAULT_SEARCH_COVERAGE_RETRY_MAX_MS } from './ai-vault-search-coverage-store'
import {
AI_VAULT_SEARCH_COVERAGE_POLL_MS,
useAiVaultSearchCoveragePoll
+8 -12
View File
@@ -62,7 +62,9 @@ test('consent, Unicode search, scope exclusion, and clear stay inside an isolate
await expect(indexing.getByText('Up to date', { exact: true })).toBeVisible()
await indexing.getByRole('button', { name: 'Pause', exact: true }).click()
await expect(indexing.getByText('Indexing paused', { exact: true })).toBeVisible()
await expect(orcaPage.getByRole('button', { name: 'Indexing paused', exact: true })).toBeVisible()
// The status-bar segment is read-only; it names the resting phase and opens the settings pane.
const segment = orcaPage.getByRole('button', { name: /^Indexing paused/ })
await expect(segment).toBeVisible()
appendFileSync(
path.join(transcripts, `${id}.jsonl`),
`${JSON.stringify({
@@ -80,18 +82,12 @@ test('consent, Unicode search, scope exclusion, and clear stay inside an isolate
}))
expect(pausedSearch).toEqual({ saved: 1, appended: 0 })
await orcaPage.screenshot({ path: testInfo.outputPath('session-search-indexing-paused.png') })
await orcaPage.getByRole('button', { name: 'Indexing paused', exact: true }).click()
const popover = orcaPage.locator('[data-slot="popover-content"]')
await expect(popover.getByText('Indexing paused', { exact: true })).toBeVisible()
await orcaPage.screenshot({
path: testInfo.outputPath('session-search-indexing-popover.png'),
animations: 'disabled'
})
await popover.getByRole('button', { name: 'Resume', exact: true }).click()
await segment.click()
await expect(orcaPage.getByPlaceholder('Search settings')).toHaveValue('Agent Session History')
await expect(indexing.getByText('Indexing paused', { exact: true })).toBeVisible()
await indexing.getByRole('button', { name: 'Resume', exact: true }).click()
await expect(indexing.getByText('Up to date', { exact: true })).toBeVisible()
await expect(orcaPage.getByRole('button', { name: 'Indexing paused', exact: true })).toHaveCount(
0
)
await expect(orcaPage.getByRole('button', { name: /^Indexing paused/ })).toHaveCount(0)
await expect
.poll(
async () =>