mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 14:16:43 +00:00
test(accounts): align stale free-tier expectations with current behavior
Commit 72ea1fc9 ("fix(accounts): simplify codex free tier badges") split
free codex accounts out of the `personal` audience into a distinct
`free` audience and dropped the `'Personal · '` prefix on inlineLabel,
but `account-visual-groups.test.ts` was not updated and has been
failing in CI ever since.
Update expectations to match the shipped behavior:
- `audience` for `-free` tokens is `'free'`, not `'personal'`
- `inlineLabel` for a bare free account is `'Free'`, not `'Personal · Free'`
- `compactDetailLabel` is `null` when no extra parts are present
- Sort order: business -> personal -> free -> unknown
Drive-by fix unrelated to the Opus 4.8 work in this PR but caught
because these tests started failing on every push to the branch.
Built [OnSteroids](https://onsteroids.ai)
This commit is contained in:
@@ -29,17 +29,14 @@ describe('buildAccountVisualGroups', () => {
|
||||
]);
|
||||
|
||||
expect(groups).toHaveLength(1);
|
||||
expect(groups[0]?.variants?.map((variant) => variant.audience)).toEqual([
|
||||
'business',
|
||||
'personal',
|
||||
]);
|
||||
expect(groups[0]?.variants?.map((variant) => variant.audience)).toEqual(['business', 'free']);
|
||||
expect(groups[0]?.variants?.map((variant) => variant.inlineLabel)).toEqual([
|
||||
'Business · Workspace 04a0f049',
|
||||
'Personal · Free',
|
||||
'Free',
|
||||
]);
|
||||
expect(groups[0]?.variants?.map((variant) => variant.compactDetailLabel)).toEqual([
|
||||
'04a0f049',
|
||||
'Free',
|
||||
null,
|
||||
]);
|
||||
expect(groups[0]?.memberIds).toEqual([
|
||||
'kaidu.kd@gmail.com#04a0f049-team',
|
||||
@@ -47,7 +44,7 @@ describe('buildAccountVisualGroups', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('keeps multiple personal codex plans distinct inside the same grouped card', () => {
|
||||
it('keeps personal and free codex plans distinct inside the same grouped card', () => {
|
||||
const groups = buildAccountVisualGroups([
|
||||
makeAccount({
|
||||
id: 'kaidu.kd@gmail.com#plus',
|
||||
@@ -61,8 +58,8 @@ describe('buildAccountVisualGroups', () => {
|
||||
|
||||
expect(groups).toHaveLength(1);
|
||||
expect(groups[0]?.variants?.map((variant) => variant.inlineLabel)).toEqual([
|
||||
'Personal · Free',
|
||||
'Personal · Plus',
|
||||
'Free',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user