mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 22:14:22 +00:00
test: cover agents permission-mode passthrough
This commit is contained in:
1 parent
ef4b746876
commit
e0f43b88c2
1 file changed
+15
@@ -110,6 +110,15 @@ describe('stripClaudeSubcommandSessionArgs', () => {
|
|||||||
).toEqual(['mcp', '--setting-sources', 'user']);
|
).toEqual(['mcp', '--setting-sources', 'user']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('removes --permission-mode for non-agents subcommands', () => {
|
||||||
|
expect(
|
||||||
|
stripClaudeSubcommandSessionArgs(['--permission-mode', 'bypassPermissions', 'doctor'])
|
||||||
|
).toEqual(['doctor']);
|
||||||
|
expect(stripClaudeSubcommandSessionArgs(['doctor', '--permission-mode=acceptEdits'])).toEqual([
|
||||||
|
'doctor',
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
it('preserves --permission-mode for the agents subcommand (after)', () => {
|
it('preserves --permission-mode for the agents subcommand (after)', () => {
|
||||||
// `claude agents` accepts `--permission-mode <mode>` as the default
|
// `claude agents` accepts `--permission-mode <mode>` as the default
|
||||||
// permission mode for dispatched sessions; CCS must not strip it.
|
// permission mode for dispatched sessions; CCS must not strip it.
|
||||||
@@ -124,6 +133,12 @@ describe('stripClaudeSubcommandSessionArgs', () => {
|
|||||||
).toEqual(['agents', '--permission-mode', 'bypassPermissions']);
|
).toEqual(['agents', '--permission-mode', 'bypassPermissions']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('preserves --permission-mode for the agents subcommand (before, separate value form)', () => {
|
||||||
|
expect(
|
||||||
|
stripClaudeSubcommandSessionArgs(['--permission-mode', 'bypassPermissions', 'agents'])
|
||||||
|
).toEqual(['--permission-mode', 'bypassPermissions', 'agents']);
|
||||||
|
});
|
||||||
|
|
||||||
it('preserves --permission-mode for the agents subcommand (before, --flag=value form)', () => {
|
it('preserves --permission-mode for the agents subcommand (before, --flag=value form)', () => {
|
||||||
expect(
|
expect(
|
||||||
stripClaudeSubcommandSessionArgs(['--permission-mode=bypassPermissions', 'agents'])
|
stripClaudeSubcommandSessionArgs(['--permission-mode=bypassPermissions', 'agents'])
|
||||||
|
|||||||
Reference in new issue
Block a user