Skip to content

Commit b7e5462

Browse files
Claudehotlong
andauthored
Add useObjectActions mock to fix test dependencies
Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/23ab3978-7929-4b85-b02e-69193aa3ff88 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 8ac2266 commit b7e5462

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

apps/console/dev/__tests__/ObjectView.test.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,23 @@ vi.mock('@object-ui/plugin-charts', () => ({
181181
ObjectChart: ({ schema }: any) => <div data-testid="object-chart">Chart: {schema.objectName}</div>,
182182
}));
183183

184+
// Mock app-shell hooks
185+
vi.mock('@object-ui/app-shell', async (importOriginal) => {
186+
const actual = await importOriginal<any>();
187+
return {
188+
...actual,
189+
useObjectActions: () => ({
190+
execute: vi.fn(),
191+
create: vi.fn(),
192+
deleteRecord: vi.fn(),
193+
navigateToView: vi.fn(),
194+
navigateToRecord: vi.fn(),
195+
loading: false,
196+
error: null,
197+
}),
198+
};
199+
});
200+
184201
describe('ObjectView Component', () => {
185202

186203
beforeEach(() => {

0 commit comments

Comments
 (0)