Files
ccs/tests/unit/cliproxy/backend-ui-provider-arrays-sync.test.ts
T
kaitranntt 5c62e06d02 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
2026-01-27 22:20:15 -05:00

41 lines
1.0 KiB
TypeScript

/**
* 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);
}
});
});