Improve package usage visibility
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user