mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 23:32:12 +03:00
* fix(dashboard): resolve costs page 500 from out-of-scope t() in TopListCard (#7272) TopListCard (CostOverviewTab.tsx) referenced the bare identifier `t` from an outer component's scope when rendering the zero-cost / !hasCostData branch, throwing "ReferenceError: t is not defined" and crashing /dashboard/costs?range=all&apiKeyIds=...&groupBy=model whenever a filtered slice landed only $0-cost rows. Extracted TopListCard into its own component file and threaded the resolved legacyFreeLabel string in as a prop, mirroring the existing CostBreakdownTable pattern in the same file. Also fixes a case of the typecheck:core dashboard .tsx coverage gap tracked in #7033. * test(dashboard): move TopListCard #7272 regression test to vitest UI project The node:test unit runner cannot load TopListCard's import chain (@/shared/components -> ProviderIcon -> @lobehub/icons ESM), which made the "Impacted unit tests (TIA subset; blocking)" CI job red with "Unexpected token 'export'" on tests/unit/costs-toplistcard-legacy-free-label-7272.test.ts. Moved the regression test to tests/unit/ui/ and rewrote it against the vitest UI project (test:vitest:ui, blocking in the test-vitest CI job), which handles the ESM import chain natively. Verified the test still fails with "ReferenceError: t is not defined" against the pre-#7272 TopListCard body and passes against the fixed component.