From 2a5205aba4fe25fbdcb13d60a59c073b2499a7cc Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Sat, 11 Jul 2026 16:53:34 -0700 Subject: [PATCH] test: reconcile settings tests with universal right-click paste and promoted worktree symlinks Merging main surfaced two semantic conflicts against this branch's tests: - #8322 exposed right-click paste on every platform, so the settings navigation metadata now indexes it even when only the terminal host is Windows. Update the stale assertion accordingly. - #8318 promoted APFS worktree shared paths by dropping the experimentalWorktreeSymlinks gate, so WorktreeSymlinksSection now always mounts inside RepositoryPane and reads window.api.fs. Stub a minimal renderer fs bridge in the pane test, matching the AppearancePane pattern. Co-authored-by: Orca --- .../src/components/settings/RepositoryPane.test.ts | 7 +++++++ .../src/hooks/useSettingsNavigationMetadata.test.ts | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/settings/RepositoryPane.test.ts b/src/renderer/src/components/settings/RepositoryPane.test.ts index cd900ebf615..f7b5d09da09 100644 --- a/src/renderer/src/components/settings/RepositoryPane.test.ts +++ b/src/renderer/src/components/settings/RepositoryPane.test.ts @@ -69,6 +69,12 @@ beforeEach(() => { container = document.createElement('div') document.body.appendChild(container) root = createRoot(container) + // WorktreeSymlinksSection reads window.api.fs on mount to suggest directory + // paths; provide a minimal renderer bridge so mounting the full pane doesn't + // throw in the test environment. + ;(window as unknown as { api: unknown }).api = { + fs: { readDir: () => Promise.resolve([]) } + } }) afterEach(() => { @@ -76,6 +82,7 @@ afterEach(() => { root.unmount() }) container.remove() + delete (window as unknown as { api?: unknown }).api useAppStore.setState(useAppStore.getInitialState(), true) }) diff --git a/src/renderer/src/hooks/useSettingsNavigationMetadata.test.ts b/src/renderer/src/hooks/useSettingsNavigationMetadata.test.ts index f41e4156f93..59c2cca3d14 100644 --- a/src/renderer/src/hooks/useSettingsNavigationMetadata.test.ts +++ b/src/renderer/src/hooks/useSettingsNavigationMetadata.test.ts @@ -142,7 +142,7 @@ describe('settings navigation metadata', () => { expect(repoSection?.searchEntries.some((entry) => entry.title === 'Project Runtime')).toBe(true) }) - it('keeps Windows client-only terminal settings out of Windows-host metadata', () => { + it('surfaces Windows-host and universal terminal settings in Windows-host metadata', () => { const sections = buildSettingsNavigationMetadata({ isMac: false, isWindows: false, @@ -155,8 +155,10 @@ describe('settings navigation metadata', () => { expect(terminal?.searchEntries.some((entry) => entry.title === 'Default Shell')).toBe(true) expect(terminal?.searchEntries.some((entry) => entry.title === 'PowerShell Version')).toBe(true) + // Right-click to paste is now exposed on every platform (#8322), so it is + // indexed even when only the terminal host — not the client — is Windows. expect(terminal?.searchEntries.some((entry) => entry.title === 'Right-click to paste')).toBe( - false + true ) })