From 3d19e156b1a96a54504e8bf71d64f8a1099f0693 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Tue, 8 Sep 2026 00:55:23 -0400 Subject: [PATCH] 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. --- .../ai-vault-search-coverage-poll.test.ts | 6 ++++-- tests/e2e/agent-session-search.spec.ts | 20 ++++++++----------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/renderer/src/components/right-sidebar/ai-vault-search-coverage-poll.test.ts b/src/renderer/src/components/right-sidebar/ai-vault-search-coverage-poll.test.ts index 418ccdb80a7..07247729e43 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault-search-coverage-poll.test.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault-search-coverage-poll.test.ts @@ -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 diff --git a/tests/e2e/agent-session-search.spec.ts b/tests/e2e/agent-session-search.spec.ts index 30d96088e9c..ba84856d1b1 100644 --- a/tests/e2e/agent-session-search.spec.ts +++ b/tests/e2e/agent-session-search.spec.ts @@ -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 () =>