Commit 805f5324 authored by Paul Slaughter's avatar Paul Slaughter

Fix init_create_cluster_spec timing out

**How?**
There's a dynamic loading in the test subject.
This causes the first spec to timeout past the
500ms threshold.

By eagerly loading this module in the spec file, the
module load time is no longer accounted for in
the spec time.
parent 264efb4d
......@@ -3,6 +3,11 @@ import initGkeDropdowns from '~/create_cluster/gke_cluster';
import initGkeNamespace from '~/create_cluster/gke_cluster_namespace';
import PersistentUserCallout from '~/persistent_user_callout';
// This import is loaded dynamically in `init_create_cluster`.
// Let's eager import it here so that the first spec doesn't timeout.
// https://gitlab.com/gitlab-org/gitlab/issues/118499
import '~/create_cluster/eks_cluster';
jest.mock('~/create_cluster/gke_cluster', () => jest.fn());
jest.mock('~/create_cluster/gke_cluster_namespace', () => jest.fn());
jest.mock('~/persistent_user_callout', () => ({
......@@ -20,10 +25,9 @@ describe('initCreateCluster', () => {
};
gon = { features: {} };
});
afterEach(() => {
initGkeDropdowns.mockReset();
initGkeNamespace.mockReset();
PersistentUserCallout.factory.mockReset();
jest.clearAllMocks();
});
describe.each`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment