mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-17 10:14:08 +00:00
fix(codex): align cliproxy guidance with runtime behavior
This commit is contained in:
1 parent
0ffde4f3a2
commit
bd1ff02521
22 files changed
+342
-64
No files matched your search
@@ -0,0 +1,54 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { render, screen } from '@tests/setup/test-utils';
|
||||
import { ProviderInfoTab } from '@/components/cliproxy/provider-editor/provider-info-tab';
|
||||
|
||||
const authenticatedStatus = {
|
||||
provider: 'codex',
|
||||
displayName: 'Codex',
|
||||
authenticated: true,
|
||||
lastAuth: null,
|
||||
tokenFiles: 1,
|
||||
accounts: [],
|
||||
};
|
||||
|
||||
describe('ProviderInfoTab', () => {
|
||||
it('routes management commands through Claude target for codex-target variants', () => {
|
||||
render(
|
||||
<ProviderInfoTab
|
||||
provider="codex"
|
||||
displayName="Codex"
|
||||
defaultTarget="codex"
|
||||
authStatus={authenticatedStatus}
|
||||
supportsModelConfig
|
||||
/>
|
||||
);
|
||||
|
||||
expect(screen.getByText('ccs codex --target claude --config')).toBeInTheDocument();
|
||||
expect(screen.getByText('ccs codex --target claude --auth --add')).toBeInTheDocument();
|
||||
expect(screen.getByText('ccs codex --target claude --accounts')).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByText(
|
||||
/Codex and Droid runtime launches reject those CLIProxy management commands\./
|
||||
)
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('hides unsupported model-config commands when the provider has no catalog support', () => {
|
||||
render(
|
||||
<ProviderInfoTab
|
||||
provider="custom-provider"
|
||||
displayName="Custom Provider"
|
||||
defaultTarget="claude"
|
||||
authStatus={{
|
||||
...authenticatedStatus,
|
||||
provider: 'custom-provider',
|
||||
displayName: 'Custom Provider',
|
||||
}}
|
||||
supportsModelConfig={false}
|
||||
/>
|
||||
);
|
||||
|
||||
expect(screen.queryByText('Change model')).not.toBeInTheDocument();
|
||||
expect(screen.getByText('ccs custom-provider --auth --add')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user