refactor: enforce frontend view model boundaries
Frontend verify / commits (pull_request) Successful in 28s
Frontend verify / security (pull_request) Successful in 10s
Frontend verify / verify (pull_request) Successful in 8m19s

This commit is contained in:
2026-09-28 18:48:23 +03:00
parent 5b69003516
commit ca0ad4f824
287 changed files with 8558 additions and 4538 deletions
+6 -1
View File
@@ -3,7 +3,12 @@ import { expect, it } from "vitest";
import { ApiErrorCode, apiErrorCode, isApiErrorCode } from "./problem-details";
it("matches known codes and preserves unknown wire codes for fallback handling", () => {
expect(isApiErrorCode(apiErrorCode({ code: "UNAUTHORIZED" }), ApiErrorCode.Unauthorized)).toBe(true);
expect(
isApiErrorCode(
apiErrorCode({ code: "UNAUTHORIZED" }),
ApiErrorCode.Unauthorized,
),
).toBe(true);
const unknownCode = apiErrorCode({ code: "FUTURE_PROVIDER_ERROR" });
expect(unknownCode).toBe("FUTURE_PROVIDER_ERROR");
expect(isApiErrorCode(unknownCode, ApiErrorCode.Unauthorized)).toBe(false);