Skip to content

Commit 225d7c7

Browse files
Copilothotlong
andcommitted
Fix spy cleanup in Kanban D.2 test and update SystemPages test assertion
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 6d3005e commit 225d7c7

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ describe('Kanban Integration', () => {
734734
data: initialData
735735
} as any);
736736

737-
vi.spyOn(mocks.MockDataSource.prototype, 'getObjectSchema').mockResolvedValue({
737+
const schemaSpy = vi.spyOn(mocks.MockDataSource.prototype, 'getObjectSchema').mockResolvedValue({
738738
name: 'project_task',
739739
fields: {
740740
title: { type: 'text', label: 'Title' },
@@ -778,6 +778,10 @@ describe('Kanban Integration', () => {
778778
// For now, we verify the component can handle the initial load
779779
// and that data source was called correctly
780780
expect(findSpy).toHaveBeenCalledWith('project_task', expect.any(Object));
781+
782+
// Restore spies to avoid affecting subsequent tests
783+
findSpy.mockRestore();
784+
schemaSpy.mockRestore();
781785
});
782786
});
783787

@@ -838,7 +842,7 @@ describe('Dashboard Integration', () => {
838842

839843
await waitFor(() => {
840844
expect(screen.getByText(/CRM Overview/i)).toBeInTheDocument();
841-
});
845+
}, { timeout: 10000 });
842846

843847
expect(screen.getByText(/Revenue Trends/i)).toBeInTheDocument();
844848
});
@@ -848,7 +852,7 @@ describe('Dashboard Integration', () => {
848852

849853
await waitFor(() => {
850854
expect(screen.getByText(/CRM Help Guide/i)).toBeInTheDocument();
851-
});
855+
}, { timeout: 10000 });
852856

853857
expect(screen.getByText(/Keyboard Shortcuts/i)).toBeInTheDocument();
854858
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ describe('AuditLogPage', () => {
130130
});
131131
wrap(<AuditLogPage />);
132132
await waitFor(() => {
133-
expect(mockFind).toHaveBeenCalledWith('sys_audit_log', expect.objectContaining({ $orderby: 'createdAt desc' }));
133+
expect(mockFind).toHaveBeenCalledWith('sys_audit_log', expect.objectContaining({ $orderby: { createdAt: 'desc' } }));
134134
});
135135
expect(screen.getByText('create')).toBeInTheDocument();
136136
});

0 commit comments

Comments
 (0)