fix: resolve frontend audit findings
Frontend security / security (push) Successful in 10s
Frontend verify / verify (push) Successful in 4m57s
Conventional commits / commits (pull_request) Successful in 28s
Frontend security / security (pull_request) Successful in 10s
Frontend verify / verify (pull_request) Successful in 5m10s
Frontend security / security (push) Successful in 10s
Frontend verify / verify (push) Successful in 4m57s
Conventional commits / commits (pull_request) Successful in 28s
Frontend security / security (pull_request) Successful in 10s
Frontend verify / verify (pull_request) Successful in 5m10s
Repair investment recovery, draft preservation, date validation, currency presentation, accessibility, and route error recovery. Correct Docker and dependency checks and consume explicit income roles.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { afterEach, expect, it, vi } from "vitest";
|
||||
import { bankPeriod } from "./period";
|
||||
|
||||
afterEach(() => vi.useRealTimers());
|
||||
|
||||
it.each([
|
||||
["0001-01", "0001-01-01", "0001-01-31"],
|
||||
["0099-12", "0099-12-01", "0099-12-31"],
|
||||
["2026-09", "2026-09-01", "2026-09-30"],
|
||||
["2024-02", "2024-02-01", "2024-02-29"],
|
||||
["0004-02", "0004-02-01", "0004-02-29"],
|
||||
])("keeps the ISO year for legacy month %s", (month, from, to) => {
|
||||
expect(bankPeriod(new URLSearchParams({ month }))).toEqual({ from, to });
|
||||
});
|
||||
|
||||
it("rejects zero year consistently in legacy and explicit periods", () => {
|
||||
vi.useFakeTimers();
|
||||
vi.setSystemTime(new Date("2026-09-27T10:00:00Z"));
|
||||
for (const query of ["month=0000-01", "from=0000-01-01&to=0000-01-31"]) {
|
||||
expect(bankPeriod(new URLSearchParams(query))).toEqual({
|
||||
from: "2026-09-01",
|
||||
to: "2026-09-30",
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user