mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-08 20:19:37 +00:00
fix(ui): add iFlow to PROVIDER_ASSETS + sync validation test
- Add iflow.png to PROVIDER_ASSETS map - Add backend-ui-provider-arrays-sync.test.ts to catch mismatches - Addresses PR #384 review: dual source of truth + missing iFlow
This commit is contained in:
@@ -0,0 +1,40 @@
|
|||||||
|
/**
|
||||||
|
* Provider Sync Test
|
||||||
|
*
|
||||||
|
* Validates that backend CLIPROXY_PROFILES and UI CLIPROXY_PROVIDERS stay in sync.
|
||||||
|
* This test catches mismatches when adding new providers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { describe, expect, test } from 'bun:test';
|
||||||
|
import { CLIPROXY_PROFILES } from '../../../src/auth/profile-detector';
|
||||||
|
|
||||||
|
// UI providers (must manually sync - this test validates the sync)
|
||||||
|
const UI_CLIPROXY_PROVIDERS = [
|
||||||
|
'gemini',
|
||||||
|
'codex',
|
||||||
|
'agy',
|
||||||
|
'qwen',
|
||||||
|
'iflow',
|
||||||
|
'kiro',
|
||||||
|
'ghcp',
|
||||||
|
'claude',
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
describe('Provider Sync', () => {
|
||||||
|
test('backend CLIPROXY_PROFILES matches UI CLIPROXY_PROVIDERS', () => {
|
||||||
|
const backend = [...CLIPROXY_PROFILES].sort();
|
||||||
|
const ui = [...UI_CLIPROXY_PROVIDERS].sort();
|
||||||
|
|
||||||
|
expect(backend).toEqual(ui);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('both arrays have same length', () => {
|
||||||
|
expect(CLIPROXY_PROFILES.length).toBe(UI_CLIPROXY_PROVIDERS.length);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('UI array contains all backend providers', () => {
|
||||||
|
for (const provider of CLIPROXY_PROFILES) {
|
||||||
|
expect(UI_CLIPROXY_PROVIDERS).toContain(provider);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -35,6 +35,7 @@ export const PROVIDER_ASSETS: Record<string, string> = {
|
|||||||
agy: '/assets/providers/agy.png',
|
agy: '/assets/providers/agy.png',
|
||||||
codex: '/assets/providers/openai.svg',
|
codex: '/assets/providers/openai.svg',
|
||||||
qwen: '/assets/providers/qwen-color.svg',
|
qwen: '/assets/providers/qwen-color.svg',
|
||||||
|
iflow: '/assets/providers/iflow.png',
|
||||||
kiro: '/assets/providers/kiro.png',
|
kiro: '/assets/providers/kiro.png',
|
||||||
ghcp: '/assets/providers/copilot.svg',
|
ghcp: '/assets/providers/copilot.svg',
|
||||||
claude: '/assets/providers/claude.svg',
|
claude: '/assets/providers/claude.svg',
|
||||||
|
|||||||
Reference in New Issue
Block a user