Skip to content

Commit 1ecb80b

Browse files
authored
Merge pull request #1292 from objectstack-ai/claude/fix-ci-test-errors
2 parents f4abb4f + b7e5462 commit 1ecb80b

2 files changed

Lines changed: 84 additions & 1 deletion

File tree

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

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,89 @@ vi.mock('@object-ui/auth', () => ({
115115
createAuthenticatedFetch: () => (input: RequestInfo | URL, init?: RequestInit) => fetch(input as any, init),
116116
}));
117117

118+
// Mock permissions
119+
vi.mock('@object-ui/permissions', () => ({
120+
usePermissions: () => ({
121+
can: () => true,
122+
}),
123+
}));
124+
125+
// Mock i18n
126+
vi.mock('@object-ui/i18n', () => ({
127+
useObjectTranslation: () => (key: string) => key,
128+
useObjectLabel: () => (objectName: string) => objectName,
129+
}));
130+
131+
// Mock collaboration
132+
vi.mock('@object-ui/collaboration', () => ({
133+
useRealtimeSubscription: () => ({}),
134+
useConflictResolution: () => ({
135+
resolveConflict: vi.fn(),
136+
}),
137+
}));
138+
139+
// Mock react utilities
140+
vi.mock('@object-ui/react', async (importOriginal) => {
141+
const actual = await importOriginal<any>();
142+
const React = await import('react');
143+
return {
144+
...actual,
145+
ActionProvider: ({ children }: any) => <>{children}</>,
146+
useNavigationOverlay: () => ({
147+
open: false,
148+
close: vi.fn(),
149+
setContent: vi.fn(),
150+
}),
151+
};
152+
});
153+
154+
// Mock sonner toast
155+
vi.mock('sonner', () => ({
156+
toast: {
157+
success: vi.fn(),
158+
error: vi.fn(),
159+
warning: vi.fn(),
160+
info: vi.fn(),
161+
},
162+
}));
163+
164+
// Mock plugin-detail
165+
vi.mock('@object-ui/plugin-detail', () => ({
166+
DetailView: ({ schema }: any) => <div data-testid="detail-view">{schema.objectName}</div>,
167+
RecordChatterPanel: () => <div data-testid="record-chatter-panel">Chatter</div>,
168+
}));
169+
170+
// Mock plugin-view components
171+
vi.mock('@object-ui/plugin-view', async (importOriginal) => {
172+
const actual = await importOriginal<any>();
173+
return {
174+
...actual,
175+
ManageViewsDialog: ({ open }: any) => open ? <div data-testid="manage-views-dialog">Manage Views</div> : null,
176+
};
177+
});
178+
179+
// Mock plugin-charts
180+
vi.mock('@object-ui/plugin-charts', () => ({
181+
ObjectChart: ({ schema }: any) => <div data-testid="object-chart">Chart: {schema.objectName}</div>,
182+
}));
183+
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+
118201
describe('ObjectView Component', () => {
119202

120203
beforeEach(() => {

public/mockServiceWorker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* - Please do NOT modify this file.
88
*/
99

10-
const PACKAGE_VERSION = '2.13.4'
10+
const PACKAGE_VERSION = '2.14.3'
1111
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
1212
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
1313
const activeClientIds = new Set()

0 commit comments

Comments
 (0)