mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 10:18:14 +00:00
fix(profile): close km legacy kimi compatibility gaps
This commit is contained in:
1 parent
cf8070b5f0
commit
0bf00b23d9
9 files changed
+343
-66
No files matched your search
@@ -1,5 +1,9 @@
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
import { getProfileLookupCandidates, isLegacyProfileAlias } from '../../../src/utils/profile-compat';
|
||||
import {
|
||||
getProfileLookupCandidates,
|
||||
isLegacyProfileAlias,
|
||||
resolveAliasToCanonical,
|
||||
} from '../../../src/utils/profile-compat';
|
||||
|
||||
describe('profile-compat', () => {
|
||||
describe('getProfileLookupCandidates', () => {
|
||||
@@ -14,6 +18,15 @@ describe('profile-compat', () => {
|
||||
it('normalizes uppercase input and still resolves aliases', () => {
|
||||
expect(getProfileLookupCandidates('KM')).toEqual(['KM', 'km', 'kimi']);
|
||||
});
|
||||
|
||||
it('handles surrounding whitespace', () => {
|
||||
expect(getProfileLookupCandidates(' km ')).toEqual(['km', 'kimi']);
|
||||
});
|
||||
|
||||
it('returns empty candidates for empty input', () => {
|
||||
expect(getProfileLookupCandidates('')).toEqual([]);
|
||||
expect(getProfileLookupCandidates(' ')).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isLegacyProfileAlias', () => {
|
||||
@@ -30,4 +43,16 @@ describe('profile-compat', () => {
|
||||
expect(isLegacyProfileAlias('glm', 'kimi')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveAliasToCanonical', () => {
|
||||
it('maps legacy kimi alias to canonical km', () => {
|
||||
expect(resolveAliasToCanonical('kimi')).toBe('km');
|
||||
expect(resolveAliasToCanonical('KIMI')).toBe('km');
|
||||
});
|
||||
|
||||
it('keeps canonical and non-aliased names', () => {
|
||||
expect(resolveAliasToCanonical('km')).toBe('km');
|
||||
expect(resolveAliasToCanonical('glm')).toBe('glm');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user