mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-16 12:14:55 +00:00
fix(cliproxy): keep provider sections consistent for variants
This commit is contained in:
1 parent
f6c86b79fc
commit
254abd504f
10 files changed
+149
-51
No files matched your search
@@ -75,4 +75,24 @@ describe('ProviderInfoTab', () => {
|
||||
)
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('uses the base provider when rendering variant track metadata', () => {
|
||||
render(
|
||||
<ProviderInfoTab
|
||||
provider="my-cursor"
|
||||
baseProvider="cursor"
|
||||
displayName="My Cursor Variant"
|
||||
defaultTarget="claude"
|
||||
authStatus={{
|
||||
...authenticatedStatus,
|
||||
provider: 'cursor',
|
||||
displayName: 'Cursor',
|
||||
}}
|
||||
supportsModelConfig
|
||||
/>
|
||||
);
|
||||
|
||||
expect(screen.getByText('Track')).toBeInTheDocument();
|
||||
expect(screen.getByText('Plus extras / community-maintained')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
parseRequestedUpstreamModelRules,
|
||||
PLUS_EXTRA_CLIPROXY_PROVIDERS,
|
||||
PROVIDER_COLORS,
|
||||
variantUsesPlusExtraProvider,
|
||||
} from '@/lib/provider-config';
|
||||
|
||||
describe('provider model mapping helpers', () => {
|
||||
@@ -89,6 +90,27 @@ describe('provider presentation metadata', () => {
|
||||
expect(grouped[1]?.items.map((entry) => entry.provider)).toEqual(['cursor']);
|
||||
});
|
||||
|
||||
it('detects plus-extra providers inside composite variants', () => {
|
||||
expect(
|
||||
variantUsesPlusExtraProvider({
|
||||
provider: 'gemini',
|
||||
tiers: {
|
||||
opus: { provider: 'gemini' },
|
||||
sonnet: { provider: 'cursor' },
|
||||
},
|
||||
})
|
||||
).toBe(true);
|
||||
expect(
|
||||
variantUsesPlusExtraProvider({
|
||||
provider: 'gemini',
|
||||
tiers: {
|
||||
opus: { provider: 'gemini' },
|
||||
sonnet: { provider: 'kimi' },
|
||||
},
|
||||
})
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it.each([
|
||||
['cursor', 'Cursor', 'Cursor browser-authenticated provider', '/assets/sidebar/cursor.svg'],
|
||||
['gitlab', 'GitLab Duo', 'GitLab Duo with OAuth or PAT auth', '/assets/providers/gitlab.svg'],
|
||||
|
||||
Reference in new issue
Block a user