diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-04 18:08:40 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-04 18:08:40 +0300 |
commit | 6b833f1e0340e00fdee074da9c42c0d4e07a46d2 (patch) | |
tree | 6fc3a7a2f8a02fec8d1e7561b453d33eb4048dad /spec/frontend | |
parent | 88a0824944720b6edaaef56376713541b9a02118 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
4 files changed, 31 insertions, 3 deletions
diff --git a/spec/frontend/diffs/components/diff_stats_spec.js b/spec/frontend/diffs/components/diff_stats_spec.js index 9073462a51f..0dffc74f608 100644 --- a/spec/frontend/diffs/components/diff_stats_spec.js +++ b/spec/frontend/diffs/components/diff_stats_spec.js @@ -3,6 +3,18 @@ import Icon from '~/vue_shared/components/icon.vue'; import DiffStats from '~/diffs/components/diff_stats.vue'; describe('diff_stats', () => { + it('does not render a group if diffFileLengths is empty', () => { + const wrapper = shallowMount(DiffStats, { + propsData: { + addedLines: 1, + removedLines: 2, + }, + }); + const groups = wrapper.findAll('.diff-stats-group'); + + expect(groups.length).toBe(2); + }); + it('does not render a group if diffFileLengths is not a number', () => { const wrapper = shallowMount(DiffStats, { propsData: { diff --git a/spec/frontend/error_tracking/components/error_details_spec.js b/spec/frontend/error_tracking/components/error_details_spec.js index 1e1d20800da..cfb9ce51979 100644 --- a/spec/frontend/error_tracking/components/error_details_spec.js +++ b/spec/frontend/error_tracking/components/error_details_spec.js @@ -1,7 +1,7 @@ import { createLocalVue, shallowMount } from '@vue/test-utils'; import Vuex from 'vuex'; import { __ } from '~/locale'; -import { GlLoadingIcon, GlLink, GlBadge, GlFormInput } from '@gitlab/ui'; +import { GlLoadingIcon, GlLink, GlBadge, GlFormInput, GlAlert, GlSprintf } from '@gitlab/ui'; import LoadingButton from '~/vue_shared/components/loading_button.vue'; import Stacktrace from '~/error_tracking/components/stacktrace.vue'; import ErrorDetails from '~/error_tracking/components/error_details.vue'; @@ -28,7 +28,7 @@ describe('ErrorDetails', () => { function mountComponent() { wrapper = shallowMount(ErrorDetails, { - stubs: { LoadingButton }, + stubs: { LoadingButton, GlSprintf }, localVue, store, mocks, @@ -62,7 +62,7 @@ describe('ErrorDetails', () => { startPollingDetails: () => {}, startPollingStacktrace: () => {}, updateIgnoreStatus: jest.fn(), - updateResolveStatus: jest.fn(), + updateResolveStatus: jest.fn().mockResolvedValue({ closed_issue_iid: 1 }), }; getters = { @@ -313,6 +313,20 @@ describe('ErrorDetails', () => { expect.objectContaining({ status: errorStatus.UNRESOLVED }), ); }); + + it('should show alert with closed issueId', () => { + const findAlert = () => wrapper.find(GlAlert); + const closedIssueId = 123; + wrapper.setData({ + isAlertVisible: true, + closedIssueId, + }); + + return wrapper.vm.$nextTick().then(() => { + expect(findAlert().exists()).toBe(true); + expect(findAlert().text()).toContain(`#${closedIssueId}`); + }); + }); }); }); diff --git a/spec/frontend/pages/admin/users/components/__snapshots__/user_operation_confirmation_modal_spec.js.snap b/spec/frontend/pages/admin/users/components/__snapshots__/user_operation_confirmation_modal_spec.js.snap index 4b4e9997953..dbf8caae357 100644 --- a/spec/frontend/pages/admin/users/components/__snapshots__/user_operation_confirmation_modal_spec.js.snap +++ b/spec/frontend/pages/admin/users/components/__snapshots__/user_operation_confirmation_modal_spec.js.snap @@ -6,6 +6,7 @@ exports[`User Operation confirmation modal renders modal with form included 1`] modalid="user-operation-modal" ok-title="action" ok-variant="warning" + size="md" title="title" titletag="h4" > diff --git a/spec/frontend/self_monitor/components/__snapshots__/self_monitor_spec.js.snap b/spec/frontend/self_monitor/components/__snapshots__/self_monitor_spec.js.snap index b1644ac2b1f..d5546021430 100644 --- a/spec/frontend/self_monitor/components/__snapshots__/self_monitor_spec.js.snap +++ b/spec/frontend/self_monitor/components/__snapshots__/self_monitor_spec.js.snap @@ -61,6 +61,7 @@ exports[`self monitor component When the self monitor project has not been creat modalid="delete-self-monitor-modal" ok-title="Delete project" ok-variant="danger" + size="md" title="Disable self monitoring?" titletag="h4" > |