mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-17 06:14:30 +00:00
fix(thinking): handle clear no-op and tighten override coverage
This commit is contained in:
1 parent
92e2ec111d
commit
954baecfe4
8 files changed
+298
-28
No files matched your search
@@ -3,6 +3,7 @@ import {
|
||||
parseThinkingCommandArgs,
|
||||
parseThinkingOverrideInput,
|
||||
} from '../../../src/commands/config-thinking-command';
|
||||
import { clearProviderOverride } from '../../../src/commands/config-thinking-parser';
|
||||
|
||||
describe('config thinking command parser', () => {
|
||||
it('rejects missing required option values', () => {
|
||||
@@ -41,3 +42,47 @@ describe('config thinking override normalization', () => {
|
||||
expect(parseThinkingOverrideInput('8192')).toEqual({ value: 8192 });
|
||||
});
|
||||
});
|
||||
|
||||
describe('config thinking provider override clearing', () => {
|
||||
it('is a no-op when provider override does not exist', () => {
|
||||
const result = clearProviderOverride(
|
||||
{
|
||||
codex: { opus: 'high' },
|
||||
},
|
||||
'gemini'
|
||||
);
|
||||
|
||||
expect(result.changed).toBe(false);
|
||||
expect(result.nextOverrides).toEqual({
|
||||
codex: { opus: 'high' },
|
||||
});
|
||||
});
|
||||
|
||||
it('is a no-op when provider exists but tier override does not', () => {
|
||||
const result = clearProviderOverride(
|
||||
{
|
||||
codex: { opus: 'high' },
|
||||
},
|
||||
'codex',
|
||||
'haiku'
|
||||
);
|
||||
|
||||
expect(result.changed).toBe(false);
|
||||
expect(result.nextOverrides).toEqual({
|
||||
codex: { opus: 'high' },
|
||||
});
|
||||
});
|
||||
|
||||
it('removes provider entry when last tier is cleared', () => {
|
||||
const result = clearProviderOverride(
|
||||
{
|
||||
codex: { opus: 'high' },
|
||||
},
|
||||
'codex',
|
||||
'opus'
|
||||
);
|
||||
|
||||
expect(result.changed).toBe(true);
|
||||
expect(result.nextOverrides).toBeUndefined();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user