Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-08-30 00:10:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-08-30 00:10:58 +0300
commit165985ad8de01d88952de1207c4124f428263357 (patch)
treee014653840061bc9d48745e339a7cd199d57d018 /spec/frontend
parent3e3f936ff7e5645fc5d379aae87dca6671dc417f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r--spec/frontend/jobs/components/job/sidebar_header_spec.js14
-rw-r--r--spec/frontend/jobs/components/job/sidebar_spec.js32
-rw-r--r--spec/frontend/sentry/init_sentry_spec.js4
-rw-r--r--spec/frontend/sidebar/components/confidential/sidebar_confidentiality_form_spec.js2
-rw-r--r--spec/frontend/sidebar/components/incidents/sidebar_escalation_status_spec.js7
-rw-r--r--spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view_spec.js2
6 files changed, 20 insertions, 41 deletions
diff --git a/spec/frontend/jobs/components/job/sidebar_header_spec.js b/spec/frontend/jobs/components/job/sidebar_header_spec.js
index cf182330578..5f09d574f52 100644
--- a/spec/frontend/jobs/components/job/sidebar_header_spec.js
+++ b/spec/frontend/jobs/components/job/sidebar_header_spec.js
@@ -53,6 +53,8 @@ describe('Sidebar Header', () => {
const findCancelButton = () => wrapper.findByTestId('cancel-button');
const findEraseButton = () => wrapper.findByTestId('job-log-erase-link');
+ const findNewIssueButton = () => wrapper.findByTestId('job-new-issue');
+ const findTerminalLink = () => wrapper.findByTestId('terminal-link');
const findJobName = () => wrapper.findByTestId('job-name');
const findRetryButton = () => wrapper.findComponent(JobRetryButton);
@@ -67,6 +69,8 @@ describe('Sidebar Header', () => {
expect(findCancelButton().exists()).toBe(false);
expect(findEraseButton().exists()).toBe(false);
expect(findRetryButton().exists()).toBe(false);
+ expect(findNewIssueButton().exists()).toBe(false);
+ expect(findTerminalLink().exists()).toBe(false);
});
it('renders a retry button with a path', async () => {
@@ -83,5 +87,15 @@ describe('Sidebar Header', () => {
await createComponentWithApollo({ restJob: { erase_path: 'erase/path' } });
expect(findEraseButton().exists()).toBe(true);
});
+
+ it('should render link to new issue', async () => {
+ await createComponentWithApollo({ restJob: { new_issue_path: 'new/issue/path' } });
+ expect(findNewIssueButton().attributes('href')).toBe('new/issue/path');
+ });
+
+ it('should render terminal link', async () => {
+ await createComponentWithApollo({ restJob: { terminal_path: 'terminal/path' } });
+ expect(findTerminalLink().attributes('href')).toBe('terminal/path');
+ });
});
});
diff --git a/spec/frontend/jobs/components/job/sidebar_spec.js b/spec/frontend/jobs/components/job/sidebar_spec.js
index fbff64b4d78..6c5ed075b85 100644
--- a/spec/frontend/jobs/components/job/sidebar_spec.js
+++ b/spec/frontend/jobs/components/job/sidebar_spec.js
@@ -20,8 +20,6 @@ describe('Sidebar details block', () => {
const forwardDeploymentFailure = 'forward_deployment_failure';
const findModal = () => wrapper.findComponent(JobRetryForwardDeploymentModal);
const findArtifactsBlock = () => wrapper.findComponent(ArtifactsBlock);
- const findNewIssueButton = () => wrapper.findByTestId('job-new-issue');
- const findTerminalLink = () => wrapper.findByTestId('terminal-link');
const findJobStagesDropdown = () => wrapper.findComponent(StagesDropdown);
const findJobsContainer = () => wrapper.findComponent(JobsContainer);
@@ -48,36 +46,6 @@ describe('Sidebar details block', () => {
});
});
- describe('without terminal path', () => {
- it('does not render terminal link', async () => {
- createWrapper();
- await store.dispatch('receiveJobSuccess', job);
-
- expect(findTerminalLink().exists()).toBe(false);
- });
- });
-
- describe('with terminal path', () => {
- it('renders terminal link', async () => {
- createWrapper();
- await store.dispatch('receiveJobSuccess', { ...job, terminal_path: 'job/43123/terminal' });
-
- expect(findTerminalLink().exists()).toBe(true);
- });
- });
-
- describe('actions', () => {
- beforeEach(() => {
- createWrapper();
- return store.dispatch('receiveJobSuccess', job);
- });
-
- it('should render link to new issue', () => {
- expect(findNewIssueButton().attributes('href')).toBe(job.new_issue_path);
- expect(findNewIssueButton().text()).toBe('New issue');
- });
- });
-
describe('forward deployment failure', () => {
describe('when the relevant data is missing', () => {
it.each`
diff --git a/spec/frontend/sentry/init_sentry_spec.js b/spec/frontend/sentry/init_sentry_spec.js
index 9f9415f451d..8e46a63775b 100644
--- a/spec/frontend/sentry/init_sentry_spec.js
+++ b/spec/frontend/sentry/init_sentry_spec.js
@@ -1,4 +1,4 @@
-import * as Sentry from 'sentrybrowser7';
+import * as Sentry from 'sentrybrowser';
import { initSentry } from '~/sentry/init_sentry';
@@ -11,7 +11,7 @@ const mockRevision = '00112233';
const mockFeatureCategory = 'my_feature_category';
const mockPage = 'index:page';
-jest.mock('sentrybrowser7');
+jest.mock('sentrybrowser');
describe('SentryConfig', () => {
beforeEach(() => {
diff --git a/spec/frontend/sidebar/components/confidential/sidebar_confidentiality_form_spec.js b/spec/frontend/sidebar/components/confidential/sidebar_confidentiality_form_spec.js
index 1ca20dad1c6..476448ef5ab 100644
--- a/spec/frontend/sidebar/components/confidential/sidebar_confidentiality_form_spec.js
+++ b/spec/frontend/sidebar/components/confidential/sidebar_confidentiality_form_spec.js
@@ -4,7 +4,7 @@ import { nextTick } from 'vue';
import waitForPromises from 'helpers/wait_for_promises';
import { createAlert } from '~/alert';
import SidebarConfidentialityForm from '~/sidebar/components/confidential/sidebar_confidentiality_form.vue';
-import { confidentialityQueries } from '~/sidebar/constants';
+import { confidentialityQueries } from '~/sidebar/queries/constants';
jest.mock('~/alert');
diff --git a/spec/frontend/sidebar/components/incidents/sidebar_escalation_status_spec.js b/spec/frontend/sidebar/components/incidents/sidebar_escalation_status_spec.js
index 00b57b4916e..f3d50f17e2d 100644
--- a/spec/frontend/sidebar/components/incidents/sidebar_escalation_status_spec.js
+++ b/spec/frontend/sidebar/components/incidents/sidebar_escalation_status_spec.js
@@ -11,11 +11,8 @@ import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import { mountExtended } from 'helpers/vue_test_utils_helper';
import SidebarEscalationStatus from '~/sidebar/components/incidents/sidebar_escalation_status.vue';
import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue';
-import {
- escalationStatusQuery,
- escalationStatusMutation,
- STATUS_ACKNOWLEDGED,
-} from '~/sidebar/constants';
+import { STATUS_ACKNOWLEDGED } from '~/sidebar/constants';
+import { escalationStatusQuery, escalationStatusMutation } from '~/sidebar/queries/constants';
import waitForPromises from 'helpers/wait_for_promises';
import EscalationStatus from 'ee_else_ce/sidebar/components/incidents/escalation_status.vue';
import { createAlert } from '~/alert';
diff --git a/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view_spec.js b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view_spec.js
index 9c8d9656955..6de113ba1f9 100644
--- a/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view_spec.js
+++ b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view_spec.js
@@ -5,7 +5,7 @@ import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
import { createAlert } from '~/alert';
-import { workspaceLabelsQueries } from '~/sidebar/constants';
+import { workspaceLabelsQueries } from '~/sidebar/queries/constants';
import DropdownContentsCreateView from '~/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view.vue';
import createLabelMutation from '~/sidebar/components/labels/labels_select_widget/graphql/create_label.mutation.graphql';
import { DEFAULT_LABEL_COLOR } from '~/sidebar/components/labels/labels_select_widget/constants';