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:
kaitranntt
2026-01-27 22:20:15 -05:00
parent ebc42c9457
commit 5c62e06d02
2 changed files with 41 additions and 0 deletions
@@ -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);
}
});
});
+1
View File
@@ -35,6 +35,7 @@ export const PROVIDER_ASSETS: Record<string, string> = {
agy: '/assets/providers/agy.png',
codex: '/assets/providers/openai.svg',
qwen: '/assets/providers/qwen-color.svg',
iflow: '/assets/providers/iflow.png',
kiro: '/assets/providers/kiro.png',
ghcp: '/assets/providers/copilot.svg',
claude: '/assets/providers/claude.svg',