diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /spec/frontend/clusters/clusters_bundle_spec.js | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/frontend/clusters/clusters_bundle_spec.js')
-rw-r--r-- | spec/frontend/clusters/clusters_bundle_spec.js | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/spec/frontend/clusters/clusters_bundle_spec.js b/spec/frontend/clusters/clusters_bundle_spec.js index b5345ea8915..ad2aa4acbaf 100644 --- a/spec/frontend/clusters/clusters_bundle_spec.js +++ b/spec/frontend/clusters/clusters_bundle_spec.js @@ -1,7 +1,6 @@ import MockAdapter from 'axios-mock-adapter'; import { loadHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import { useMockLocationHelper } from 'helpers/mock_window_location_helper'; -import { setTestTimeout } from 'helpers/timeout'; import Clusters from '~/clusters/clusters_bundle'; import axios from '~/lib/utils/axios_utils'; import initProjectSelectDropdown from '~/project_select'; @@ -12,8 +11,6 @@ jest.mock('~/project_select'); useMockLocationHelper(); describe('Clusters', () => { - setTestTimeout(1000); - let cluster; let mock; @@ -60,9 +57,9 @@ describe('Clusters', () => { it('should show the creating container', () => { cluster.updateContainer(null, 'creating'); - expect(cluster.creatingContainer.classList.contains('hidden')).toBeFalsy(); - expect(cluster.successContainer.classList.contains('hidden')).toBeTruthy(); - expect(cluster.errorContainer.classList.contains('hidden')).toBeTruthy(); + expect(cluster.creatingContainer.classList.contains('hidden')).toBe(false); + expect(cluster.successContainer.classList.contains('hidden')).toBe(true); + expect(cluster.errorContainer.classList.contains('hidden')).toBe(true); expect(window.location.reload).not.toHaveBeenCalled(); }); @@ -70,9 +67,9 @@ describe('Clusters', () => { cluster.updateContainer(null, 'creating'); cluster.updateContainer('creating', 'creating'); - expect(cluster.creatingContainer.classList.contains('hidden')).toBeFalsy(); - expect(cluster.successContainer.classList.contains('hidden')).toBeTruthy(); - expect(cluster.errorContainer.classList.contains('hidden')).toBeTruthy(); + expect(cluster.creatingContainer.classList.contains('hidden')).toBe(false); + expect(cluster.successContainer.classList.contains('hidden')).toBe(true); + expect(cluster.errorContainer.classList.contains('hidden')).toBe(true); expect(window.location.reload).not.toHaveBeenCalled(); }); }); @@ -83,9 +80,9 @@ describe('Clusters', () => { cluster.updateContainer(null, 'creating'); cluster.updateContainer('creating', 'created'); - expect(cluster.creatingContainer.classList.contains('hidden')).toBeTruthy(); - expect(cluster.successContainer.classList.contains('hidden')).toBeTruthy(); - expect(cluster.errorContainer.classList.contains('hidden')).toBeTruthy(); + expect(cluster.creatingContainer.classList.contains('hidden')).toBe(true); + expect(cluster.successContainer.classList.contains('hidden')).toBe(true); + expect(cluster.errorContainer.classList.contains('hidden')).toBe(true); expect(window.location.reload).toHaveBeenCalled(); expect(cluster.setClusterNewlyCreated).toHaveBeenCalledWith(true); }); @@ -97,9 +94,9 @@ describe('Clusters', () => { cluster.updateContainer(null, 'created'); cluster.updateContainer('created', 'created'); - expect(cluster.creatingContainer.classList.contains('hidden')).toBeTruthy(); - expect(cluster.successContainer.classList.contains('hidden')).toBeFalsy(); - expect(cluster.errorContainer.classList.contains('hidden')).toBeTruthy(); + expect(cluster.creatingContainer.classList.contains('hidden')).toBe(true); + expect(cluster.successContainer.classList.contains('hidden')).toBe(false); + expect(cluster.errorContainer.classList.contains('hidden')).toBe(true); expect(window.location.reload).not.toHaveBeenCalled(); expect(cluster.setClusterNewlyCreated).toHaveBeenCalledWith(false); }); @@ -111,9 +108,9 @@ describe('Clusters', () => { cluster.updateContainer(null, 'created'); cluster.updateContainer('created', 'created'); - expect(cluster.creatingContainer.classList.contains('hidden')).toBeTruthy(); - expect(cluster.successContainer.classList.contains('hidden')).toBeTruthy(); - expect(cluster.errorContainer.classList.contains('hidden')).toBeTruthy(); + expect(cluster.creatingContainer.classList.contains('hidden')).toBe(true); + expect(cluster.successContainer.classList.contains('hidden')).toBe(true); + expect(cluster.errorContainer.classList.contains('hidden')).toBe(true); expect(window.location.reload).not.toHaveBeenCalled(); expect(cluster.setClusterNewlyCreated).not.toHaveBeenCalled(); }); @@ -123,11 +120,11 @@ describe('Clusters', () => { it('should show the error container', () => { cluster.updateContainer(null, 'errored', 'this is an error'); - expect(cluster.creatingContainer.classList.contains('hidden')).toBeTruthy(); + expect(cluster.creatingContainer.classList.contains('hidden')).toBe(true); - expect(cluster.successContainer.classList.contains('hidden')).toBeTruthy(); + expect(cluster.successContainer.classList.contains('hidden')).toBe(true); - expect(cluster.errorContainer.classList.contains('hidden')).toBeFalsy(); + expect(cluster.errorContainer.classList.contains('hidden')).toBe(false); expect(cluster.errorReasonContainer.textContent).toContain('this is an error'); }); @@ -135,11 +132,11 @@ describe('Clusters', () => { it('should show `error` banner when previously `creating`', () => { cluster.updateContainer('creating', 'errored'); - expect(cluster.creatingContainer.classList.contains('hidden')).toBeTruthy(); + expect(cluster.creatingContainer.classList.contains('hidden')).toBe(true); - expect(cluster.successContainer.classList.contains('hidden')).toBeTruthy(); + expect(cluster.successContainer.classList.contains('hidden')).toBe(true); - expect(cluster.errorContainer.classList.contains('hidden')).toBeFalsy(); + expect(cluster.errorContainer.classList.contains('hidden')).toBe(false); }); }); |