Skip to content

Commit 5e75eeb

Browse files
committed
Increase timeout values in tests for improved reliability
1 parent ddac7de commit 5e75eeb

File tree

4 files changed

+34
-34
lines changed

4 files changed

+34
-34
lines changed

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('Console Application Simulation', () => {
116116
// Verify content from help_page (part of kitchen sink)
117117
await waitFor(() => {
118118
expect(screen.getByText(/Application Guide/i)).toBeInTheDocument();
119-
});
119+
}, { timeout: 10000 });
120120
expect(screen.getByText(/Welcome to the ObjectStack Console/i)).toBeInTheDocument();
121121
});
122122

@@ -126,7 +126,7 @@ describe('Console Application Simulation', () => {
126126
// Verify Dashboard Title
127127
await waitFor(() => {
128128
expect(screen.getByText(/Sales Overview/i)).toBeInTheDocument();
129-
});
129+
}, { timeout: 10000 });
130130

131131
// Verify Widget Rendering (Bar Chart)
132132
expect(screen.getByText(/Sales by Region/i)).toBeInTheDocument();
@@ -216,7 +216,7 @@ describe('Console Application Simulation', () => {
216216
// Verify Report Title
217217
await waitFor(() => {
218218
expect(screen.getByText(/Sales Performance Report/i)).toBeInTheDocument();
219-
});
219+
}, { timeout: 10000 });
220220

221221
// Verify Description
222222
expect(screen.getByText(/Monthly breakdown of sales/i)).toBeInTheDocument();
@@ -246,7 +246,7 @@ describe('Console Application Simulation', () => {
246246
renderApp('/kitchen_sink');
247247
await waitFor(() => {
248248
expect(screen.getByRole('heading', { name: /Kitchen Sink/i })).toBeInTheDocument();
249-
});
249+
}, { timeout: 10000 });
250250

251251
// Verify the form can be opened (showing metadata was loaded)
252252
const newButton = screen.getByRole('button', { name: /New/i });
@@ -255,7 +255,7 @@ describe('Console Application Simulation', () => {
255255
// Verify form loaded with schema-based fields
256256
await waitFor(() => {
257257
expect(screen.getByRole('dialog')).toBeInTheDocument();
258-
});
258+
}, { timeout: 10000 });
259259

260260
// Form should render based on mocked schema
261261
// The actual field labels might differ based on implementation
@@ -271,7 +271,7 @@ describe('Console Application Simulation', () => {
271271

272272
await waitFor(() => {
273273
expect(screen.getByRole('heading', { name: /Kitchen Sink/i })).toBeInTheDocument();
274-
});
274+
}, { timeout: 10000 });
275275

276276
const newButton = screen.getByRole('button', { name: /New/i });
277277
expect(newButton).toBeInTheDocument();
@@ -290,17 +290,17 @@ describe('Console Application Simulation', () => {
290290

291291
await waitFor(() => {
292292
expect(screen.getByRole('heading', { name: /Kitchen Sink/i })).toBeInTheDocument();
293-
});
293+
}, { timeout: 10000 });
294294

295295
// Verify data source was called to load grid data
296296
await waitFor(() => {
297297
expect(findSpy).toHaveBeenCalledWith('kitchen_sink', expect.any(Object));
298-
});
298+
}, { timeout: 5000 });
299299

300300
// Verify grid displays the loaded data
301301
await waitFor(() => {
302302
expect(screen.getByText('Item 1')).toBeInTheDocument();
303-
});
303+
}, { timeout: 5000 });
304304
expect(screen.getByText('Item 2')).toBeInTheDocument();
305305
});
306306

@@ -378,7 +378,7 @@ describe('Kanban Integration', () => {
378378
// Assert: Prop Mapping - verify schema props are reflected in DOM
379379
await waitFor(() => {
380380
expect(screen.getByText('To Do')).toBeInTheDocument();
381-
});
381+
}, { timeout: 10000 });
382382

383383
// Use getAllByText for "In Progress" since it appears in both header and badge
384384
const inProgressElements = screen.getAllByText('In Progress');
@@ -472,12 +472,12 @@ describe('Kanban Integration', () => {
472472
// Wait: for async metadata fetch and rendering
473473
await waitFor(() => {
474474
expect(screen.getByText('To Do')).toBeInTheDocument();
475-
});
475+
}, { timeout: 10000 });
476476

477477
// Assert: Check that the UI was generated and data appears
478478
await waitFor(() => {
479479
expect(screen.getByText('Task 1')).toBeInTheDocument();
480-
});
480+
}, { timeout: 10000 });
481481

482482
expect(screen.getByText('Task 2')).toBeInTheDocument();
483483
expect(screen.getByText('Task 3')).toBeInTheDocument();
@@ -517,7 +517,7 @@ describe('Kanban Integration', () => {
517517
// Wait for render - should not crash and should show empty state
518518
await waitFor(() => {
519519
expect(screen.getByText('To Do')).toBeInTheDocument();
520-
});
520+
}, { timeout: 10000 });
521521

522522
// Kanban should render without errors, just with empty columns
523523
expect(screen.queryByText('Error')).not.toBeInTheDocument();
@@ -586,7 +586,7 @@ describe('Kanban Integration', () => {
586586
// Assert: Read - seeded data appears in the UI
587587
await waitFor(() => {
588588
expect(screen.getByText('Implement Feature X')).toBeInTheDocument();
589-
});
589+
}, { timeout: 10000 });
590590

591591
expect(screen.getByText('Fix Bug Y')).toBeInTheDocument();
592592
expect(screen.getByText('Review PR Z')).toBeInTheDocument();
@@ -629,7 +629,7 @@ describe('Kanban Integration', () => {
629629
// Wait for cards to render
630630
await waitFor(() => {
631631
expect(screen.getByText('Task Alpha')).toBeInTheDocument();
632-
});
632+
}, { timeout: 10000 });
633633

634634
// Note: Drag & Drop interaction with @dnd-kit in JSDOM is complex
635635
// This test verifies the setup is correct and the callback is wired
@@ -672,7 +672,7 @@ describe('Kanban Integration', () => {
672672
// Wait for rendering
673673
await waitFor(() => {
674674
expect(screen.getByText('Low Priority Task')).toBeInTheDocument();
675-
});
675+
}, { timeout: 10000 });
676676

677677
// All tasks should be visible and grouped by status
678678
expect(screen.getByText('High Priority Task')).toBeInTheDocument();
@@ -733,7 +733,7 @@ describe('Kanban Integration', () => {
733733
// Wait for initial render
734734
await waitFor(() => {
735735
expect(screen.getByText('Open Task')).toBeInTheDocument();
736-
});
736+
}, { timeout: 10000 });
737737

738738
// Verify initial state
739739
expect(screen.getByText('Open Task')).toBeInTheDocument();

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('ObjectKanban Todo Example Display', () => {
6262
// Wait for data to appear
6363
// If logic is wrong, it will look for 'name', find undefined, show 'Untitled'.
6464
// This assertion checks 'Task A' is visible.
65-
await waitFor(() => expect(screen.getByText('Task A')).toBeInTheDocument());
65+
await waitFor(() => expect(screen.getByText('Task A')).toBeInTheDocument(), { timeout: 5000 });
6666

6767
// Verify Column Headers (H3 in real component)
6868
// We expect columns named "1", "2", "3"
@@ -81,7 +81,7 @@ describe('ObjectKanban Todo Example Display', () => {
8181
/>
8282
);
8383

84-
await waitFor(() => expect(mockDataSource.find).toHaveBeenCalled());
84+
await waitFor(() => expect(mockDataSource.find).toHaveBeenCalled(), { timeout: 5000 });
8585

8686
// Should NOT find any generated numerical headings
8787
expect(screen.queryByRole('heading', { name: '1' })).toBeNull();
@@ -105,7 +105,7 @@ describe('ObjectKanban Todo Example Display', () => {
105105
);
106106

107107
// Wait for metadata options to render
108-
await waitFor(() => expect(screen.getByRole('heading', { name: /New/i })).toBeInTheDocument());
108+
await waitFor(() => expect(screen.getByRole('heading', { name: /New/i })).toBeInTheDocument(), { timeout: 5000 });
109109
expect(screen.getByRole('heading', { name: /Done/i })).toBeInTheDocument();
110110
});
111111

@@ -129,7 +129,7 @@ describe('ObjectKanban Todo Example Display', () => {
129129
/>
130130
);
131131

132-
await waitFor(() => expect(screen.getByRole('heading', { name: 'High (1)' })).toBeInTheDocument());
132+
await waitFor(() => expect(screen.getByRole('heading', { name: 'High (1)' })).toBeInTheDocument(), { timeout: 5000 });
133133

134134
// We should see the 3 explicit columns
135135
expect(screen.getByRole('heading', { name: 'Medium (2)' })).toBeInTheDocument();

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('ObjectForm with MSW Integration', () => {
9191
// Wait for form to load
9292
await waitFor(() => {
9393
expect(screen.getByLabelText(/^Name/i)).toBeInTheDocument();
94-
});
94+
}, { timeout: 5000 });
9595

9696
expect(screen.getByLabelText(/Email/i)).toBeInTheDocument();
9797
expect(screen.getByLabelText(/^Phone/i)).toBeInTheDocument();
@@ -122,7 +122,7 @@ describe('ObjectForm with MSW Integration', () => {
122122
// Wait for form to load
123123
await waitFor(() => {
124124
expect(screen.getByLabelText(/^Name/i)).toBeInTheDocument();
125-
});
125+
}, { timeout: 5000 });
126126

127127
// Fill in the form
128128
await user.type(screen.getByLabelText(/^Name/i), 'Test User');
@@ -137,7 +137,7 @@ describe('ObjectForm with MSW Integration', () => {
137137
// Wait for success callback
138138
await waitFor(() => {
139139
expect(onSuccess).toHaveBeenCalled();
140-
});
140+
}, { timeout: 5000 });
141141

142142
const createdContact = onSuccess.mock.calls[0][0];
143143
expect(createdContact.name).toBe('Test User');
@@ -165,7 +165,7 @@ describe('ObjectForm with MSW Integration', () => {
165165

166166
await waitFor(() => {
167167
expect(screen.getByLabelText(/^Name/i)).toBeInTheDocument();
168-
});
168+
}, { timeout: 5000 });
169169

170170
// Try to submit without filling required fields
171171
const submitButton = screen.getByRole('button', { name: /create/i });
@@ -196,7 +196,7 @@ describe('ObjectForm with MSW Integration', () => {
196196

197197
await waitFor(() => {
198198
expect(screen.getByLabelText(/^Name/i)).toBeInTheDocument();
199-
});
199+
}, { timeout: 5000 });
200200

201201
// Fill required fields only
202202
await user.type(screen.getByLabelText(/^Name/i), 'Default Test');
@@ -207,7 +207,7 @@ describe('ObjectForm with MSW Integration', () => {
207207

208208
await waitFor(() => {
209209
expect(onSuccess).toHaveBeenCalled();
210-
});
210+
}, { timeout: 5000 });
211211

212212
const createdContact = onSuccess.mock.calls[0][0];
213213
// Check default values from schema
@@ -235,7 +235,7 @@ describe('ObjectForm with MSW Integration', () => {
235235
await waitFor(() => {
236236
const nameInput = screen.getByLabelText(/^Name/i) as HTMLInputElement;
237237
expect(nameInput.value).toBe('Alice Johnson');
238-
});
238+
}, { timeout: 5000 });
239239

240240
const emailInput = screen.getByLabelText(/Email/i) as HTMLInputElement;
241241
expect(emailInput.value).toBe('alice@objectstack.com');
@@ -266,7 +266,7 @@ describe('ObjectForm with MSW Integration', () => {
266266
await waitFor(() => {
267267
const nameInput = screen.getByLabelText(/^Name/i) as HTMLInputElement;
268268
expect(nameInput.value).toBe('Alice Johnson');
269-
});
269+
}, { timeout: 5000 });
270270

271271
// Update the name
272272
const nameInput = screen.getByLabelText(/^Name/i);
@@ -278,7 +278,7 @@ describe('ObjectForm with MSW Integration', () => {
278278

279279
await waitFor(() => {
280280
expect(onSuccess).toHaveBeenCalled();
281-
});
281+
}, { timeout: 5000 });
282282

283283
const updatedContact = onSuccess.mock.calls[0][0];
284284
expect(updatedContact.name).toBe('Alice Johnson Updated');

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('Plugins Integration Test', () => {
104104
// ObjectCalendar renders events. If generic implementation works, we should see 'Task 1'
105105
await waitFor(() => {
106106
expect(screen.getByText('Task 1')).toBeInTheDocument();
107-
});
107+
}, { timeout: 5000 });
108108
expect(screen.getByText('Task 2')).toBeInTheDocument();
109109
});
110110

@@ -126,7 +126,7 @@ describe('Plugins Integration Test', () => {
126126
// Wait for initial fetch
127127
await waitFor(() => {
128128
expect(mockDataSource.find).toHaveBeenCalledTimes(1);
129-
});
129+
}, { timeout: 5000 });
130130

131131
// Re-render with a NEW schema object but IDENTICAL content
132132
// This tests if useMemo/useEffect are correctly handling deep equality or specific property dependencies
@@ -162,12 +162,12 @@ describe('Plugins Integration Test', () => {
162162
// Wait for schema fetch and rendering
163163
await waitFor(() => {
164164
expect(mockDataSource.getObjectSchema).toHaveBeenCalledWith('todo_task');
165-
});
165+
}, { timeout: 5000 });
166166

167167
// Expect columns to be generated from schema options
168168
await waitFor(() => {
169169
expect(screen.getByText('Not Started')).toBeInTheDocument();
170-
});
170+
}, { timeout: 5000 });
171171
expect(screen.getByText('In Progress')).toBeInTheDocument();
172172
expect(screen.getByText('Done')).toBeInTheDocument();
173173

0 commit comments

Comments
 (0)