From 3febddb2f4c8fcad081d3ffcaef0a578d4d7093a Mon Sep 17 00:00:00 2001 From: OrcaWin <293788423+OrcaWin@users.noreply.github.com> Date: Wed, 18 Nov 2026 10:40:09 -0800 Subject: [PATCH] test: drop shallow settings and metadata examples --- .../NativeChatConnectorAskerTag.test.tsx | 11 -- .../settings/bots/BotsSettingsPane.test.tsx | 44 ----- .../navigation/SettingsSidebar.test.tsx | 172 ------------------ .../details/WorktreeCardMeta.test.tsx | 84 --------- 4 files changed, 311 deletions(-) delete mode 100644 src/renderer/src/components/settings/bots/BotsSettingsPane.test.tsx delete mode 100644 src/renderer/src/components/settings/navigation/SettingsSidebar.test.tsx delete mode 100644 src/renderer/src/components/sidebar/workspace-card/details/WorktreeCardMeta.test.tsx diff --git a/src/renderer/src/components/native-chat/NativeChatConnectorAskerTag.test.tsx b/src/renderer/src/components/native-chat/NativeChatConnectorAskerTag.test.tsx index 38d41e8f335..4a52f190fae 100644 --- a/src/renderer/src/components/native-chat/NativeChatConnectorAskerTag.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatConnectorAskerTag.test.tsx @@ -33,15 +33,4 @@ describe('NativeChatConnectorAskerTag', () => { forceSystemBrowser: true }) }) - - it('shows the cached avatar, then initials when it can’t load', () => { - const { container } = render() - const image = container.querySelector('img') - if (!image) { - throw new Error('no avatar image') - } - fireEvent.error(image) - expect(container.querySelector('img')).toBeNull() - expect(screen.getByText('SL')).toBeInTheDocument() - }) }) diff --git a/src/renderer/src/components/settings/bots/BotsSettingsPane.test.tsx b/src/renderer/src/components/settings/bots/BotsSettingsPane.test.tsx deleted file mode 100644 index a34a17d1bcc..00000000000 --- a/src/renderer/src/components/settings/bots/BotsSettingsPane.test.tsx +++ /dev/null @@ -1,44 +0,0 @@ -// @vitest-environment happy-dom - -import { cleanup, fireEvent, render, screen } from '@testing-library/react' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' - -vi.mock('@/lib/bot-catalog', () => ({ useBots: () => [], useHostBots: () => [] })) -vi.mock('@/components/bots/slack/SlackWorkspacesSettings', () => ({ - slackWorkspaces: () => [], - SlackWorkspacesSettings: () =>
Slack workspaces
-})) -vi.mock('@/components/bots/composio/ComposioKeyControl', () => ({ - ComposioKeyControl: () =>
Composio key control
-})) - -import { BotsSettingsPane } from './BotsSettingsPane' - -afterEach(cleanup) - -function renderPane(botsEnabled?: boolean) { - const updateSettings = vi.fn() - const settings = { ...getDefaultSettings('/home/me'), botsEnabled } - render() - return updateSettings -} - -describe('BotsSettingsPane', () => { - it('has bots on when nothing was saved, and turns them off from its switch', () => { - const updateSettings = renderPane(undefined) - - expect(screen.getByText('Slack workspaces')).toBeTruthy() - expect(screen.getByText('Composio key control')).toBeTruthy() - fireEvent.click(screen.getByRole('switch', { name: 'Enable bots' })) - expect(updateSettings).toHaveBeenCalledWith({ botsEnabled: false }) - }) - - it('shows only the switch while bots are off, and turns them back on', () => { - const updateSettings = renderPane(false) - - expect(screen.queryByText('Slack workspaces')).toBeNull() - fireEvent.click(screen.getByRole('switch', { name: 'Enable bots' })) - expect(updateSettings).toHaveBeenCalledWith({ botsEnabled: true }) - }) -}) diff --git a/src/renderer/src/components/settings/navigation/SettingsSidebar.test.tsx b/src/renderer/src/components/settings/navigation/SettingsSidebar.test.tsx deleted file mode 100644 index d92bef96f1f..00000000000 --- a/src/renderer/src/components/settings/navigation/SettingsSidebar.test.tsx +++ /dev/null @@ -1,172 +0,0 @@ -// @vitest-environment happy-dom - -import { renderToStaticMarkup } from 'react-dom/server' -import { Bot, GitBranch, Mic, Network, Puzzle } from 'lucide-react' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' -import type * as ShortcutLabels from '@/lib/keyboard/useShortcutLabel' -import { SettingsSidebar } from './SettingsSidebar' -import { TooltipProvider } from '../../ui/tooltip' -import type { SettingsSetupGuideProgress } from '../setup-guide/settings-setup-guide-progress' -import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' - -const mocks = vi.hoisted(() => ({ - useSettingsSetupGuideProgress: vi.fn() -})) - -vi.mock('@/lib/keyboard/useShortcutLabel', async () => { - const actual = await vi.importActual('@/lib/keyboard/useShortcutLabel') - return { - ...actual, - useShortcutLabel: () => '⌘F', - useShortcutKeyComboDetails: () => [{ keys: ['⌘', 'F'], doubleTap: false }] - } -}) - -vi.mock('../setup-guide/settings-setup-guide-progress', () => ({ - useSettingsSetupGuideProgress: mocks.useSettingsSetupGuideProgress -})) - -function makeSetupGuideProgress( - overrides: Partial = {} -): SettingsSetupGuideProgress { - return { - ready: true, - doneCount: 5, - total: 8, - firstIncompleteStepId: 'agent-capabilities', - ...overrides - } -} - -function renderSidebar( - activeSectionId = 'orchestration', - settings: GlobalSettings = getDefaultSettings('/tmp') -): string { - return renderToStaticMarkup( - - - - ) -} - -describe('SettingsSidebar', () => { - beforeEach(() => { - mocks.useSettingsSetupGuideProgress.mockReset() - mocks.useSettingsSetupGuideProgress.mockReturnValue(makeSetupGuideProgress()) - }) - - afterEach(() => { - document.body.innerHTML = '' - }) - - it("shows each bot's avatar in its row, above Projects", () => { - const markup = renderToStaticMarkup( - - - - ) - - expect(markup).toContain('🦉') - // The generic icon renders as lucide-bot elsewhere in the nav. - expect(renderSidebar()).toContain('lucide-bot') - expect(markup).not.toContain('lucide-bot') - expect(markup.indexOf('Reviewer')).toBeLessThan(markup.indexOf('Projects')) - }) -}) diff --git a/src/renderer/src/components/sidebar/workspace-card/details/WorktreeCardMeta.test.tsx b/src/renderer/src/components/sidebar/workspace-card/details/WorktreeCardMeta.test.tsx deleted file mode 100644 index 28460980dd6..00000000000 --- a/src/renderer/src/components/sidebar/workspace-card/details/WorktreeCardMeta.test.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { renderToStaticMarkup } from 'react-dom/server' -import type { ReactNode } from 'react' -import { describe, expect, it, vi } from 'vitest' -import { WorktreeCardDetailsHover } from './WorktreeCardMeta' -import { WorktreeCardMetaBadges } from '../metadata/WorktreeCardMetaBadges' - -vi.mock('@/components/ui/hover-card', () => ({ - HoverCard: ({ children }: { children: ReactNode }) => <>{children}, - HoverCardContent: ({ children }: { children: ReactNode }) =>
{children}
, - HoverCardTrigger: ({ children }: { children: ReactNode }) => <>{children} -})) - -vi.mock('@/components/ui/tooltip', () => ({ - Tooltip: ({ children }: { children: ReactNode }) => <>{children}, - TooltipContent: ({ children }: { children: ReactNode }) => <>{children}, - TooltipTrigger: ({ children }: { children: ReactNode }) => <>{children} -})) - -vi.mock('@/components/ui/dropdown-menu', () => ({ - DropdownMenu: ({ children }: { children: ReactNode }) =>
{children}
, - DropdownMenuTrigger: ({ children }: { children: ReactNode; asChild?: boolean }) => ( - <>{children} - ), - DropdownMenuContent: ({ children }: { children: ReactNode }) =>
{children}
, - DropdownMenuItem: ({ children }: { children: ReactNode; onSelect?: () => void }) => ( -
{children}
- ) -})) - -describe('WorktreeCardDetailsHover', () => { - it('names the bot that made the workspace', () => { - const bot = { id: 'bot-1', hostId: 'local' as const, name: 'Ranger', avatar: null } - const badgeMarkup = renderToStaticMarkup( - - ) - const hoverMarkup = renderToStaticMarkup( - - worker - - ) - - expect(badgeMarkup).toContain('Made by Ranger') - expect(hoverMarkup).toContain('Made by Ranger') - }) - - it("shows a bot's workspace by its bot alone, not also as CLI-made", () => { - const cliProvenance = { kind: 'created-by-cli' as const, createdAt: 1 } - const botMade = renderToStaticMarkup( - - ) - const cliMade = renderToStaticMarkup( - - ) - - expect(botMade).toContain('Made by Ranger') - expect(botMade).not.toContain('Created by Orca CLI') - expect(cliMade).toContain('Created by Orca CLI') - }) -})