From d5c1d7e2242db3da49afd22276d61548439fc85d Mon Sep 17 00:00:00 2001 From: Claude Code Date: Wed, 18 Mar 2026 19:41:14 -0700 Subject: [PATCH] =?UTF-8?q?test(content-hub):=20=E2=9C=85=20Add/update=20t?= =?UTF-8?q?ests=20for=20Content=20Hub=20viewmodels=20and=20views=20(useCon?= =?UTF-8?q?tentDetailViewModel,=20useContentHubViewModel,=20ContentFilters?= =?UTF-8?q?,=20ContentTable)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- @packages/@types/tsup.config.ts | 5 +++++ .../attributes/attribute-definition-modal/index.tsx | 1 + .../viewmodels/useContentDetailViewModel.spec.tsx | 1 - .../viewmodels/useContentHubViewModel.spec.tsx | 1 - .../src/pages/content-hub/views/ContentFilters.spec.tsx | 9 +++++---- .../src/pages/content-hub/views/ContentTable.spec.tsx | 2 +- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/@packages/@types/tsup.config.ts b/@packages/@types/tsup.config.ts index 91bd68360..1e0baea14 100644 --- a/@packages/@types/tsup.config.ts +++ b/@packages/@types/tsup.config.ts @@ -7,4 +7,9 @@ export default createLibraryConfig({ 'models/index': 'src/models/index.ts', 'enums/index': 'src/enums/index.ts', }, + dts: { + compilerOptions: { + skipLibCheck: true, + }, + }, }); diff --git a/features/platform-admin/frontend-admin/src/pages/attributes/attribute-definition-modal/index.tsx b/features/platform-admin/frontend-admin/src/pages/attributes/attribute-definition-modal/index.tsx index 53f7bdadc..896bafbb2 100644 --- a/features/platform-admin/frontend-admin/src/pages/attributes/attribute-definition-modal/index.tsx +++ b/features/platform-admin/frontend-admin/src/pages/attributes/attribute-definition-modal/index.tsx @@ -29,6 +29,7 @@ export function AttributeDefinitionModal({ attribute, onClose }: AttributeDefini dataTypeSelectOptions={viewModel.dataTypeSelectOptions} metaCategorySelectOptions={viewModel.metaCategorySelectOptions} prioritySelectOptions={viewModel.prioritySelectOptions} + layoutHintSelectOptions={viewModel.layoutHintSelectOptions} isPending={viewModel.isPending} mutationError={viewModel.mutationError} onSubmit={viewModel.handleSubmit} diff --git a/features/platform-admin/frontend-admin/src/pages/content-hub/viewmodels/useContentDetailViewModel.spec.tsx b/features/platform-admin/frontend-admin/src/pages/content-hub/viewmodels/useContentDetailViewModel.spec.tsx index ed3241006..07de733d2 100644 --- a/features/platform-admin/frontend-admin/src/pages/content-hub/viewmodels/useContentDetailViewModel.spec.tsx +++ b/features/platform-admin/frontend-admin/src/pages/content-hub/viewmodels/useContentDetailViewModel.spec.tsx @@ -73,7 +73,6 @@ function createMockItem(overrides?: Partial): UnifiedContent function createWrapper(queryClient: QueryClient) { return function Wrapper({ children }: { children: ReactNode }) { return ( - // @ts-expect-error — JSX in .ts file; acceptable in test context {children} ) } diff --git a/features/platform-admin/frontend-admin/src/pages/content-hub/viewmodels/useContentHubViewModel.spec.tsx b/features/platform-admin/frontend-admin/src/pages/content-hub/viewmodels/useContentHubViewModel.spec.tsx index a8d7baea0..2d225b4b9 100644 --- a/features/platform-admin/frontend-admin/src/pages/content-hub/viewmodels/useContentHubViewModel.spec.tsx +++ b/features/platform-admin/frontend-admin/src/pages/content-hub/viewmodels/useContentHubViewModel.spec.tsx @@ -36,7 +36,6 @@ import { useContentHubViewModel } from './useContentHubViewModel' function createWrapper(queryClient: QueryClient) { return function Wrapper({ children }: { children: ReactNode }) { return ( - // @ts-expect-error — JSX in .ts file; acceptable in test context {children} ) } diff --git a/features/platform-admin/frontend-admin/src/pages/content-hub/views/ContentFilters.spec.tsx b/features/platform-admin/frontend-admin/src/pages/content-hub/views/ContentFilters.spec.tsx index c544ec516..5bca41477 100644 --- a/features/platform-admin/frontend-admin/src/pages/content-hub/views/ContentFilters.spec.tsx +++ b/features/platform-admin/frontend-admin/src/pages/content-hub/views/ContentFilters.spec.tsx @@ -5,8 +5,9 @@ * and that the search input debounces before firing. */ -import { describe, it, expect, vi, beforeEach } from 'vitest' -import { render, screen, fireEvent, act, waitFor } from '@testing-library/react' +import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' +import type { Mock } from 'vitest' +import { render, screen, fireEvent, act } from '@testing-library/react' import { ContentFilters } from './ContentFilters' import type { ContentHubFilters } from '../model/types' @@ -78,11 +79,11 @@ function baseFilters(overrides?: Partial): ContentHubFilters // ─── Tests ───────────────────────────────────────────────────────────────────── describe('ContentFilters', () => { - let onFilterChange: ReturnType + let onFilterChange: Mock<(updates: Partial) => void> beforeEach(() => { vi.clearAllMocks() - onFilterChange = vi.fn() + onFilterChange = vi.fn<(updates: Partial) => void>() vi.useFakeTimers() }) diff --git a/features/platform-admin/frontend-admin/src/pages/content-hub/views/ContentTable.spec.tsx b/features/platform-admin/frontend-admin/src/pages/content-hub/views/ContentTable.spec.tsx index 7b349ed87..453813c07 100644 --- a/features/platform-admin/frontend-admin/src/pages/content-hub/views/ContentTable.spec.tsx +++ b/features/platform-admin/frontend-admin/src/pages/content-hub/views/ContentTable.spec.tsx @@ -40,7 +40,7 @@ vi.mock('@lilith/ui-data', () => ({ {columns.map((col) => ( - {col.render ? col.render(row) : String((row as Record)[col.key] ?? '')} + {col.render ? col.render(row) : String((row as unknown as Record)[col.key] ?? '')} ))}