mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-15 02:16:27 +00:00
feat(codex): harden runtime targeting and dashboard editing
This commit is contained in:
1 parent
09b7f66c0b
commit
9e43beec40
27 files changed
+932
-113
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { render, screen, userEvent } from '@tests/setup/test-utils';
|
||||
import { CodexTopLevelControlsCard } from '@/components/compatible-cli/codex-top-level-controls-card';
|
||||
|
||||
describe('CodexTopLevelControlsCard', () => {
|
||||
it('submits only changed fields so untouched unsupported values are preserved upstream', async () => {
|
||||
const onSave = vi.fn();
|
||||
|
||||
render(
|
||||
<CodexTopLevelControlsCard
|
||||
values={{
|
||||
model: null,
|
||||
modelReasoningEffort: null,
|
||||
modelProvider: null,
|
||||
approvalPolicy: null,
|
||||
sandboxMode: null,
|
||||
webSearch: null,
|
||||
toolOutputTokenLimit: null,
|
||||
personality: null,
|
||||
}}
|
||||
providerNames={[]}
|
||||
onSave={onSave}
|
||||
/>
|
||||
);
|
||||
|
||||
const saveButton = screen.getByRole('button', { name: 'Save top-level settings' });
|
||||
expect(saveButton).toBeDisabled();
|
||||
|
||||
await userEvent.type(screen.getByPlaceholderText('gpt-5.4'), 'gpt-5.4-mini');
|
||||
expect(saveButton).toBeEnabled();
|
||||
|
||||
await userEvent.click(saveButton);
|
||||
|
||||
expect(onSave).toHaveBeenCalledTimes(1);
|
||||
expect(onSave).toHaveBeenCalledWith({ model: 'gpt-5.4-mini' });
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user