mirror of
https://github.com/taylanbakircioglu/haproxy-openmanager.git
synced 2026-09-12 05:48:58 +00:00
test(acme): make the wizard regression suite pass under the default jest timeout
Follow-up to #57. The contributed tests render the whole ACMEAutomation tree (antd Steps + Form + Select) and drive it through all three wizard steps, which takes 4-9 seconds per test. Under jest's default 5s per-test limit two of them failed, so `npm test` did not pass as shipped: ✕ an explicitly picked HTTP-01 account survives the step change and is what gets submitted -> Exceeded timeout of 5000 ms ✕ the wildcard guard still applies on the Review step, where Submit lives -> Exceeded timeout of 5000 ms The PR's reported 5/5 holds only when the runner is invoked with an explicit --testTimeout. Setting it in the file instead means the suite passes however it is invoked, which matters because the frontend image build runs `npm run build` and never the tests, so nothing else would have caught this. Verified with the default runner (no flags) after the change: 5/5 pass. Test-only. No production code touched.
This commit is contained in:
@@ -13,6 +13,11 @@ import { render, screen, fireEvent, waitFor, act } from '@testing-library/react'
|
||||
import axios from 'axios';
|
||||
import ACMEAutomation from '../ACMEAutomation';
|
||||
|
||||
// These render the whole ACMEAutomation tree (antd Steps + Form + Select) three times per test and
|
||||
// take 4-7s each, so jest's default 5s per-test limit fails two of them. Raise it here rather than
|
||||
// relying on the runner being invoked with --testTimeout, so `npm test` passes as shipped.
|
||||
jest.setTimeout(30000);
|
||||
|
||||
jest.mock('axios');
|
||||
jest.mock('react-router-dom', () => ({ useNavigate: () => jest.fn() }));
|
||||
jest.mock('../../contexts/ClusterContext', () => ({
|
||||
|
||||
Reference in New Issue
Block a user