Skip to content

Commit 87275e4

Browse files
authored
chore(test): fix web unit test flake (#2377)
1 parent 82e4dd9 commit 87275e4

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

web/src/components/wizard/tests/ValidationStep.test.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('ValidationStep', () => {
7070
// Wait for preflights to complete and show failures
7171
await waitFor(() => {
7272
expect(screen.getByText('Host Requirements Not Met')).toBeInTheDocument();
73-
});
73+
}, { timeout: 2000 });
7474

7575
// Button should be enabled when CLI flag allows ignoring failures
7676
const nextButton = screen.getByText('Next: Start Installation');
@@ -294,10 +294,10 @@ describe('ValidationStep', () => {
294294
// Mock infra setup endpoint to capture request body
295295
http.post('*/api/linux/install/infra/setup', async ({ request }) => {
296296
const body = await request.json();
297-
297+
298298
// Verify the request includes ignoreHostPreflights parameter
299299
expect(body).toHaveProperty('ignoreHostPreflights', true);
300-
300+
301301
return HttpResponse.json({ success: true });
302302
})
303303
);
@@ -348,10 +348,10 @@ describe('ValidationStep', () => {
348348
// Mock infra setup endpoint to capture request body
349349
http.post('*/api/linux/install/infra/setup', async ({ request }) => {
350350
const body = await request.json();
351-
351+
352352
// Verify the request includes ignoreHostPreflights parameter as false
353353
expect(body).toHaveProperty('ignoreHostPreflights', false);
354-
354+
355355
return HttpResponse.json({ success: true });
356356
})
357357
);
@@ -404,9 +404,9 @@ describe('ValidationStep - Error Handling & Edge Cases', () => {
404404
// Mock infra setup endpoint to return API error
405405
http.post('*/api/linux/install/infra/setup', () => {
406406
return HttpResponse.json(
407-
{
407+
{
408408
statusCode: 400,
409-
message: 'Preflight checks failed. Cannot proceed with installation.'
409+
message: 'Preflight checks failed. Cannot proceed with installation.'
410410
},
411411
{ status: 400 }
412412
);
@@ -441,7 +441,7 @@ describe('ValidationStep - Error Handling & Edge Cases', () => {
441441
server.use(
442442
http.get('*/api/linux/install/host-preflights/status', () => {
443443
return HttpResponse.json({
444-
titles: ['Host Check'],
444+
titles: ['Host Check'],
445445
status: { state: 'Succeeded' },
446446
output: { fail: [], warn: [], pass: [{ title: 'Test', message: 'Pass' }] },
447447
allowIgnoreHostPreflights: false
@@ -534,9 +534,9 @@ describe('ValidationStep - Error Handling & Edge Cases', () => {
534534
// Mock infra setup endpoint to return CLI flag error
535535
http.post('*/api/linux/install/infra/setup', () => {
536536
return HttpResponse.json(
537-
{
537+
{
538538
statusCode: 400,
539-
message: 'preflight checks failed'
539+
message: 'preflight checks failed'
540540
},
541541
{ status: 400 }
542542
);
@@ -680,4 +680,4 @@ describe('ValidationStep - Error Handling & Edge Cases', () => {
680680
// Button should still be available for another attempt
681681
expect(screen.getByText('Next: Start Installation')).toBeInTheDocument();
682682
});
683-
});
683+
});

0 commit comments

Comments
 (0)