* refactor: move lighthouse audits to dataforseo (#43) * refactor: move lighthouse audits to dataforseo * chore: remove obsolete audit settings modal * refactor: rename psi flows to lighthouse * save * refactor: simplify audit lighthouse storage flow * fix: separate lighthouse metrics from actionable audits * refactor: remove redundant audit project inputs * feat: redesign lighthouse issues screen with score gauges and table layout Replace flat score cards with circular SVG gauges, condense metrics into a compact grid, and switch issue list from cards to an expandable table with fixed column widths. * test: harden lighthouse regression coverage * fix: restore project-scoped audit inputs * refactor: simplify lighthouse payload handling * refactor: inline lighthouse server handlers * refactor: share audit workflow types * refactor: simplify lighthouse payload flows * save * refactor: drop project pagespeed api key * fix: restore lighthouse issues loading with resilient project context * fix: restore audit issues back navigation * refactor: simplify project context and lighthouse error handling * fix: tolerate DataForSEO lighthouse payload drift * refactor: route audit lighthouse through dataforseo client --------- * refactor: unify app forms with TanStack Form Replace bespoke field and submit error state so validation, async submit handling, and router-synced inputs behave consistently across the app. * fix: remove dead code from ci check * fix: delay required form errors until input interaction * fix: preserve detailed DataForSEO error messages * fix: sanitize internal errors and delay domain validation --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22 lines
629 B
TypeScript
22 lines
629 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { AppError, toClientError } from "@/server/lib/errors";
|
|
|
|
describe("toClientError", () => {
|
|
it("sanitizes detailed internal error messages", () => {
|
|
const error = toClientError(
|
|
new AppError(
|
|
"INTERNAL_ERROR",
|
|
"DataForSEO task missing billing metadata (path: Invalid input). Response: {...}",
|
|
),
|
|
);
|
|
|
|
expect(error.message).toBe("INTERNAL_ERROR");
|
|
});
|
|
|
|
it("keeps public error codes unchanged", () => {
|
|
const error = toClientError(new AppError("PAYMENT_REQUIRED"));
|
|
|
|
expect(error.message).toBe("PAYMENT_REQUIRED");
|
|
});
|
|
});
|