mirror of
https://github.com/stablyai/orca.git
synced 2026-11-01 17:47:40 +00:00
* 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
53 lines
1.3 KiB
TypeScript
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' })
|
|
})
|
|
})
|