Improve package usage visibility
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-06 14:17:27 +01:00
parent ef1773d966
commit 232302eb6f
12 changed files with 370 additions and 31 deletions

View File

@@ -14,7 +14,8 @@ const t = (key: string, options?: Record<string, unknown> | string) => {
const template = (options?.defaultValue as string | undefined) ?? key;
return template
.replace('{{used}}', String(options?.used ?? '{{used}}'))
.replace('{{limit}}', String(options?.limit ?? '{{limit}}'));
.replace('{{limit}}', String(options?.limit ?? '{{limit}}'))
.replace('{{remaining}}', String(options?.remaining ?? '{{remaining}}'));
};
describe('packageSummary helpers', () => {
@@ -46,10 +47,10 @@ describe('packageSummary helpers', () => {
});
it('returns labeled limit entries', () => {
const result = getPackageLimitEntries({ max_photos: 120 }, t);
const result = getPackageLimitEntries({ max_photos: 120, remaining_photos: 30 }, t);
expect(result[0].label).toBe('Photos');
expect(result[0].value).toBe('120');
expect(result[0].value).toBe('30 of 120 remaining');
});
it('formats event usage copy', () => {