From 17caf3d045fa061ee1339d73502ff77f09d52937 Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Tue, 27 Oct 2026 01:45:30 -0700 Subject: [PATCH] test: remove 20 low-value cases and a presentation suite (#34333) Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> --- config/scripts/ci-shard-timings.json | 1 - .../editor/csv/CsvViewer.delimiter.test.tsx | 12 -- .../AiVaultScanProgressStrip.test.tsx | 10 - .../AiVaultSessionListBar.test.tsx | 97 ---------- .../ai-vault-first-prompt-card.test.tsx | 16 -- .../components/sidebar/SidebarHeader.test.tsx | 172 ------------------ 6 files changed, 308 deletions(-) delete mode 100644 src/renderer/src/components/right-sidebar/AiVaultSessionListBar.test.tsx diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index 08bf17b13f1..969f8831851 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -8352,7 +8352,6 @@ "src/renderer/src/components/right-sidebar/AiVaultSearchEvidence.test.tsx": 2230, "src/renderer/src/components/right-sidebar/AiVaultSessionActionMenuItems.test.tsx": 663, "src/renderer/src/components/right-sidebar/AiVaultSessionHistoryDialog.test.tsx": 1929, - "src/renderer/src/components/right-sidebar/AiVaultSessionListBar.test.tsx": 516, "src/renderer/src/components/right-sidebar/AiVaultSessionRow.structured-title.test.tsx": 2357, "src/renderer/src/components/right-sidebar/AiVaultSessionRow.test.tsx": 1504, "src/renderer/src/components/right-sidebar/AiVaultSessionSubagents.test.tsx": 1926, diff --git a/src/renderer/src/components/editor/csv/CsvViewer.delimiter.test.tsx b/src/renderer/src/components/editor/csv/CsvViewer.delimiter.test.tsx index 4abdfd2e9d6..68f35318bbb 100644 --- a/src/renderer/src/components/editor/csv/CsvViewer.delimiter.test.tsx +++ b/src/renderer/src/components/editor/csv/CsvViewer.delimiter.test.tsx @@ -94,16 +94,4 @@ describe('CSV delimiter selection', () => { expect(screen.getByRole('columnheader', { name: 'value' })).toBeTruthy() expect(screen.getByRole('cell', { name: '2' })).toBeTruthy() }) - - it('resets to Auto when the editor mounts a different file identity', async () => { - const { rerender } = render( - - ) - await chooseDelimiter('Comma (,)') - - rerender() - - expect(screen.getByRole('combobox', { name: 'Delimiter' }).textContent).toBe('Auto (Tab)') - expect(screen.getByRole('columnheader', { name: 'value' })).toBeTruthy() - }) }) diff --git a/src/renderer/src/components/right-sidebar/AiVaultScanProgressStrip.test.tsx b/src/renderer/src/components/right-sidebar/AiVaultScanProgressStrip.test.tsx index 25dad6ad598..d5e28de607f 100644 --- a/src/renderer/src/components/right-sidebar/AiVaultScanProgressStrip.test.tsx +++ b/src/renderer/src/components/right-sidebar/AiVaultScanProgressStrip.test.tsx @@ -31,16 +31,6 @@ const FINISHED: AiVaultScanProgress = { settledAt: 90_000 } -it('says the finished total in the strip and opens to one row per agent', async () => { - render() - expect(screen.getByText('102,452 files').parentElement?.textContent).toBe('Scanned 102,452 files') - expect(screen.queryByText('Codex')).toBeNull() - - await userEvent.setup().click(screen.getByRole('button')) - expect(screen.getByText('77,483 files')).toBeTruthy() - expect(screen.getByText('1 database')).toBeTruthy() -}) - it('keeps a narrower cached panel off the broader key while a late matching panel loads it', async () => { const lowerDepth = { scopePaths: ['/project'], includeAntigravityIdeSessions: true, limit: 100 } const broader = aiVaultLocalScanKey({ ...lowerDepth, limit: 1000 }) diff --git a/src/renderer/src/components/right-sidebar/AiVaultSessionListBar.test.tsx b/src/renderer/src/components/right-sidebar/AiVaultSessionListBar.test.tsx deleted file mode 100644 index 1fb2605722a..00000000000 --- a/src/renderer/src/components/right-sidebar/AiVaultSessionListBar.test.tsx +++ /dev/null @@ -1,97 +0,0 @@ -// @vitest-environment happy-dom -import { cleanup, render, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' -import { afterEach, expect, it, vi } from 'vitest' -import { aiVaultBrowseSortMenu, aiVaultSearchSortMenu } from './ai-vault-sort-options' -import { - aiVaultResultCountLabel, - AiVaultSessionListBar, - aiVaultSessionCountLabel -} from './AiVaultSessionListBar' - -afterEach(cleanup) - -it('reports how many hits are shown and which order produced them', () => { - const { rerender } = render( - - ) - expect(screen.getByText('1 result')).toBeTruthy() - expect(screen.getByRole('button', { name: 'Sort results: Most relevant' })).toBeTruthy() - - rerender( - - ) - expect(screen.getByText('20 results')).toBeTruthy() - expect(screen.getByRole('button', { name: 'Sort results: Newest' })).toBeTruthy() -}) - -it('reports how much of the browsed history is shown and its order', () => { - render( - - ) - expect(screen.getByText('4 of 12 sessions')).toBeTruthy() - expect(screen.getByRole('button', { name: 'Sort sessions: Created' })).toBeTruthy() -}) - -it('counts plainly when filters hide nothing', () => { - render( - - ) - expect(screen.getByText('12 sessions')).toBeTruthy() -}) - -it('hands the picked search order back to the caller', async () => { - const onChange = vi.fn() - const user = userEvent.setup({ pointerEventsCheck: 0 }) - render( - - ) - - await user.click(screen.getByRole('button', { name: 'Sort results: Most relevant' })) - await user.click(await screen.findByRole('menuitemradio', { name: 'Newest' })) - - expect(onChange).toHaveBeenCalledExactlyOnceWith('newest') -}) - -it('hands the picked browse order back to the caller', async () => { - const onChange = vi.fn() - const user = userEvent.setup({ pointerEventsCheck: 0 }) - render( - - ) - - await user.click(screen.getByRole('button', { name: 'Sort sessions: Last updated' })) - await user.click(await screen.findByRole('menuitemradio', { name: 'Created' })) - - expect(onChange).toHaveBeenCalledExactlyOnceWith('created') -}) diff --git a/src/renderer/src/components/right-sidebar/ai-vault-first-prompt-card.test.tsx b/src/renderer/src/components/right-sidebar/ai-vault-first-prompt-card.test.tsx index b84cc3a621e..f83843587d2 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault-first-prompt-card.test.tsx +++ b/src/renderer/src/components/right-sidebar/ai-vault-first-prompt-card.test.tsx @@ -28,22 +28,6 @@ afterEach(() => { }) describe('FirstPromptCard', () => { - it('labels stored firstUserPrompt text as the first prompt', () => { - const remoteSession = { - ...session, - executionHostId: 'ssh:dev-box', - firstUserPrompt: 'The authoritative opening ask' - } as AiVaultSession - stubApi(vi.fn().mockResolvedValue({ prompt: null })) - - render( - - ) - - expect(screen.getByText('First prompt')).toBeTruthy() - expect(screen.getByText('The authoritative opening ask')).toBeTruthy() - }) - it('labels a remote preview fallback as a recent prompt when no full read is available', () => { const getFirstUserPrompt = vi.fn().mockResolvedValue({ prompt: null }) const remoteSession = { diff --git a/src/renderer/src/components/sidebar/SidebarHeader.test.tsx b/src/renderer/src/components/sidebar/SidebarHeader.test.tsx index e92ebea5429..7d272a9bdf7 100644 --- a/src/renderer/src/components/sidebar/SidebarHeader.test.tsx +++ b/src/renderer/src/components/sidebar/SidebarHeader.test.tsx @@ -185,20 +185,6 @@ describe('SidebarHeader', () => { expect(mocks.openWorkspaceCreationComposerWithTourHandoff).toHaveBeenCalledTimes(1) }) - it('opens the composer the same way once projects exist', async () => { - mockState.repos = [{ id: 'repo-a' }] - act(() => { - root.render() - }) - - await act(async () => { - createButton().click() - }) - - expect(createButton().disabled).toBe(false) - expect(mocks.openWorkspaceCreationComposerWithTourHandoff).toHaveBeenCalledTimes(1) - }) - it('reaches Add project and New workspace in one click each, with no menu', async () => { act(() => { root.render() @@ -215,162 +201,4 @@ describe('SidebarHeader', () => { expect(mockState.openModal).toHaveBeenCalledWith('add-repo') expect(mocks.openWorkspaceCreationComposerWithTourHandoff).not.toHaveBeenCalled() }) - - it('keeps the create button rightmost so the frequent action stays where it was', () => { - act(() => { - root.render() - }) - - const labels = [...container.querySelectorAll('[aria-label]')] - .map((node) => node.getAttribute('aria-label')) - .filter((label): label is string => label === 'Add project' || label === 'New workspace') - expect(labels).toEqual(['Add project', 'New workspace']) - }) - - it('advertises the workspace shortcut on the create tooltip, and omits it when unassigned', () => { - act(() => { - root.render() - }) - expect(container.textContent).toContain('⌘N') - - mocks.shortcutLabel.current = null - act(() => { - root.render() - }) - expect(container.textContent).not.toContain('⌘N') - }) - - it('opens agent activity from the bell button', () => { - act(() => { - root.render() - }) - - const activityButton = container.querySelector( - '[aria-label="View activity"]' - ) - expect(activityButton).toBeTruthy() - - act(() => { - activityButton?.click() - }) - - expect(mockState.setSidebarBody).toHaveBeenCalledWith('agents') - }) - - it('shows the Agents introduction only for migrated users and never offers a hide action', () => { - mockState.settings = { agentsSidebarMigratedFromExperimental: true } - act(() => { - root.render() - }) - - expect(container.querySelector('[data-intro-open]')).toBeTruthy() - expect(container.textContent).toContain('Agents are easier to find') - expect(container.textContent).not.toContain('Hide Agents') - - mockState.settings = {} - act(() => { - root.render() - }) - expect(container.querySelector('[data-intro-open]')).toBeNull() - }) - - it('turns off agent activity from the active bell button', () => { - mockState.sidebarBody = 'agents' - act(() => { - root.render() - }) - - const activityButton = container.querySelector( - '[aria-label="Turn off activity view"]' - ) - expect(activityButton?.getAttribute('aria-pressed')).toBe('true') - - act(() => { - activityButton?.click() - }) - - expect(mockState.setSidebarBody).toHaveBeenCalledWith('workspaces') - }) - - it('uses the legacy title based on workspace grouping', () => { - act(() => { - root.render() - }) - - expect(container.querySelector('[data-sidebar-section-title="projects"]')?.textContent).toBe( - 'Projects' - ) - - mockState.groupBy = 'workspace-status' - act(() => { - root.render() - }) - expect(container.querySelector('[data-sidebar-section-title="workspaces"]')?.textContent).toBe( - 'Workspaces' - ) - }) - - it('swaps only the options slot in the agents view so no header button shifts', () => { - mockState.sidebarBody = 'agents' - act(() => { - root.render() - }) - - expect(container.querySelector('[aria-label="Turn off activity view"]')).toBeTruthy() - expect(container.querySelector('[aria-label="New workspace"]')).toBeTruthy() - expect(container.querySelector('[aria-label="Workspace options"]')).toBeNull() - expect(container.querySelector('[aria-label="Add project"]')).toBeTruthy() - }) - - it('keeps the activity bell and actions on one row at the default sidebar width', () => { - act(() => { - root.render() - }) - - const headerRow = container.querySelector('.mt-2') - const headerClasses = new Set(headerRow?.className.split(/\s+/) ?? []) - expect(headerClasses.has('flex-wrap')).toBe(false) - expect(headerClasses.has('h-8')).toBe(true) - expect(container.querySelector('[aria-label="View activity"]')).toBeTruthy() - expect(container.querySelector('[aria-label="Add project"]')).toBeTruthy() - expect(container.querySelector('[aria-label="New workspace"]')).toBeTruthy() - }) - - it('keeps the same actions on one row at compact width', async () => { - mockState.sidebarWidth = 220 - act(() => { - root.render() - }) - - expect(container.querySelector('[aria-label="Add project"]')).toBeTruthy() - expect(container.querySelector('[aria-label="View activity"]')).toBeTruthy() - expect(container.querySelector('[aria-label="New workspace"]')).toBeTruthy() - expect(container.querySelector('[aria-label="Workspace options"]')).toBeTruthy() - expect(container.querySelector('[aria-label="More workspace actions"]')).toBeNull() - - await act(async () => { - createButton().click() - }) - expect(mocks.openWorkspaceCreationComposerWithTourHandoff).toHaveBeenCalledTimes(1) - }) - - it('does not reset a persisted agents body before settings hydrate', () => { - mockState.settings = undefined - mockState.sidebarBody = 'agents' - act(() => { - root.render() - }) - - expect(mockState.setSidebarBody).not.toHaveBeenCalled() - }) - - it('does not expose the deprecated full Agents view in agents mode', () => { - mockState.settings = { agentsSidebarIntroShown: true } - mockState.sidebarBody = 'agents' - act(() => { - root.render() - }) - - expect(container.querySelector('[aria-label="Open full Agents view"]')).toBeNull() - }) })