Skip to content

Commit 443b69d

Browse files
Copilothotlong
andcommitted
Fix CI build and test errors: unused imports, type incompatibilities, missing mock exports
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 400210f commit 443b69d

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed

apps/console/src/__tests__/DashboardViewSelection.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ vi.mock('sonner', () => ({
132132

133133
// Mock Radix Dialog portal to render inline for testing
134134
vi.mock('@radix-ui/react-dialog', async () => {
135-
const actual = await vi.importActual<typeof import('@radix-ui/react-dialog')>('@radix-ui/react-dialog');
135+
const actual = await vi.importActual('@radix-ui/react-dialog');
136136
return {
137-
...actual,
137+
...(actual as Record<string, unknown>),
138138
Portal: ({ children }: { children: React.ReactNode }) => <>{children}</>,
139139
};
140140
});

apps/console/src/__tests__/DesignDrawer.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ vi.mock('sonner', () => ({
8282

8383
// Mock Radix Dialog portal to render inline for testing
8484
vi.mock('@radix-ui/react-dialog', async () => {
85-
const actual = await vi.importActual<typeof import('@radix-ui/react-dialog')>('@radix-ui/react-dialog');
85+
const actual = await vi.importActual('@radix-ui/react-dialog');
8686
return {
87-
...actual,
87+
...(actual as Record<string, unknown>),
8888
Portal: ({ children }: { children: React.ReactNode }) => <>{children}</>,
8989
};
9090
});
@@ -189,7 +189,7 @@ describe('DesignDrawer — Right-Side Editor Panel', () => {
189189
});
190190

191191
it('should not navigate away when edit button is clicked', () => {
192-
const { container } = renderPageView();
192+
renderPageView();
193193

194194
fireEvent.click(screen.getByTestId('page-edit-button'));
195195

apps/console/src/components/DesignDrawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* main workspace remains visible while the user edits.
77
*/
88

9-
import { useState, useCallback, useEffect, useRef } from 'react';
9+
import { useCallback, useEffect, useRef } from 'react';
1010
import {
1111
Sheet,
1212
SheetContent,

packages/plugin-aggrid/src/AgGridImpl.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import React, { useMemo, useRef, useCallback } from 'react';
1010
import { AgGridReact } from 'ag-grid-react';
11-
import type { ColDef, GridOptions, GridReadyEvent, CellClickedEvent, RowClickedEvent, SelectionChangedEvent, CellValueChangedEvent, StatusPanelDef, GetContextMenuItemsParams, MenuItemDef } from 'ag-grid-community';
11+
import type { ColDef, GridOptions, GridReadyEvent, CellClickedEvent, RowClickedEvent, SelectionChangedEvent, CellValueChangedEvent, StatusPanelDef, GetContextMenuItemsParams, MenuItemDef, DefaultMenuItem } from 'ag-grid-community';
1212
import type { AgGridCallbacks, ExportConfig, StatusBarConfig, ColumnConfig, ContextMenuConfig, TreeDataConfig, RowGroupingConfig, ExcelExportConfig } from './types';
1313

1414
export interface AgGridImplProps {
@@ -145,10 +145,10 @@ export default function AgGridImpl({
145145
}, [excelExport, exportConfig, callbacks, rowData]);
146146

147147
// Context Menu handler
148-
const getContextMenuItems = useCallback((params: GetContextMenuItemsParams): (string | MenuItemDef)[] => {
148+
const getContextMenuItems = useCallback((params: GetContextMenuItemsParams): (DefaultMenuItem | MenuItemDef)[] => {
149149
if (!contextMenu?.enabled) return [];
150150

151-
const items: (string | MenuItemDef)[] = [];
151+
const items: (DefaultMenuItem | MenuItemDef)[] = [];
152152
const defaultItems = contextMenu.items || ['copy', 'copyWithHeaders', 'separator', 'export'];
153153

154154
defaultItems.forEach(item => {
@@ -183,7 +183,7 @@ export default function AgGridImpl({
183183
},
184184
});
185185
} else {
186-
items.push(item);
186+
items.push(item as DefaultMenuItem);
187187
}
188188
});
189189

packages/plugin-list/src/__tests__/ListViewGroupingPropagation.test.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,15 @@ vi.mock('@object-ui/mobile', () => ({
5151
usePullToRefresh: () => ({ pullRef: { current: null } }),
5252
}));
5353

54-
vi.mock('@object-ui/core', () => ({
55-
ExpressionEvaluator: {
56-
evaluate: vi.fn((expr: string) => expr),
57-
},
58-
}));
54+
vi.mock('@object-ui/core', async (importOriginal) => {
55+
const actual = await importOriginal<Record<string, unknown>>();
56+
return {
57+
...actual,
58+
ExpressionEvaluator: {
59+
evaluate: vi.fn((expr: string) => expr),
60+
},
61+
};
62+
});
5963

6064
vi.mock('@object-ui/i18n', () => ({
6165
useObjectTranslation: () => ({

0 commit comments

Comments
 (0)