summaryrefslogtreecommitdiff
path: root/spec/frontend/clusters
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 08:17:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 08:17:02 +0000
commitb39512ed755239198a9c294b6a45e65c05900235 (patch)
treed234a3efade1de67c46b9e5a38ce813627726aa7 /spec/frontend/clusters
parentd31474cf3b17ece37939d20082b07f6657cc79a9 (diff)
downloadgitlab-ce-b39512ed755239198a9c294b6a45e65c05900235.tar.gz
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/frontend/clusters')
-rw-r--r--spec/frontend/clusters/agents/components/activity_history_item_spec.js2
-rw-r--r--spec/frontend/clusters/agents/components/create_token_modal_spec.js2
-rw-r--r--spec/frontend/clusters/agents/components/token_table_spec.js4
-rw-r--r--spec/frontend/clusters/clusters_bundle_spec.js45
-rw-r--r--spec/frontend/clusters/components/new_cluster_spec.js4
-rw-r--r--spec/frontend/clusters/forms/components/integration_form_spec.js4
6 files changed, 29 insertions, 32 deletions
diff --git a/spec/frontend/clusters/agents/components/activity_history_item_spec.js b/spec/frontend/clusters/agents/components/activity_history_item_spec.js
index 100a280d0cc..68f6f11aa8f 100644
--- a/spec/frontend/clusters/agents/components/activity_history_item_spec.js
+++ b/spec/frontend/clusters/agents/components/activity_history_item_spec.js
@@ -23,7 +23,7 @@ describe('ActivityHistoryItem', () => {
};
const findHistoryItem = () => wrapper.findComponent(HistoryItem);
- const findTimeAgo = () => wrapper.find(TimeAgoTooltip);
+ const findTimeAgo = () => wrapper.findComponent(TimeAgoTooltip);
afterEach(() => {
wrapper.destroy();
diff --git a/spec/frontend/clusters/agents/components/create_token_modal_spec.js b/spec/frontend/clusters/agents/components/create_token_modal_spec.js
index ad48afe10b6..0d10801e80e 100644
--- a/spec/frontend/clusters/agents/components/create_token_modal_spec.js
+++ b/spec/frontend/clusters/agents/components/create_token_modal_spec.js
@@ -55,7 +55,7 @@ describe('CreateTokenModal', () => {
const findAgentInstructions = () => findModal().findComponent(AgentToken);
const findButtonByVariant = (variant) =>
findModal()
- .findAll(GlButton)
+ .findAllComponents(GlButton)
.wrappers.find((button) => button.props('variant') === variant);
const findActionButton = () => findButtonByVariant('confirm');
const findCancelButton = () => wrapper.findByTestId('agent-token-close-button');
diff --git a/spec/frontend/clusters/agents/components/token_table_spec.js b/spec/frontend/clusters/agents/components/token_table_spec.js
index 6caeaf5c192..334615f1818 100644
--- a/spec/frontend/clusters/agents/components/token_table_spec.js
+++ b/spec/frontend/clusters/agents/components/token_table_spec.js
@@ -136,8 +136,8 @@ describe('ClusterAgentTokenTable', () => {
const token = tokens.at(lineNumber);
expect(token.text()).toContain(description);
- expect(token.find(GlTruncate).exists()).toBe(truncatesText);
- expect(token.find(GlTooltip).exists()).toBe(hasTooltip);
+ expect(token.findComponent(GlTruncate).exists()).toBe(truncatesText);
+ expect(token.findComponent(GlTooltip).exists()).toBe(hasTooltip);
},
);
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);
});
});
diff --git a/spec/frontend/clusters/components/new_cluster_spec.js b/spec/frontend/clusters/components/new_cluster_spec.js
index f9df70b9f87..ef39c90aaef 100644
--- a/spec/frontend/clusters/components/new_cluster_spec.js
+++ b/spec/frontend/clusters/components/new_cluster_spec.js
@@ -12,9 +12,9 @@ describe('NewCluster', () => {
await nextTick();
};
- const findDescription = () => wrapper.find(GlSprintf);
+ const findDescription = () => wrapper.findComponent(GlSprintf);
- const findLink = () => wrapper.find(GlLink);
+ const findLink = () => wrapper.findComponent(GlLink);
beforeEach(() => {
return createWrapper();
diff --git a/spec/frontend/clusters/forms/components/integration_form_spec.js b/spec/frontend/clusters/forms/components/integration_form_spec.js
index 67d442bfdc5..b17886a5826 100644
--- a/spec/frontend/clusters/forms/components/integration_form_spec.js
+++ b/spec/frontend/clusters/forms/components/integration_form_spec.js
@@ -32,8 +32,8 @@ describe('ClusterIntegrationForm', () => {
wrapper = null;
};
- const findSubmitButton = () => wrapper.find(GlButton);
- const findGlToggle = () => wrapper.find(GlToggle);
+ const findSubmitButton = () => wrapper.findComponent(GlButton);
+ const findGlToggle = () => wrapper.findComponent(GlToggle);
afterEach(() => {
destroyWrapper();