mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-26 09:02:11 +03:00
refactor(dashboard): format custom provider quota keys into title-cased labels (#11188)
Validated on the combined batch board + this branch: dashboard-ux-operability green. Unmapped custom quota keys now render as title-cased labels instead of raw snake_case. Conflict with the tip was only stale provider-count docs. Thank you @rqzbeh!
This commit is contained in:
@@ -98,7 +98,7 @@ export function formatQuotaLabel(name: string) {
|
||||
return `Weekly ${toTitleCaseWords(weeklyModelMatch[1])}`;
|
||||
}
|
||||
|
||||
return trimmed;
|
||||
return toTitleCaseWords(trimmed.replace(/_/g, " "));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
9
tests/unit/dashboard-ux-operability.test.ts
Normal file
9
tests/unit/dashboard-ux-operability.test.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { test } from "node:test";
|
||||
import { formatQuotaLabel } from "../../src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.tsx";
|
||||
|
||||
test("formatQuotaLabel formats custom quota keys with proper title-casing", () => {
|
||||
assert.equal(formatQuotaLabel("session"), "Session");
|
||||
assert.equal(formatQuotaLabel("weekly"), "Weekly");
|
||||
assert.equal(formatQuotaLabel("custom_quota_limit"), "Custom Quota Limit");
|
||||
});
|
||||
Reference in New Issue
Block a user