Files
orca/src/shared/orca-hook-setup-config.test.ts
T
Kelvin Amoaba 71b55ab8a9 fix(mobile): use desktop's setup config and trust rules when creating workspaces (#33942)
* fix(mobile): ask before running orca.yaml default-tab commands from the phone

The host's repo.hooks reply now carries desktop's setup config, so the phone
gates the Run/Skip choice and the trust prompt on defaultTabs commands too.

* fix(setup): keep the local script in run-both setup config without orca.yaml commands

* test(setup): drop the shared duplicate-host trust test desktop already covers

* refactor(setup): derive host setup trust from the shared setup config

* fix(mobile): count every host's repo rows before honouring repo-wide setup trust
2026-10-27 03:20:46 +00:00

53 lines
1.3 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { getSetupConfig } from './orca-hook-setup-config'
describe('getSetupConfig', () => {
it('treats default tab commands as setup-decision commands', () => {
expect(
getSetupConfig(undefined, {
scripts: {},
defaultTabs: [
{ title: 'Server', command: 'pnpm dev' },
{ title: 'Notes' },
{ command: 'codex' }
]
})
).toEqual({
source: 'yaml',
kind: 'default-tabs',
command: '# defaultTabs[1] Server\npnpm dev\n\n# defaultTabs[3]\ncodex'
})
})
it('ignores shared default tab commands when command source is local-only', () => {
expect(
getSetupConfig(
{
hookSettings: {
commandSourcePolicy: 'local-only',
scripts: {}
}
},
{
scripts: {},
defaultTabs: [{ title: 'Server', command: 'pnpm dev' }]
}
)
).toBeNull()
})
it('keeps the local setup script for run-both repos without shared commands', () => {
expect(
getSetupConfig(
{
hookSettings: {
commandSourcePolicy: 'run-both',
scripts: { setup: 'pnpm install' }
}
},
null
)
).toEqual({ source: 'local', command: 'pnpm install', kind: 'setup' })
})
})