diff --git a/src/renderer/src/app-shell/remote-workspace-unplaced-upload-suppression.test.tsx b/src/renderer/src/app-shell/remote-workspace-unplaced-upload-suppression.test.tsx index c2af06208d4..3b65dbd380f 100644 --- a/src/renderer/src/app-shell/remote-workspace-unplaced-upload-suppression.test.tsx +++ b/src/renderer/src/app-shell/remote-workspace-unplaced-upload-suppression.test.tsx @@ -22,7 +22,7 @@ import type { DirectSshAuthority, SshProviderEpoch } from '../../../shared/ssh-t import type { DirectSshPreparationInput } from '../hooks/direct-ssh-reconnect-coordinator' import { createRemoteWorkspaceTargetSync } from '../hooks/remote-workspace-target-sync' import { isDirectSshRemoteWorkspaceApplyInProgress } from '../hooks/remote-workspace-snapshot-apply' -import { makeWorktree } from '../store/slices/store-test-helpers' +import { makeWorktree } from '../store/slices/worktrees-slice-test-fixtures' vi.mock('sonner', () => ({ toast: { info: vi.fn(), success: vi.fn(), error: vi.fn() } })) vi.mock('@/lib/agent-status', async (importOriginal) => { diff --git a/src/renderer/src/components/activity/activity-clear-completed-state-lifetime.test.ts b/src/renderer/src/components/activity/activity-clear-completed-state-lifetime.test.ts index 8bbfbe03ee2..834f6e6e51d 100644 --- a/src/renderer/src/components/activity/activity-clear-completed-state-lifetime.test.ts +++ b/src/renderer/src/components/activity/activity-clear-completed-state-lifetime.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { useAppStore } from '@/store' -import { makeOpenFile } from '@/store/slices/store-test-helpers' +import { makeOpenFile } from '../../store/slices/store-session-test-harness' import { makeRetainedDoneEntry, makeTab, makeWorktree } from './ActivityPrototypePage-test-fixtures' import type { AgentPaneThread } from './activity-thread-types' diff --git a/src/renderer/src/components/editor/restored-editor-workspace-runtime-owner.test.tsx b/src/renderer/src/components/editor/restored-editor-workspace-runtime-owner.test.tsx index b92e8eb2de6..a410a99492a 100644 --- a/src/renderer/src/components/editor/restored-editor-workspace-runtime-owner.test.tsx +++ b/src/renderer/src/components/editor/restored-editor-workspace-runtime-owner.test.tsx @@ -5,7 +5,7 @@ import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as RuntimeFileClient from '@/runtime/runtime-file-client' import { useAppStore } from '@/store' -import { makeWorktree } from '@/store/slices/store-test-helpers' +import { makeWorktree } from '../../store/slices/worktrees-slice-test-fixtures' import type { FileContent } from './editor-panel-content-types' import { useEditorPanelFileContentLoader, diff --git a/src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.test.tsx b/src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.test.tsx index 3907c88c020..28988ed23f9 100644 --- a/src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.test.tsx +++ b/src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.test.tsx @@ -3,7 +3,11 @@ import { renderHook } from '@testing-library/react' import { beforeEach, describe, expect, it, vi } from 'vitest' import { FLOATING_TERMINAL_WORKTREE_ID, getDefaultSettings } from '../../../../shared/constants' import { useAppStore } from '@/store' -import { makeOpenFile, makeTabGroup, makeUnifiedTab } from '@/store/slices/store-test-helpers' +import { + makeOpenFile, + makeTabGroup, + makeUnifiedTab +} from '../../store/slices/store-session-test-harness' import { useFloatingTerminalCloseActions } from './use-floating-terminal-close-actions' const requestEditorFileClose = vi.hoisted(() => vi.fn()) diff --git a/src/renderer/src/components/native-chat/StructuredAgentSessionAttentionBridge.test.tsx b/src/renderer/src/components/native-chat/StructuredAgentSessionAttentionBridge.test.tsx index 362512bf694..99a01c6d437 100644 --- a/src/renderer/src/components/native-chat/StructuredAgentSessionAttentionBridge.test.tsx +++ b/src/renderer/src/components/native-chat/StructuredAgentSessionAttentionBridge.test.tsx @@ -73,12 +73,8 @@ import { getStructuredAgentSessionStatusFeed, resetStructuredAgentSessionStatusFeedsForTests } from '@/runtime/structured-agent-session-status-feed' -import { - makeTabGroup, - makeUnifiedTab, - makeWorktree, - TEST_REPO -} from '@/store/slices/store-test-helpers' +import { makeTabGroup, makeUnifiedTab } from '../../store/slices/store-session-test-harness' +import { makeWorktree, TEST_REPO } from '../../store/slices/worktrees-slice-test-fixtures' // Worktree ids encode their repo (`repoId::path`); the unread reducer buckets by that prefix. const WORKSPACE = 'repo1::/tmp/wt' diff --git a/src/renderer/src/components/right-sidebar/use-checks-panel-terminal-worktree.test.ts b/src/renderer/src/components/right-sidebar/use-checks-panel-terminal-worktree.test.ts index d79f9a16fbe..a65697bed8f 100644 --- a/src/renderer/src/components/right-sidebar/use-checks-panel-terminal-worktree.test.ts +++ b/src/renderer/src/components/right-sidebar/use-checks-panel-terminal-worktree.test.ts @@ -7,7 +7,7 @@ import type { Repo } from '../../../../shared/repo-types' import type { Worktree } from '../../../../shared/worktree/types' import { useAppStore } from '@/store' import type { AppState } from '@/store/types' -import { makeWorktree, TEST_REPO } from '@/store/slices/store-test-helpers' +import { makeWorktree, TEST_REPO } from '../../store/slices/worktrees-slice-test-fixtures' import { useChecksPanelTerminalWorktree } from './use-checks-panel-terminal-worktree' const initialAppState = useAppStore.getInitialState() diff --git a/src/renderer/src/components/right-sidebar/useGitStatusPolling.rerender.test.ts b/src/renderer/src/components/right-sidebar/useGitStatusPolling.rerender.test.ts index 7d565090d69..561af39b624 100644 --- a/src/renderer/src/components/right-sidebar/useGitStatusPolling.rerender.test.ts +++ b/src/renderer/src/components/right-sidebar/useGitStatusPolling.rerender.test.ts @@ -7,7 +7,8 @@ import type { Repo } from '../../../../shared/repo-types' import type { Worktree } from '../../../../shared/worktree/types' import { useAppStore } from '@/store' import type { AppState } from '@/store/types' -import { makeOpenFile, makeWorktree, TEST_REPO } from '@/store/slices/store-test-helpers' +import { makeOpenFile } from '../../store/slices/store-session-test-harness' +import { makeWorktree, TEST_REPO } from '../../store/slices/worktrees-slice-test-fixtures' import { ORCA_WORKTREE_FILE_CHANGE_EVENT } from '@/hooks/worktree-file-change-event' import { useGitStatusPolling } from './useGitStatusPolling' diff --git a/src/renderer/src/components/sidebar/WorkspaceKanbanCard.host-identity.test.tsx b/src/renderer/src/components/sidebar/WorkspaceKanbanCard.host-identity.test.tsx index 44daf3f00e6..4c94c30fc36 100644 --- a/src/renderer/src/components/sidebar/WorkspaceKanbanCard.host-identity.test.tsx +++ b/src/renderer/src/components/sidebar/WorkspaceKanbanCard.host-identity.test.tsx @@ -3,7 +3,7 @@ import { cleanup, fireEvent, render } from '@testing-library/react' import React from 'react' import { afterEach, describe, expect, it, vi } from 'vitest' -import { makeWorktree } from '../../store/slices/store-test-helpers' +import { makeWorktree } from '../../store/slices/worktrees-slice-test-fixtures' import WorkspaceKanbanCard from './WorkspaceKanbanCard' vi.mock('@/components/ui/badge', () => ({ diff --git a/src/renderer/src/components/sidebar/stale-agent-row-unverifiable.test.ts b/src/renderer/src/components/sidebar/stale-agent-row-unverifiable.test.ts index 052adc752b9..a2fb42aaced 100644 --- a/src/renderer/src/components/sidebar/stale-agent-row-unverifiable.test.ts +++ b/src/renderer/src/components/sidebar/stale-agent-row-unverifiable.test.ts @@ -17,7 +17,7 @@ import { AGENT_STATUS_STALE_AFTER_MS, type AgentStatusEntry } from '../../../../shared/agent-status-types' -import { makeTab } from '../../store/slices/store-test-helpers' +import { makeTab } from '../../store/slices/store-session-test-harness' import { buildWorktreeAgentRows } from './worktree-agent-rows' import { getAgentDotState } from './worktree-card-agent-summary' import { getCompactAgentSecondary } from './worktree-card-compact-agent-row' diff --git a/src/renderer/src/components/sidebar/worktree-card-compact-agent-row-stopping.test.ts b/src/renderer/src/components/sidebar/worktree-card-compact-agent-row-stopping.test.ts index ea6227d4228..d92d8445af7 100644 --- a/src/renderer/src/components/sidebar/worktree-card-compact-agent-row-stopping.test.ts +++ b/src/renderer/src/components/sidebar/worktree-card-compact-agent-row-stopping.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import type { AgentStatusEntry } from '../../../../shared/agent-status-types' -import { makeTab } from '../../store/slices/store-test-helpers' +import { makeTab } from '../../store/slices/store-session-test-harness' import { buildWorktreeAgentRows } from './worktree-agent-rows' import { getAgentDotState } from './worktree-card-agent-summary' import { getCompactAgentLineOrder } from './worktree-card-compact-agent-line-order' diff --git a/src/renderer/src/components/sidebar/worktree-delete-host-qualification.test.ts b/src/renderer/src/components/sidebar/worktree-delete-host-qualification.test.ts index 99ec8687407..00cfddee685 100644 --- a/src/renderer/src/components/sidebar/worktree-delete-host-qualification.test.ts +++ b/src/renderer/src/components/sidebar/worktree-delete-host-qualification.test.ts @@ -23,7 +23,7 @@ import type { AppState } from '@/store/types' import type { Worktree } from '../../../../shared/worktree/types' import type { ExecutionHostId } from '../../../../shared/execution-host' import { makeWorktree } from '@/store/slices/worktrees-slice-test-fixtures' -import { makeTab } from '@/store/slices/store-test-helpers' +import { makeTab } from '../../store/slices/store-session-test-harness' import { createTestStore, mockApi, diff --git a/src/renderer/src/components/tab-group/workspace-tab-close-commands.floating-reclaim.test.ts b/src/renderer/src/components/tab-group/workspace-tab-close-commands.floating-reclaim.test.ts index b0aa5da13f2..00743829fb8 100644 --- a/src/renderer/src/components/tab-group/workspace-tab-close-commands.floating-reclaim.test.ts +++ b/src/renderer/src/components/tab-group/workspace-tab-close-commands.floating-reclaim.test.ts @@ -33,7 +33,7 @@ vi.mock('@/store/pinned-tab-close-guard', () => ({ import { dispatchWorkspaceTabCommand } from '@/lib/workspace-tab-commands' import { useAppStore } from '../../store' -import { makeOpenFile } from '../../store/slices/store-test-helpers' +import { makeOpenFile } from '../../store/slices/store-session-test-harness' const terminalTab: Tab = { id: 'unified-terminal', diff --git a/src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts b/src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts index a4607978b83..9956d34df4a 100644 --- a/src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts +++ b/src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { dispatchTerminalNotification } from './use-notification-dispatch' import { AGENT_STATUS_STALE_AFTER_MS } from '../../../../shared/agent-status-types' import { buildAgentNotificationId } from '../../../../shared/agent-notification-id' -import { makeTabGroup, makeUnifiedTab } from '@/store/slices/store-test-helpers' +import { makeTabGroup, makeUnifiedTab } from '../../store/slices/store-session-test-harness' import { LIVE_LEAF_ID, PANE_KEY, diff --git a/src/renderer/src/components/terminal/terminal-provider-snapshot-bound-pty-ids.test.ts b/src/renderer/src/components/terminal/terminal-provider-snapshot-bound-pty-ids.test.ts index eba9359990a..ad6f7de8714 100644 --- a/src/renderer/src/components/terminal/terminal-provider-snapshot-bound-pty-ids.test.ts +++ b/src/renderer/src/components/terminal/terminal-provider-snapshot-bound-pty-ids.test.ts @@ -2,7 +2,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as SnapshotCapabilityModule from './terminal-provider-snapshot-capability' import type { TerminalLayoutSnapshot } from '../../../../shared/terminal-tab-types' -import { makeTab, makeWorktree } from '@/store/slices/store-test-helpers' +import { makeTab } from '../../store/slices/store-session-test-harness' +import { makeWorktree } from '../../store/slices/worktrees-slice-test-fixtures' const { collectPtyIds } = vi.hoisted(() => ({ collectPtyIds: vi.fn() })) diff --git a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-scanned-host-confirmation-removal.test.tsx b/src/renderer/src/components/workspace-cleanup/workspace-cleanup-scanned-host-confirmation-removal.test.tsx index eb69b692334..7b2934b8e82 100644 --- a/src/renderer/src/components/workspace-cleanup/workspace-cleanup-scanned-host-confirmation-removal.test.tsx +++ b/src/renderer/src/components/workspace-cleanup/workspace-cleanup-scanned-host-confirmation-removal.test.tsx @@ -43,7 +43,7 @@ vi.mock('../../../../main/providers/ssh-git-dispatch', () => ({ vi.mock('sonner', () => ({ toast: { error: vi.fn(), success: vi.fn(), warning: vi.fn() } })) import { useAppStore } from '@/store' -import { makeWorktree } from '@/store/slices/store-test-helpers' +import { makeWorktree } from '../../store/slices/worktrees-slice-test-fixtures' import { resetAuthoritativelyRemovedWorktreeMemoryForTests } from '@/store/slices/worktrees' import { useWorkspaceCleanupRemoval } from './use-workspace-cleanup-removal' diff --git a/src/renderer/src/hooks/useAutoAckViewedAgent.away.test.ts b/src/renderer/src/hooks/useAutoAckViewedAgent.away.test.ts index 0f5cadb1e90..7370ef6b57f 100644 --- a/src/renderer/src/hooks/useAutoAckViewedAgent.away.test.ts +++ b/src/renderer/src/hooks/useAutoAckViewedAgent.away.test.ts @@ -3,7 +3,7 @@ import { act, cleanup, renderHook, waitFor } from '@testing-library/react' import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { useAutoAckViewedAgent } from './useAutoAckViewedAgent' import { useAppStore } from '../store' -import { makeTab, makeTabGroup, makeUnifiedTab } from '../store/slices/store-test-helpers' +import { makeTab, makeTabGroup, makeUnifiedTab } from '../store/slices/store-session-test-harness' import { makePaneKey } from '../../../shared/stable-pane-id' import { createNotificationsApi } from '../web/preload-api/web-notifications-api' diff --git a/src/renderer/src/hooks/useAutoAckViewedAgent.clock-skew.test.ts b/src/renderer/src/hooks/useAutoAckViewedAgent.clock-skew.test.ts index c90e8119f05..1640edd0b27 100644 --- a/src/renderer/src/hooks/useAutoAckViewedAgent.clock-skew.test.ts +++ b/src/renderer/src/hooks/useAutoAckViewedAgent.clock-skew.test.ts @@ -5,7 +5,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as AgentAutoAckPresence from './agent-auto-ack-presence' import { useAutoAckViewedAgent } from './useAutoAckViewedAgent' import { useAppStore } from '../store' -import { makeTab, makeTabGroup, makeUnifiedTab } from '../store/slices/store-test-helpers' +import { makeTab, makeTabGroup, makeUnifiedTab } from '../store/slices/store-session-test-harness' import { makePaneKey } from '../../../shared/stable-pane-id' import type { AgentStatusEntry } from '../../../shared/agent-status-types' diff --git a/src/renderer/src/hooks/useAutoAckViewedAgent.floating-panel.test.ts b/src/renderer/src/hooks/useAutoAckViewedAgent.floating-panel.test.ts index 47a56b338a2..4622f63ef82 100644 --- a/src/renderer/src/hooks/useAutoAckViewedAgent.floating-panel.test.ts +++ b/src/renderer/src/hooks/useAutoAckViewedAgent.floating-panel.test.ts @@ -6,7 +6,7 @@ import type * as AgentAutoAckPresence from './agent-auto-ack-presence' import { useAutoAckViewedAgent } from './useAutoAckViewedAgent' import { useAppStore } from '../store' import { selectFloatingWorkspaceHasUnread } from '../store/selectors' -import { makeTab, makeTabGroup, makeUnifiedTab } from '../store/slices/store-test-helpers' +import { makeTab, makeTabGroup, makeUnifiedTab } from '../store/slices/store-session-test-harness' import { FLOATING_TERMINAL_WORKTREE_ID, getDefaultSettings } from '../../../shared/constants' import { makePaneKey } from '../../../shared/stable-pane-id' diff --git a/src/renderer/src/hooks/useAutoAckViewedAgent.focus-group.test.ts b/src/renderer/src/hooks/useAutoAckViewedAgent.focus-group.test.ts index a2a71dd440c..402b1e0f9da 100644 --- a/src/renderer/src/hooks/useAutoAckViewedAgent.focus-group.test.ts +++ b/src/renderer/src/hooks/useAutoAckViewedAgent.focus-group.test.ts @@ -5,7 +5,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as AgentAutoAckPresence from './agent-auto-ack-presence' import { useAutoAckViewedAgent } from './useAutoAckViewedAgent' import { useAppStore } from '../store' -import { makeTab, makeTabGroup, makeUnifiedTab } from '../store/slices/store-test-helpers' +import { makeTab, makeTabGroup, makeUnifiedTab } from '../store/slices/store-session-test-harness' import { structuredAgentSessionPaneKey } from '../../../shared/structured-agent-session-projection' vi.mock('./agent-auto-ack-presence', async (importOriginal) => ({ diff --git a/src/renderer/src/hooks/useUnreadDockBadge.test.ts b/src/renderer/src/hooks/useUnreadDockBadge.test.ts index 5dd6cb5aa8a..6a6cb15cabb 100644 --- a/src/renderer/src/hooks/useUnreadDockBadge.test.ts +++ b/src/renderer/src/hooks/useUnreadDockBadge.test.ts @@ -3,8 +3,8 @@ import { act, cleanup, renderHook } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as UnreadBadgeCountModule from '@/lib/unread-badge-count' -import { makeFolderWorkspace } from '@/store/slices/worktrees-slice-test-fixtures' -import { makeTab, makeWorktree } from '@/store/slices/store-test-helpers' +import { makeFolderWorkspace, makeWorktree } from '@/store/slices/worktrees-slice-test-fixtures' +import { makeTab } from '../store/slices/store-session-test-harness' import { FLOATING_TERMINAL_WORKTREE_ID, getDefaultSettings } from '../../../shared/constants' const { getUnreadBadgeCount } = vi.hoisted(() => ({ getUnreadBadgeCount: vi.fn() })) diff --git a/src/renderer/src/lib/host-mirror-handle-gap-snapshot-lifetime.test.ts b/src/renderer/src/lib/host-mirror-handle-gap-snapshot-lifetime.test.ts index a07d7912197..bad549e81af 100644 --- a/src/renderer/src/lib/host-mirror-handle-gap-snapshot-lifetime.test.ts +++ b/src/renderer/src/lib/host-mirror-handle-gap-snapshot-lifetime.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { useAppStore, type AppState } from '@/store' -import { makeTab } from '@/store/slices/store-test-helpers' +import { makeTab } from '../store/slices/store-session-test-harness' import { clearRuntimeEnvironmentConnectionGenerationsForTests, setRuntimeEnvironmentConnectionGenerationForTests diff --git a/src/renderer/src/lib/resume-sleeping-agent-session-direct-ssh-hydration-gap.test.ts b/src/renderer/src/lib/resume-sleeping-agent-session-direct-ssh-hydration-gap.test.ts index 0b9404d1da4..7919124e93c 100644 --- a/src/renderer/src/lib/resume-sleeping-agent-session-direct-ssh-hydration-gap.test.ts +++ b/src/renderer/src/lib/resume-sleeping-agent-session-direct-ssh-hydration-gap.test.ts @@ -13,7 +13,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import type { SleepingAgentSessionRecord } from '../../../shared/agent-session-resume' import { useAppStore } from '@/store' -import { makeWorktree } from '@/store/slices/store-test-helpers' +import { makeWorktree } from '../store/slices/worktrees-slice-test-fixtures' import { resumeSleepingAgentSessionsForWorktree } from './resume-sleeping-agent-session' const initialAppStoreState = useAppStore.getState() diff --git a/src/renderer/src/lib/resume-sleeping-agent-session-execution-host-scope.test.ts b/src/renderer/src/lib/resume-sleeping-agent-session-execution-host-scope.test.ts index 54b5459a8cf..c25dab22964 100644 --- a/src/renderer/src/lib/resume-sleeping-agent-session-execution-host-scope.test.ts +++ b/src/renderer/src/lib/resume-sleeping-agent-session-execution-host-scope.test.ts @@ -17,7 +17,7 @@ import { afterEach, describe, expect, it } from 'vitest' import type { SleepingAgentSessionRecord } from '../../../shared/agent-session-resume' import type { ExecutionHostId } from '../../../shared/execution-host' import { useAppStore } from '@/store' -import { makeWorktree, TEST_REPO } from '@/store/slices/store-test-helpers' +import { makeWorktree, TEST_REPO } from '../store/slices/worktrees-slice-test-fixtures' import { resumeSleepingAgentSessionsForWorktree } from './resume-sleeping-agent-session' import { agentResumeOriginNamesAnotherExecutionHost, diff --git a/src/renderer/src/lib/ssh-failed-target-sleeping-agent-resume.test.ts b/src/renderer/src/lib/ssh-failed-target-sleeping-agent-resume.test.ts index 1232681d980..e35e46fc908 100644 --- a/src/renderer/src/lib/ssh-failed-target-sleeping-agent-resume.test.ts +++ b/src/renderer/src/lib/ssh-failed-target-sleeping-agent-resume.test.ts @@ -11,7 +11,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import type { SleepingAgentSessionRecord } from '../../../shared/agent-session-resume' import type { TerminalTab } from '../../../shared/terminal-tab-types' import { useAppStore } from '@/store' -import { makeWorktree } from '@/store/slices/store-test-helpers' +import { makeWorktree } from '../store/slices/worktrees-slice-test-fixtures' import { resolveWorkspaceTerminalHostAuthority } from './workspace-terminal-host-authority' import { resumeSleepingAgentSessionsForWorktree } from './resume-sleeping-agent-session' diff --git a/src/renderer/src/lib/unread-badge-count-migration.test.ts b/src/renderer/src/lib/unread-badge-count-migration.test.ts index b8ebb7a3fc2..0ab73125f83 100644 --- a/src/renderer/src/lib/unread-badge-count-migration.test.ts +++ b/src/renderer/src/lib/unread-badge-count-migration.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from 'vitest' -import { makeTab, makeWorktree, TEST_REPO } from '@/store/slices/store-test-helpers' +import { makeTab } from '../store/slices/store-session-test-harness' +import { makeWorktree, TEST_REPO } from '../store/slices/worktrees-slice-test-fixtures' import { makeFolderWorkspace } from '@/store/slices/worktrees-slice-test-fixtures' import type { ProjectGroup } from '../../../shared/project-group-types' import { getUnreadBadgeCount, type UnreadBadgeCountSources } from './unread-badge-count' diff --git a/src/renderer/src/lib/unread-badge-count.test.ts b/src/renderer/src/lib/unread-badge-count.test.ts index 87a9980497e..b3e718b0f7e 100644 --- a/src/renderer/src/lib/unread-badge-count.test.ts +++ b/src/renderer/src/lib/unread-badge-count.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from 'vitest' -import { makeTab, makeWorktree, TEST_REPO } from '@/store/slices/store-test-helpers' +import { makeTab } from '../store/slices/store-session-test-harness' +import { makeWorktree, TEST_REPO } from '../store/slices/worktrees-slice-test-fixtures' import { makeFolderWorkspace } from '@/store/slices/worktrees-slice-test-fixtures' import type { ProjectGroup } from '../../../shared/project-group-types' import type { Worktree } from '../../../shared/worktree/types' diff --git a/src/renderer/src/runtime/use-runtime-session-mirror-environment-key.test.ts b/src/renderer/src/runtime/use-runtime-session-mirror-environment-key.test.ts index 344016acf4d..2069bb85bdc 100644 --- a/src/renderer/src/runtime/use-runtime-session-mirror-environment-key.test.ts +++ b/src/renderer/src/runtime/use-runtime-session-mirror-environment-key.test.ts @@ -7,7 +7,7 @@ import { getDefaultSettings } from '../../../shared/constants' import type { ProjectGroup } from '../../../shared/project-group-types' import type { Repo } from '../../../shared/repo-types' import type * as RuntimeSessionMirrorTargetsModule from '@/lib/runtime-session-mirror-targets' -import { makeWorktree } from '@/store/slices/store-test-helpers' +import { makeWorktree } from '../store/slices/worktrees-slice-test-fixtures' const { getMirrorTargets } = vi.hoisted(() => ({ getMirrorTargets: vi.fn() })) diff --git a/src/renderer/src/store/slices/editor-tab-host-ownership.test.ts b/src/renderer/src/store/slices/editor-tab-host-ownership.test.ts index 20ef622011d..1125330db6a 100644 --- a/src/renderer/src/store/slices/editor-tab-host-ownership.test.ts +++ b/src/renderer/src/store/slices/editor-tab-host-ownership.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import { createEditorTabsStore } from './editor-slice-test-harness' -import { makeWorktree, TEST_REPO } from './store-test-helpers' +import { makeWorktree, TEST_REPO } from './worktrees-slice-test-fixtures' import { getDefaultSettings } from '../../../../shared/constants' import { assertEditorFileOperationCurrent, diff --git a/src/renderer/src/store/slices/new-markdown.test.ts b/src/renderer/src/store/slices/new-markdown.test.ts index ae859be5077..982f804b6cb 100644 --- a/src/renderer/src/store/slices/new-markdown.test.ts +++ b/src/renderer/src/store/slices/new-markdown.test.ts @@ -4,7 +4,7 @@ import { createEditorSlice } from './editor' import type { AppState } from '../types' import type { BrowserTab } from '../../../../shared/browser-workspace-types' import type { Tab, TabContentType, TabGroup } from '../../../../shared/tab-types' -import { makeTab } from './store-test-helpers' +import { makeTab } from './store-session-test-harness' function createEditorStore(overrides?: Partial): StoreApi { // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/renderer/src/store/slices/store-session-test-harness.ts b/src/renderer/src/store/slices/store-session-test-harness.ts index 6ef35f6360e..0a1f08266b7 100644 --- a/src/renderer/src/store/slices/store-session-test-harness.ts +++ b/src/renderer/src/store/slices/store-session-test-harness.ts @@ -1,5 +1,9 @@ import { vi, type Mock } from 'vitest' import type { BrowserTab } from '../../../../shared/browser-workspace-types' +import type { Tab, TabGroup } from '../../../../shared/tab-types' +import type { TerminalLayoutSnapshot, TerminalTab } from '../../../../shared/terminal-tab-types' +import type { OpenFile } from './editor' +import { translate } from '@/i18n/i18n' /** Shape shared by the Claude/Codex/OpenCode usage-scanner namespaces. */ type UsageScannerMocks = { @@ -128,3 +132,59 @@ export function makeBrowserTab( ...overrides } } + +export function makeTab( + overrides: Partial & { id: string; worktreeId: string } +): TerminalTab { + return { + ptyId: null, + title: translate('auto.store.slices.store.test.helpers.b9a8117c33', 'Terminal 1'), + customTitle: null, + color: null, + sortOrder: 0, + createdAt: Date.now(), + ...overrides + } +} + +export function makeLayout(): TerminalLayoutSnapshot { + return { root: null, activeLeafId: null, expandedLeafId: null } +} + +export function makeOpenFile( + overrides: Partial & { id: string; worktreeId: string } +): OpenFile { + return { + filePath: overrides.id, + relativePath: 'file.ts', + language: 'typescript', + isDirty: false, + mode: 'edit', + ...overrides + } +} + +export function makeUnifiedTab( + overrides: Partial & { id: string; worktreeId: string; groupId: string } +): Tab { + return { + entityId: overrides.id, + contentType: 'terminal', + label: translate('auto.store.slices.store.test.helpers.b9a8117c33', 'Terminal 1'), + customLabel: null, + color: null, + sortOrder: 0, + createdAt: Date.now(), + ...overrides + } +} + +export function makeTabGroup( + overrides: Partial & { id: string; worktreeId: string } +): TabGroup { + return { + activeTabId: null, + tabOrder: [], + ...overrides + } +} diff --git a/src/renderer/src/store/slices/store-test-helpers.ts b/src/renderer/src/store/slices/store-test-helpers.ts index 259eda1c10b..abc8f0fdaa0 100644 --- a/src/renderer/src/store/slices/store-test-helpers.ts +++ b/src/renderer/src/store/slices/store-test-helpers.ts @@ -1,9 +1,6 @@ import { create } from 'zustand' import type { AppState } from '../types' -import type { Tab, TabGroup } from '../../../../shared/tab-types' -import type { TerminalLayoutSnapshot, TerminalTab } from '../../../../shared/terminal-tab-types' import type { Worktree } from '../../../../shared/worktree/types' -import type { OpenFile } from './editor' import { createRepoSlice } from './repos' import { createSparsePresetsSlice } from './sparse-presets' import { createWorktreeSlice } from './worktrees' @@ -52,15 +49,16 @@ import { createTaskCreationDraftsSlice } from './task-creation-drafts' import { createRemoteServerUpdatesSlice } from './remote-server-updates' import { createTerminalQuickCommandHostsSlice } from './terminal-quick-command-hosts' import { createStructuredSessionLaunchDirectorySlice } from './structured-session-launch-directories' -import { translate } from '@/i18n/i18n' - -export const TEST_REPO = { - id: 'repo1', - path: '/repo1', - displayName: 'Repo 1', - badgeColor: '#000', - addedAt: 0 -} +import '@/i18n/i18n' +import { makeWorktree, TEST_REPO } from './worktrees-slice-test-fixtures' +export { makeWorktree, TEST_REPO } from './worktrees-slice-test-fixtures' +export { + makeTab, + makeLayout, + makeOpenFile, + makeUnifiedTab, + makeTabGroup +} from './store-session-test-harness' export function createTestStore() { return create()((...a) => ({ @@ -126,31 +124,6 @@ export function seedStore( }) } -export function makeWorktree( - overrides: Partial & { id: string; repoId: string } -): Worktree { - return { - path: '/tmp/wt', - head: 'abc123', - branch: 'refs/heads/feature', - isBare: false, - isMainWorktree: false, - displayName: 'feature', - comment: '', - linkedIssue: null, - linkedPR: null, - linkedLinearIssue: null, - linkedGitLabMR: null, - linkedGitLabIssue: null, - isArchived: false, - isUnread: false, - isPinned: false, - sortOrder: 0, - lastActivityAt: 0, - ...overrides - } -} - export function makeRuntimeOwnedWorktree( overrides: Partial & { id: string; repoId: string }, runtimeEnvironmentId = 'runtime-1' @@ -161,59 +134,3 @@ export function makeRuntimeOwnedWorktree( runtimeOwnerEnvironmentId: runtimeEnvironmentId }) } - -export function makeTab( - overrides: Partial & { id: string; worktreeId: string } -): TerminalTab { - return { - ptyId: null, - title: translate('auto.store.slices.store.test.helpers.b9a8117c33', 'Terminal 1'), - customTitle: null, - color: null, - sortOrder: 0, - createdAt: Date.now(), - ...overrides - } -} - -export function makeLayout(): TerminalLayoutSnapshot { - return { root: null, activeLeafId: null, expandedLeafId: null } -} - -export function makeOpenFile( - overrides: Partial & { id: string; worktreeId: string } -): OpenFile { - return { - filePath: overrides.id, - relativePath: 'file.ts', - language: 'typescript', - isDirty: false, - mode: 'edit', - ...overrides - } -} - -export function makeUnifiedTab( - overrides: Partial & { id: string; worktreeId: string; groupId: string } -): Tab { - return { - entityId: overrides.id, - contentType: 'terminal', - label: translate('auto.store.slices.store.test.helpers.b9a8117c33', 'Terminal 1'), - customLabel: null, - color: null, - sortOrder: 0, - createdAt: Date.now(), - ...overrides - } -} - -export function makeTabGroup( - overrides: Partial & { id: string; worktreeId: string } -): TabGroup { - return { - activeTabId: null, - tabOrder: [], - ...overrides - } -} diff --git a/src/renderer/src/store/slices/worktrees-slice-test-fixtures.ts b/src/renderer/src/store/slices/worktrees-slice-test-fixtures.ts index 9202984481d..74873994232 100644 --- a/src/renderer/src/store/slices/worktrees-slice-test-fixtures.ts +++ b/src/renderer/src/store/slices/worktrees-slice-test-fixtures.ts @@ -4,6 +4,14 @@ import type { TerminalTab } from '../../../../shared/terminal-tab-types' import type { WorkspaceLineage, WorktreeLineage } from '../../../../shared/worktree/lineage-types' import type { Worktree } from '../../../../shared/worktree/types' +export const TEST_REPO = { + id: 'repo1', + path: '/repo1', + displayName: 'Repo 1', + badgeColor: '#000', + addedAt: 0 +} + export function makeWorktree( overrides: Partial & { id: string; repoId: string } ): Worktree {