mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-19 18:18:38 +00:00
- keep raw JSON model mappings aligned with requested=upstream semantics - block malformed mapping lines instead of coercing them on save - render saved mappings as requested to upstream and add regression coverage Refs #941
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { describe, expect, it, vi } from 'vitest';
|
|
|
|
import { ProviderEntryCard } from '@/components/cliproxy/ai-providers/provider-entry-card';
|
|
import { render, screen } from '../../../setup/test-utils';
|
|
|
|
describe('ProviderEntryCard', () => {
|
|
it('renders mapped models as requested to upstream', () => {
|
|
render(
|
|
<ProviderEntryCard
|
|
family={{
|
|
id: 'openai-compatibility',
|
|
displayName: 'OpenAI-Compatible',
|
|
description: 'Connectors',
|
|
authMode: 'connector',
|
|
routePath: '/api/provider/openai-compat',
|
|
status: 'ready',
|
|
supportsNamedEntries: true,
|
|
entries: [],
|
|
}}
|
|
entry={{
|
|
id: 'openai-compatibility:0',
|
|
index: 0,
|
|
name: 'openrouter',
|
|
label: 'openrouter',
|
|
baseUrl: 'https://openrouter.ai/api/v1',
|
|
headers: [],
|
|
excludedModels: [],
|
|
models: [{ name: 'gpt-5', alias: 'claude-sonnet-4-5' }],
|
|
apiKeysMasked: ['...1234'],
|
|
secretConfigured: true,
|
|
}}
|
|
onEdit={vi.fn()}
|
|
onDelete={vi.fn()}
|
|
/>
|
|
);
|
|
|
|
expect(screen.getByText('claude-sonnet-4-5')).toBeInTheDocument();
|
|
expect(screen.getByText('gpt-5')).toBeInTheDocument();
|
|
expect(screen.getByText('→')).toBeInTheDocument();
|
|
});
|
|
});
|