Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ implementa ese puerto.

- **Todo el stack**: `docker compose up --build` (desde la raíz).
- **Tests backend**: `./scripts/test-backend.sh` (dotnet test dockerizado, no requiere SDK local).
Cobertura: `dotnet test --collect:"XPlat Code Coverage"` (coverlet, salida Cobertura).
- **Frontend**: `cd frontend && npm run dev` | `npm run build` | `npm run lint` | `npm run test:run`.
Cobertura: `npm run test:coverage` (vitest + v8; informe en `frontend/coverage/`).

## Gotchas conocidos (transversales)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0" />
<!-- Enables code coverage collection (dotnet test, XPlat Code Coverage / Cobertura). -->
<PackageReference Include="coverlet.collector" Version="6.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
24 changes: 23 additions & 1 deletion frontend/app/lib/format.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { describe, expect, it } from "vitest";
import { formatAmountCompact, formatAmountFull } from "./format";
import {
formatAmountCompact,
formatAmountFull,
formatDateShort,
formatInt,
} from "./format";

describe("formatAmountCompact", () => {
it("collapses thousands into K", () => {
Expand All @@ -24,3 +29,20 @@ describe("formatAmountFull", () => {
expect(formatAmountFull(125.5)).toBe("125.5");
});
});

describe("formatInt", () => {
it("formats integers with thousands separators and no decimals", () => {
expect(formatInt(1_234_567)).toBe("1,234,567");
expect(formatInt(42)).toBe("42");
});
});

describe("formatDateShort", () => {
it("formats an ISO date as a short month/day label", () => {
expect(formatDateShort("2026-01-06")).toBe("Jan 6");
});

it("returns the raw input when it is not a valid Y-M-D date", () => {
expect(formatDateShort("not-a-date")).toBe("not-a-date");
});
});
1 change: 1 addition & 0 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const eslintConfig = defineConfig([
".next/**",
"out/**",
"build/**",
"coverage/**",
"next-env.d.ts",
]),
]);
Expand Down
Loading
Loading