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 <help@stably.ai>
This commit is contained in:
Jinjing
2026-07-11 16:53:34 -07:00
co-authored by Orca
parent 07c8289e51
commit 2a5205aba4
2 changed files with 11 additions and 2 deletions
@@ -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)
})
@@ -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
)
})