refactor(web): extract ResourcesClient types + inline components, fix test TS errors

Extract types.ts, FilterDropdown.tsx, BooleanBadge.tsx from
ResourcesClient.tsx into resource-client/ subdirectory.
ResourcesClient reduced from 1,613 to 1,507 lines.

Fix TypeScript strict mode errors across 8 test files:
- Add id/order to BlueprintFieldDefinition test objects
- Use FieldType enum instead of string literals in useFilters
- Add non-null assertions for mock.calls array access
- Type ScrollDiv for jsdom scrollLeft workaround
- Fix exactOptionalPropertyTypes violations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-10 22:40:24 +02:00
parent dcac9952ca
commit d3f721ce58
13 changed files with 217 additions and 162 deletions
@@ -1,7 +1,7 @@
import { describe, expect, it, vi, beforeEach, afterEach } from "vitest";
import { render, screen } from "~/test-utils.js";
import userEvent from "@testing-library/user-event";
import type { ErrorInfo } from "react";
import React, { type ErrorInfo } from "react";
import { ErrorBoundary, DefaultErrorFallback } from "./ErrorBoundary.js";
// Suppress React's console.error output during error boundary tests
@@ -16,7 +16,7 @@ afterEach(() => {
});
// A component that unconditionally throws
function ThrowingChild({ message = "Test error" }: { message?: string }) {
function ThrowingChild({ message = "Test error" }: { message?: string }): React.ReactNode {
throw new Error(message);
}
@@ -131,7 +131,7 @@ describe("ErrorBoundary", () => {
});
it("shows a generic message when error.message is empty", () => {
function ThrowEmptyMessage() {
function ThrowEmptyMessage(): React.ReactNode {
const e = new Error("");
throw e;
}
@@ -88,7 +88,9 @@ describe("ShimmerSkeleton", () => {
});
describe("rounded prop", () => {
const roundedCases: Array<[React.ComponentProps<typeof ShimmerSkeleton>["rounded"], string]> = [
const roundedCases: Array<
[NonNullable<React.ComponentProps<typeof ShimmerSkeleton>["rounded"]>, string]
> = [
["sm", "rounded-sm"],
["md", "rounded-md"],
["lg", "rounded-lg"],