feat(quota): update .quotaAmount styles and add tests for size consistency with quota metadata

This commit is contained in:
Supra4E8C
2026-10-15 01:10:29 +08:00
parent e4e9c54112
commit 13f94b47f3
2 changed files with 14 additions and 0 deletions
@@ -78,6 +78,8 @@
.quotaAmount {
font-family: $font-mono;
font-size: 11.5px;
font-weight: 500;
font-variant-numeric: tabular-nums;
color: var(--text-secondary);
}
+12
View File
@@ -24,6 +24,18 @@ const readHost = (path: string) => Bun.file(new URL(`../${path}`, import.meta.ur
describe('quota class contract', () => {
for (const [host, path] of Object.entries(HOSTS)) {
test(`${host} gives standalone amounts the same size as quota metadata`, async () => {
const css = await readHost(path);
const amount = css.match(/\.quotaAmount\s*\{([^}]+)\}/)?.[1] ?? '';
const meta = css.match(/\.quotaMeta\s*\{([^}]+)\}/)?.[1] ?? '';
const size = amount.match(/font-size:\s*([^;]+);/)?.[1];
expect(size).toBeDefined();
expect(size).toBe(meta.match(/font-size:\s*([^;]+);/)?.[1]);
expect(amount).toContain('font-family: $font-mono;');
expect(amount).toContain('font-weight: 500;');
expect(amount).toContain('font-variant-numeric: tabular-nums;');
});
test(`${host} defines every QuotaClassMap key`, async () => {
const css = await readHost(path);
const missing = QUOTA_CLASS_KEYS.filter(