Skip to content

Commit c8dd773

Browse files
Copilothotlong
andcommitted
fix: resolve TypeScript build error and test failures
- Fix TypeScript error in apps/console/src/mocks/server.ts by using correct QueryInput structure (where instead of filters) - Fix test failure in plugin-timeline by removing duplicate @testing-library/jest-dom import - Add proper vitest configuration to plugin-timeline for test environment setup Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 4950a54 commit c8dd773

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

apps/console/src/mocks/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ function createHandlers(baseUrl: string, kernel: ObjectKernel, driver: InMemoryD
164164
// Use driver directly
165165
// Try simple find first
166166
const records = await driver.find(params.objectName as string, {
167-
filters: [['_id', '=', params.id]]
167+
object: params.objectName as string,
168+
where: ['_id', '=', params.id]
168169
});
169170
// Manual filter to ensure we get the correct record if driver ignores filters
170171
const record = records ? records.find((r: any) => r.id === params.id || r._id === params.id) : null;

packages/plugin-timeline/src/ObjectTimeline.msw.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { describe, it, expect, beforeAll, afterAll, afterEach } from 'vitest';
22
import { render, screen, waitFor } from '@testing-library/react';
3-
import '@testing-library/jest-dom';
43
import { ObjectTimeline } from './ObjectTimeline';
54
import { ObjectStackAdapter } from '@object-ui/data-objectstack';
65
import { setupServer } from 'msw/node';

packages/plugin-timeline/vite.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ export default defineConfig({
4646
},
4747
},
4848
test: {
49+
globals: true,
50+
environment: 'happy-dom',
51+
setupFiles: ['../../vitest.setup.ts'],
4952
passWithNoTests: true,
5053
},
5154
});

0 commit comments

Comments
 (0)