diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-01 21:07:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-01 21:07:03 +0300 |
commit | 4e3a998b8ec1351d8345863f6cad4b9bd497bd6a (patch) | |
tree | 9bab8c1089ef4bcc11bd8acdffd1f0f6f62c3e56 /spec/frontend | |
parent | 08489a6db8ddff0794f9beaf770930803dc7bdca (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
24 files changed, 285 insertions, 88 deletions
diff --git a/spec/frontend/boards/components/board_content_sidebar_spec.js b/spec/frontend/boards/components/board_content_sidebar_spec.js index 69f5992a80e..0d5b1d16e30 100644 --- a/spec/frontend/boards/components/board_content_sidebar_spec.js +++ b/spec/frontend/boards/components/board_content_sidebar_spec.js @@ -12,7 +12,7 @@ import SidebarDateWidget from '~/sidebar/components/date/sidebar_date_widget.vue import SidebarSeverity from '~/sidebar/components/severity/sidebar_severity.vue'; import SidebarSubscriptionsWidget from '~/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue'; import SidebarTodoWidget from '~/sidebar/components/todo_toggle/sidebar_todo_widget.vue'; -import SidebarLabelsWidget from '~/vue_shared/components/sidebar/labels_select_widget/labels_select_root.vue'; +import SidebarLabelsWidget from '~/sidebar/components/labels/labels_select_widget/labels_select_root.vue'; import { mockActiveIssue, mockIssue, mockIssueGroupPath, mockIssueProjectPath } from '../mock_data'; Vue.use(Vuex); diff --git a/spec/frontend/ci_lint/components/ci_lint_spec.js b/spec/frontend/ci/ci_lint/components/ci_lint_spec.js index ea69a80274e..518375cb831 100644 --- a/spec/frontend/ci_lint/components/ci_lint_spec.js +++ b/spec/frontend/ci/ci_lint/components/ci_lint_spec.js @@ -2,7 +2,7 @@ import { GlAlert } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import { nextTick } from 'vue'; import waitForPromises from 'helpers/wait_for_promises'; -import CiLint from '~/ci_lint/components/ci_lint.vue'; +import CiLint from '~/ci/ci_lint/components/ci_lint.vue'; import CiLintResults from '~/pipeline_editor/components/lint/ci_lint_results.vue'; import lintCIMutation from '~/pipeline_editor/graphql/mutations/client/lint_ci.mutation.graphql'; import SourceEditor from '~/vue_shared/components/source_editor.vue'; diff --git a/spec/frontend/ci_lint/mock_data.js b/spec/frontend/ci/ci_lint/mock_data.js index 660b2ad6e8b..660b2ad6e8b 100644 --- a/spec/frontend/ci_lint/mock_data.js +++ b/spec/frontend/ci/ci_lint/mock_data.js diff --git a/spec/frontend/clusters_list/components/agent_token_spec.js b/spec/frontend/clusters_list/components/agent_token_spec.js index 8d3130b45a6..e656a601699 100644 --- a/spec/frontend/clusters_list/components/agent_token_spec.js +++ b/spec/frontend/clusters_list/components/agent_token_spec.js @@ -1,7 +1,11 @@ import { GlAlert, GlFormInputGroup } from '@gitlab/ui'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import AgentToken from '~/clusters_list/components/agent_token.vue'; -import { I18N_AGENT_TOKEN, INSTALL_AGENT_MODAL_ID } from '~/clusters_list/constants'; +import { + I18N_AGENT_TOKEN, + INSTALL_AGENT_MODAL_ID, + NAME_MAX_LENGTH, +} from '~/clusters_list/constants'; import { generateAgentRegistrationCommand } from '~/clusters_list/clusters_util'; import CodeBlock from '~/vue_shared/components/code_block.vue'; import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue'; @@ -20,14 +24,14 @@ describe('InstallAgentModal', () => { const findCopyButton = () => wrapper.findComponent(ModalCopyButton); const findInput = () => wrapper.findComponent(GlFormInputGroup); - const createWrapper = () => { + const createWrapper = (newAgentName = agentName) => { const provide = { kasAddress, kasVersion, }; const propsData = { - agentName, + agentName: newAgentName, agentToken, modalId, }; @@ -79,9 +83,19 @@ describe('InstallAgentModal', () => { it('shows code block with agent installation command', () => { expect(findCodeBlock().props('code')).toContain(`helm upgrade --install ${agentName}`); + expect(findCodeBlock().props('code')).toContain(`--namespace gitlab-agent-${agentName}`); expect(findCodeBlock().props('code')).toContain(`--set config.token=${agentToken}`); expect(findCodeBlock().props('code')).toContain(`--set config.kasAddress=${kasAddress}`); expect(findCodeBlock().props('code')).toContain(`--set image.tag=v${kasVersion}`); }); + + it('truncates the namespace name if it exceeds the maximum length', () => { + const newAgentName = 'agent-name-that-is-too-long-and-needs-to-be-truncated-to-use'; + createWrapper(newAgentName); + + expect(findCodeBlock().props('code')).toContain( + `--namespace gitlab-agent-${newAgentName.substring(0, NAME_MAX_LENGTH)}`, + ); + }); }); }); diff --git a/spec/frontend/content_editor/components/content_editor_spec.js b/spec/frontend/content_editor/components/content_editor_spec.js index c1c2a125515..1a3cd36a8bb 100644 --- a/spec/frontend/content_editor/components/content_editor_spec.js +++ b/spec/frontend/content_editor/components/content_editor_spec.js @@ -10,7 +10,7 @@ import FormattingBubbleMenu from '~/content_editor/components/bubble_menus/forma import CodeBlockBubbleMenu from '~/content_editor/components/bubble_menus/code_block_bubble_menu.vue'; import LinkBubbleMenu from '~/content_editor/components/bubble_menus/link_bubble_menu.vue'; import MediaBubbleMenu from '~/content_editor/components/bubble_menus/media_bubble_menu.vue'; -import TopToolbar from '~/content_editor/components/top_toolbar.vue'; +import FormattingToolbar from '~/content_editor/components/formatting_toolbar.vue'; import LoadingIndicator from '~/content_editor/components/loading_indicator.vue'; import waitForPromises from 'helpers/wait_for_promises'; import { KEYDOWN_EVENT } from '~/content_editor/constants'; @@ -27,13 +27,14 @@ describe('ContentEditor', () => { const findEditorStateObserver = () => wrapper.findComponent(EditorStateObserver); const findLoadingIndicator = () => wrapper.findComponent(LoadingIndicator); const findContentEditorAlert = () => wrapper.findComponent(ContentEditorAlert); - const createWrapper = ({ markdown, autofocus } = {}) => { + const createWrapper = ({ markdown, autofocus, useBottomToolbar } = {}) => { wrapper = shallowMountExtended(ContentEditor, { propsData: { renderMarkdown, uploadsPath, markdown, autofocus, + useBottomToolbar, }, stubs: { EditorStateObserver, @@ -89,7 +90,19 @@ describe('ContentEditor', () => { it('renders top toolbar component', () => { createWrapper(); - expect(wrapper.findComponent(TopToolbar).exists()).toBe(true); + expect(wrapper.findComponent(FormattingToolbar).exists()).toBe(true); + expect(wrapper.findComponent(FormattingToolbar).classes('gl-border-t')).toBe(false); + expect(wrapper.findComponent(FormattingToolbar).classes('gl-border-b')).toBe(true); + }); + + it('renders bottom toolbar component', () => { + createWrapper({ + useBottomToolbar: true, + }); + + expect(wrapper.findComponent(FormattingToolbar).exists()).toBe(true); + expect(wrapper.findComponent(FormattingToolbar).classes('gl-border-t')).toBe(true); + expect(wrapper.findComponent(FormattingToolbar).classes('gl-border-b')).toBe(false); }); describe('when setting initial content', () => { diff --git a/spec/frontend/content_editor/components/top_toolbar_spec.js b/spec/frontend/content_editor/components/formatting_toolbar_spec.js index 8f194ff32e2..c4bf21ba813 100644 --- a/spec/frontend/content_editor/components/top_toolbar_spec.js +++ b/spec/frontend/content_editor/components/formatting_toolbar_spec.js @@ -1,6 +1,6 @@ import { mockTracking } from 'helpers/tracking_helper'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; -import TopToolbar from '~/content_editor/components/top_toolbar.vue'; +import FormattingToolbar from '~/content_editor/components/formatting_toolbar.vue'; import { TOOLBAR_CONTROL_TRACKING_ACTION, CONTENT_EDITOR_TRACKING_LABEL, @@ -11,7 +11,7 @@ describe('content_editor/components/top_toolbar', () => { let trackingSpy; const buildWrapper = () => { - wrapper = shallowMountExtended(TopToolbar); + wrapper = shallowMountExtended(FormattingToolbar); }; beforeEach(() => { diff --git a/spec/frontend/editor/components/source_editor_toolbar_button_spec.js b/spec/frontend/editor/components/source_editor_toolbar_button_spec.js index 1475d451ab3..ded31bb62dc 100644 --- a/spec/frontend/editor/components/source_editor_toolbar_button_spec.js +++ b/spec/frontend/editor/components/source_editor_toolbar_button_spec.js @@ -55,6 +55,12 @@ describe('Source Editor Toolbar button', () => { }); describe('click handler', () => { + let clickEvent; + + beforeEach(() => { + clickEvent = new Event('click'); + }); + it('fires the click handler on the button when available', async () => { const spy = jest.fn(); createComponent({ @@ -63,20 +69,20 @@ describe('Source Editor Toolbar button', () => { }, }); expect(spy).not.toHaveBeenCalled(); - findButton().vm.$emit('click'); + findButton().vm.$emit('click', clickEvent); await nextTick(); - expect(spy).toHaveBeenCalled(); + expect(spy).toHaveBeenCalledWith(clickEvent); }); - it('emits the "click" event', async () => { + it('emits the "click" event, passing the event itself', async () => { createComponent(); jest.spyOn(wrapper.vm, '$emit'); expect(wrapper.vm.$emit).not.toHaveBeenCalled(); - findButton().vm.$emit('click'); + findButton().vm.$emit('click', clickEvent); await nextTick(); - expect(wrapper.vm.$emit).toHaveBeenCalledWith('click'); + expect(wrapper.vm.$emit).toHaveBeenCalledWith('click', clickEvent); }); }); }); diff --git a/spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js b/spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js index 3f72396cce6..3195d5ff0a1 100644 --- a/spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js +++ b/spec/frontend/issues/dashboard/components/issues_dashboard_app_spec.js @@ -1,58 +1,168 @@ import { GlEmptyState } from '@gitlab/ui'; +import * as Sentry from '@sentry/browser'; +import Vue, { nextTick } from 'vue'; +import VueApollo from 'vue-apollo'; +import { cloneDeep } from 'lodash'; +import getIssuesQuery from 'ee_else_ce/issues/dashboard/queries/get_issues.query.graphql'; +import IssueCardStatistics from 'ee_else_ce/issues/list/components/issue_card_statistics.vue'; +import IssueCardTimeInfo from 'ee_else_ce/issues/list/components/issue_card_time_info.vue'; +import createMockApollo from 'helpers/mock_apollo_helper'; import { mountExtended } from 'helpers/vue_test_utils_helper'; +import waitForPromises from 'helpers/wait_for_promises'; import IssuesDashboardApp from '~/issues/dashboard/components/issues_dashboard_app.vue'; +import { i18n } from '~/issues/list/constants'; +import { scrollUp } from '~/lib/utils/scroll_utils'; import IssuableList from '~/vue_shared/issuable/list/components/issuable_list_root.vue'; import { IssuableStates } from '~/vue_shared/issuable/list/constants'; +import { emptyIssuesQueryResponse, issuesQueryResponse } from '../mock_data'; + +jest.mock('@sentry/browser'); +jest.mock('~/lib/utils/scroll_utils', () => ({ scrollUp: jest.fn() })); describe('IssuesDashboardApp component', () => { let wrapper; + Vue.use(VueApollo); + const defaultProvide = { calendarPath: 'calendar/path', emptyStateSvgPath: 'empty-state.svg', + hasBlockedIssuesFeature: true, + hasIssuableHealthStatusFeature: true, + hasIssueWeightsFeature: true, + hasScopedLabelsFeature: true, + isPublicVisibilityRestricted: false, isSignedIn: true, rssPath: 'rss/path', }; + let defaultQueryResponse = issuesQueryResponse; + if (IS_EE) { + defaultQueryResponse = cloneDeep(issuesQueryResponse); + defaultQueryResponse.data.issues.nodes[0].blockingCount = 1; + defaultQueryResponse.data.issues.nodes[0].healthStatus = null; + defaultQueryResponse.data.issues.nodes[0].weight = 5; + } + const findCalendarButton = () => wrapper.findByRole('link', { name: IssuesDashboardApp.i18n.calendarButtonText }); const findEmptyState = () => wrapper.findComponent(GlEmptyState); const findIssuableList = () => wrapper.findComponent(IssuableList); + const findIssueCardStatistics = () => wrapper.findComponent(IssueCardStatistics); + const findIssueCardTimeInfo = () => wrapper.findComponent(IssueCardTimeInfo); const findRssButton = () => wrapper.findByRole('link', { name: IssuesDashboardApp.i18n.rssButtonText }); - const mountComponent = () => { - wrapper = mountExtended(IssuesDashboardApp, { provide: defaultProvide }); + const mountComponent = ({ + issuesQueryHandler = jest.fn().mockResolvedValue(defaultQueryResponse), + } = {}) => { + wrapper = mountExtended(IssuesDashboardApp, { + apolloProvider: createMockApollo([[getIssuesQuery, issuesQueryHandler]]), + provide: defaultProvide, + }); }; - beforeEach(() => { + it('renders IssuableList component', async () => { mountComponent(); - }); + await waitForPromises(); - it('renders IssuableList component', () => { expect(findIssuableList().props()).toMatchObject({ currentTab: IssuableStates.Opened, + hasNextPage: true, + hasPreviousPage: false, + hasScopedLabelsFeature: defaultProvide.hasScopedLabelsFeature, namespace: 'dashboard', recentSearchesStorageKey: 'issues', searchInputPlaceholder: IssuesDashboardApp.i18n.searchInputPlaceholder, + showPaginationControls: true, tabs: IssuesDashboardApp.IssuableListTabs, + useKeysetPagination: true, }); }); it('renders RSS button link', () => { + mountComponent(); + expect(findRssButton().attributes('href')).toBe(defaultProvide.rssPath); expect(findRssButton().props('icon')).toBe('rss'); }); it('renders calendar button link', () => { + mountComponent(); + expect(findCalendarButton().attributes('href')).toBe(defaultProvide.calendarPath); expect(findCalendarButton().props('icon')).toBe('calendar'); }); - it('renders empty state', () => { + it('renders issue time information', async () => { + mountComponent(); + await waitForPromises(); + + expect(findIssueCardTimeInfo().exists()).toBe(true); + }); + + it('renders issue statistics', async () => { + mountComponent(); + await waitForPromises(); + + expect(findIssueCardStatistics().exists()).toBe(true); + }); + + it('renders empty state', async () => { + mountComponent({ issuesQueryHandler: jest.fn().mockResolvedValue(emptyIssuesQueryResponse) }); + await waitForPromises(); + expect(findEmptyState().props()).toMatchObject({ svgPath: defaultProvide.emptyStateSvgPath, title: IssuesDashboardApp.i18n.emptyStateTitle, }); }); + + describe('when there is an error fetching issues', () => { + beforeEach(() => { + mountComponent({ issuesQueryHandler: jest.fn().mockRejectedValue(new Error('ERROR')) }); + return waitForPromises(); + }); + + it('shows an error message', () => { + expect(findIssuableList().props('error')).toBe(i18n.errorFetchingIssues); + expect(Sentry.captureException).toHaveBeenCalledWith(new Error('ERROR')); + }); + + it('clears error message when "dismiss-alert" event is emitted from IssuableList', async () => { + findIssuableList().vm.$emit('dismiss-alert'); + await nextTick(); + + expect(findIssuableList().props('error')).toBeNull(); + }); + }); + + describe('events', () => { + describe('when "click-tab" event is emitted by IssuableList', () => { + beforeEach(() => { + mountComponent(); + + findIssuableList().vm.$emit('click-tab', IssuableStates.Closed); + }); + + it('updates ui to the new tab', () => { + expect(findIssuableList().props('currentTab')).toBe(IssuableStates.Closed); + }); + }); + + describe.each(['next-page', 'previous-page'])( + 'when "%s" event is emitted by IssuableList', + (event) => { + beforeEach(() => { + mountComponent(); + + findIssuableList().vm.$emit(event); + }); + + it('scrolls to the top', () => { + expect(scrollUp).toHaveBeenCalled(); + }); + }, + ); + }); }); diff --git a/spec/frontend/issues/dashboard/mock_data.js b/spec/frontend/issues/dashboard/mock_data.js new file mode 100644 index 00000000000..feb4cb80bd8 --- /dev/null +++ b/spec/frontend/issues/dashboard/mock_data.js @@ -0,0 +1,88 @@ +export const issuesQueryResponse = { + data: { + issues: { + nodes: [ + { + __typename: 'Issue', + id: 'gid://gitlab/Issue/123456', + iid: '789', + closedAt: null, + confidential: false, + createdAt: '2021-05-22T04:08:01Z', + downvotes: 2, + dueDate: '2021-05-29', + hidden: false, + humanTimeEstimate: null, + mergeRequestsCount: false, + moved: false, + reference: 'group/project#123456', + state: 'opened', + title: 'Issue title', + type: 'issue', + updatedAt: '2021-05-22T04:08:01Z', + upvotes: 3, + userDiscussionsCount: 4, + webPath: 'project/-/issues/789', + webUrl: 'project/-/issues/789', + assignees: { + nodes: [ + { + __typename: 'UserCore', + id: 'gid://gitlab/User/234', + avatarUrl: 'avatar/url', + name: 'Marge Simpson', + username: 'msimpson', + webUrl: 'url/msimpson', + }, + ], + }, + author: { + __typename: 'UserCore', + id: 'gid://gitlab/User/456', + avatarUrl: 'avatar/url', + name: 'Homer Simpson', + username: 'hsimpson', + webUrl: 'url/hsimpson', + }, + labels: { + nodes: [ + { + id: 'gid://gitlab/ProjectLabel/456', + color: '#333', + title: 'Label title', + description: 'Label description', + }, + ], + }, + milestone: null, + taskCompletionStatus: { + completedCount: 1, + count: 2, + }, + }, + ], + pageInfo: { + __typename: 'PageInfo', + hasNextPage: true, + hasPreviousPage: false, + startCursor: 'startcursor', + endCursor: 'endcursor', + }, + }, + }, +}; + +export const emptyIssuesQueryResponse = { + data: { + issues: { + nodes: [], + pageInfo: { + __typename: 'PageInfo', + hasNextPage: false, + hasPreviousPage: false, + startCursor: '', + endCursor: '', + }, + }, + }, +}; diff --git a/spec/frontend/pipeline_editor/components/validate/ci_validate_spec.js b/spec/frontend/pipeline_editor/components/validate/ci_validate_spec.js index 09d4f9736ad..6e5b3125e75 100644 --- a/spec/frontend/pipeline_editor/components/validate/ci_validate_spec.js +++ b/spec/frontend/pipeline_editor/components/validate/ci_validate_spec.js @@ -17,7 +17,7 @@ import { mockCiYml, mockSimulatePipelineHelpPagePath, } from '../../mock_data'; -import { mockLintDataError, mockLintDataValid } from '../../../ci_lint/mock_data'; +import { mockLintDataError, mockLintDataValid } from '../../../ci/ci_lint/mock_data'; const localVue = createLocalVue(); localVue.use(VueApollo); diff --git a/spec/frontend/projects/settings/repository/branch_rules/app_spec.js b/spec/frontend/projects/settings/repository/branch_rules/app_spec.js index 6369f04781f..447d7e86ceb 100644 --- a/spec/frontend/projects/settings/repository/branch_rules/app_spec.js +++ b/spec/frontend/projects/settings/repository/branch_rules/app_spec.js @@ -5,9 +5,12 @@ import waitForPromises from 'helpers/wait_for_promises'; import { mountExtended } from 'helpers/vue_test_utils_helper'; import BranchRules, { i18n } from '~/projects/settings/repository/branch_rules/app.vue'; import BranchRule from '~/projects/settings/repository/branch_rules/components/branch_rule.vue'; -import branchRulesQuery from '~/projects/settings/repository/branch_rules/graphql/queries/branch_rules.query.graphql'; +import branchRulesQuery from 'ee_else_ce/projects/settings/repository/branch_rules/graphql/queries/branch_rules.query.graphql'; import { createAlert } from '~/flash'; -import { branchRulesMockResponse, appProvideMock } from './mock_data'; +import { + branchRulesMockResponse, + appProvideMock, +} from 'ee_else_ce_jest/projects/settings/repository/branch_rules/mock_data'; jest.mock('~/flash'); diff --git a/spec/frontend/projects/settings/repository/branch_rules/components/branch_rule_spec.js b/spec/frontend/projects/settings/repository/branch_rules/components/branch_rule_spec.js index ee12fd4ee42..49c45c080b4 100644 --- a/spec/frontend/projects/settings/repository/branch_rules/components/branch_rule_spec.js +++ b/spec/frontend/projects/settings/repository/branch_rules/components/branch_rule_spec.js @@ -50,20 +50,7 @@ describe('Branch rule', () => { it('renders the protection details list items', () => { expect(findProtectionDetailsListItems()).toHaveLength(wrapper.vm.approvalDetails.length); expect(findProtectionDetailsListItems().at(0).text()).toBe(i18n.allowForcePush); - expect(findProtectionDetailsListItems().at(1).text()).toBe(i18n.codeOwnerApprovalRequired); - expect(findProtectionDetailsListItems().at(2).text()).toMatchInterpolatedText( - sprintf(i18n.statusChecks, { - total: branchRulePropsMock.statusChecksTotal, - subject: n__('check', 'checks', branchRulePropsMock.statusChecksTotal), - }), - ); - expect(findProtectionDetailsListItems().at(3).text()).toMatchInterpolatedText( - sprintf(i18n.approvalRules, { - total: branchRulePropsMock.approvalRulesTotal, - subject: n__('rule', 'rules', branchRulePropsMock.approvalRulesTotal), - }), - ); - expect(findProtectionDetailsListItems().at(4).text()).toBe(wrapper.vm.pushAccessLevelsText); + expect(findProtectionDetailsListItems().at(1).text()).toBe(wrapper.vm.pushAccessLevelsText); }); it('renders branches count for wildcards', () => { diff --git a/spec/frontend/projects/settings/repository/branch_rules/mock_data.js b/spec/frontend/projects/settings/repository/branch_rules/mock_data.js index c105999dce6..6f506882c36 100644 --- a/spec/frontend/projects/settings/repository/branch_rules/mock_data.js +++ b/spec/frontend/projects/settings/repository/branch_rules/mock_data.js @@ -4,12 +4,7 @@ export const accessLevelsMockResponse = [ node: { __typename: 'PushAccessLevel', accessLevel: 40, - accessLevelDescription: 'Jona Langworth', - group: null, - user: { - __typename: 'UserCore', - id: '123', - }, + accessLevelDescription: 'Developers', }, }, { @@ -18,8 +13,6 @@ export const accessLevelsMockResponse = [ __typename: 'PushAccessLevel', accessLevel: 40, accessLevelDescription: 'Maintainers', - group: null, - user: null, }, }, ]; @@ -38,7 +31,6 @@ export const branchRulesMockResponse = { matchingBranchesCount: 1, branchProtection: { allowForcePush: true, - codeOwnerApprovalRequired: true, mergeAccessLevels: { edges: [], __typename: 'MergeAccessLevelConnection', @@ -48,14 +40,6 @@ export const branchRulesMockResponse = { __typename: 'PushAccessLevelConnection', }, }, - approvalRules: { - nodes: [{ id: 1 }], - __typename: 'ApprovalProjectRuleConnection', - }, - externalStatusChecks: { - nodes: [{ id: 1 }, { id: 2 }], - __typename: 'ExternalStatusCheckConnection', - }, __typename: 'BranchRule', }, { @@ -64,7 +48,6 @@ export const branchRulesMockResponse = { matchingBranchesCount: 2, branchProtection: { allowForcePush: false, - codeOwnerApprovalRequired: false, mergeAccessLevels: { edges: [], __typename: 'MergeAccessLevelConnection', @@ -74,14 +57,6 @@ export const branchRulesMockResponse = { __typename: 'PushAccessLevelConnection', }, }, - approvalRules: { - nodes: [], - __typename: 'ApprovalProjectRuleConnection', - }, - externalStatusChecks: { - nodes: [], - __typename: 'ExternalStatusCheckConnection', - }, __typename: 'BranchRule', }, ], @@ -104,13 +79,13 @@ export const branchRulePropsMock = { matchingBranchesCount: 1, branchProtection: { allowForcePush: true, - codeOwnerApprovalRequired: true, + codeOwnerApprovalRequired: false, pushAccessLevels: { edges: accessLevelsMockResponse, }, }, - approvalRulesTotal: 1, - statusChecksTotal: 2, + approvalRulesTotal: 0, + statusChecksTotal: 0, }; export const branchRuleWithoutDetailsPropsMock = { diff --git a/spec/frontend/vue_shared/components/sidebar/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 237f174e048..79b164b0ea7 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_create_view_spec.js +++ b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view_spec.js @@ -6,8 +6,8 @@ import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; import { createAlert } from '~/flash'; import { workspaceLabelsQueries } from '~/sidebar/constants'; -import DropdownContentsCreateView from '~/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_create_view.vue'; -import createLabelMutation from '~/vue_shared/components/sidebar/labels_select_widget/graphql/create_label.mutation.graphql'; +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 { mockRegularLabel, mockSuggestedColors, diff --git a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_labels_view_spec.js b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view_spec.js index 5d8ad5ddee5..913badccbe4 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_labels_view_spec.js +++ b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view_spec.js @@ -11,10 +11,10 @@ import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; import { createAlert } from '~/flash'; import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants'; -import { DropdownVariant } from '~/vue_shared/components/sidebar/labels_select_widget/constants'; -import DropdownContentsLabelsView from '~/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_labels_view.vue'; -import projectLabelsQuery from '~/vue_shared/components/sidebar/labels_select_widget/graphql/project_labels.query.graphql'; -import LabelItem from '~/vue_shared/components/sidebar/labels_select_widget/label_item.vue'; +import { DropdownVariant } from '~/sidebar/components/labels/labels_select_widget/constants'; +import DropdownContentsLabelsView from '~/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view.vue'; +import projectLabelsQuery from '~/sidebar/components/labels/labels_select_widget/graphql/project_labels.query.graphql'; +import LabelItem from '~/sidebar/components/labels/labels_select_widget/label_item.vue'; import { mockConfig, workspaceLabelsQueryResponse } from './mock_data'; jest.mock('~/flash'); diff --git a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_spec.js b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_contents_spec.js index 00da9b74957..9bbb1413ee9 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_spec.js +++ b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_contents_spec.js @@ -1,10 +1,10 @@ import { shallowMount } from '@vue/test-utils'; import { nextTick } from 'vue'; -import { DropdownVariant } from '~/vue_shared/components/sidebar/labels_select_widget/constants'; -import DropdownContents from '~/vue_shared/components/sidebar/labels_select_widget/dropdown_contents.vue'; -import DropdownContentsCreateView from '~/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_create_view.vue'; -import DropdownContentsLabelsView from '~/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_labels_view.vue'; -import DropdownFooter from '~/vue_shared/components/sidebar/labels_select_widget/dropdown_footer.vue'; +import { DropdownVariant } from '~/sidebar/components/labels/labels_select_widget/constants'; +import DropdownContents from '~/sidebar/components/labels/labels_select_widget/dropdown_contents.vue'; +import DropdownContentsCreateView from '~/sidebar/components/labels/labels_select_widget/dropdown_contents_create_view.vue'; +import DropdownContentsLabelsView from '~/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view.vue'; +import DropdownFooter from '~/sidebar/components/labels/labels_select_widget/dropdown_footer.vue'; import { mockLabels } from './mock_data'; diff --git a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_footer_spec.js b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_footer_spec.js index 0508a059195..9a6e0ca3ccd 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_footer_spec.js +++ b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_footer_spec.js @@ -1,6 +1,6 @@ import { shallowMount } from '@vue/test-utils'; import { nextTick } from 'vue'; -import DropdownFooter from '~/vue_shared/components/sidebar/labels_select_widget/dropdown_footer.vue'; +import DropdownFooter from '~/sidebar/components/labels/labels_select_widget/dropdown_footer.vue'; describe('DropdownFooter', () => { let wrapper; diff --git a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_header_spec.js b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_header_spec.js index c4faef8ccdd..d9001dface4 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_header_spec.js +++ b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_header_spec.js @@ -1,7 +1,7 @@ import { GlSearchBoxByType } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import { extendedWrapper } from 'helpers/vue_test_utils_helper'; -import DropdownHeader from '~/vue_shared/components/sidebar/labels_select_widget/dropdown_header.vue'; +import DropdownHeader from '~/sidebar/components/labels/labels_select_widget/dropdown_header.vue'; describe('DropdownHeader', () => { let wrapper; diff --git a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_value_spec.js b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_value_spec.js index 0c4f4b7d504..585048983c9 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_value_spec.js +++ b/spec/frontend/sidebar/components/labels/labels_select_widget/dropdown_value_spec.js @@ -1,7 +1,7 @@ import { GlLabel } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; -import DropdownValue from '~/vue_shared/components/sidebar/labels_select_widget/dropdown_value.vue'; +import DropdownValue from '~/sidebar/components/labels/labels_select_widget/dropdown_value.vue'; import { mockRegularLabel, mockScopedLabel } from './mock_data'; diff --git a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/label_item_spec.js b/spec/frontend/sidebar/components/labels/labels_select_widget/label_item_spec.js index 6e8841411a2..74188a77994 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/label_item_spec.js +++ b/spec/frontend/sidebar/components/labels/labels_select_widget/label_item_spec.js @@ -1,6 +1,6 @@ import { shallowMount } from '@vue/test-utils'; -import LabelItem from '~/vue_shared/components/sidebar/labels_select_widget/label_item.vue'; +import LabelItem from '~/sidebar/components/labels/labels_select_widget/label_item.vue'; import { mockRegularLabel } from './mock_data'; const mockLabel = { ...mockRegularLabel, set: true }; diff --git a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/labels_select_root_spec.js b/spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js index 74ddd07d041..ff8bbf7a1e9 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/labels_select_root_spec.js +++ b/spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js @@ -6,14 +6,14 @@ import waitForPromises from 'helpers/wait_for_promises'; import { createAlert } from '~/flash'; import { IssuableType } from '~/issues/constants'; import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue'; -import DropdownContents from '~/vue_shared/components/sidebar/labels_select_widget/dropdown_contents.vue'; -import DropdownValue from '~/vue_shared/components/sidebar/labels_select_widget/dropdown_value.vue'; -import issueLabelsQuery from '~/vue_shared/components/sidebar/labels_select_widget/graphql/issue_labels.query.graphql'; +import DropdownContents from '~/sidebar/components/labels/labels_select_widget/dropdown_contents.vue'; +import DropdownValue from '~/sidebar/components/labels/labels_select_widget/dropdown_value.vue'; +import issueLabelsQuery from '~/sidebar/components/labels/labels_select_widget/graphql/issue_labels.query.graphql'; import updateIssueLabelsMutation from '~/boards/graphql/issue_set_labels.mutation.graphql'; import updateMergeRequestLabelsMutation from '~/sidebar/queries/update_merge_request_labels.mutation.graphql'; import issuableLabelsSubscription from 'ee_else_ce/sidebar/queries/issuable_labels.subscription.graphql'; -import updateEpicLabelsMutation from '~/vue_shared/components/sidebar/labels_select_widget/graphql/epic_update_labels.mutation.graphql'; -import LabelsSelectRoot from '~/vue_shared/components/sidebar/labels_select_widget/labels_select_root.vue'; +import updateEpicLabelsMutation from '~/sidebar/components/labels/labels_select_widget/graphql/epic_update_labels.mutation.graphql'; +import LabelsSelectRoot from '~/sidebar/components/labels/labels_select_widget/labels_select_root.vue'; import { mockConfig, issuableLabelsQueryResponse, diff --git a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/mock_data.js b/spec/frontend/sidebar/components/labels/labels_select_widget/mock_data.js index 48530a0261f..48530a0261f 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_widget/mock_data.js +++ b/spec/frontend/sidebar/components/labels/labels_select_widget/mock_data.js diff --git a/spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js b/spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js index 625e67c7cc1..5f416db2676 100644 --- a/spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js +++ b/spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js @@ -171,6 +171,7 @@ describe('vue_shared/component/markdown/markdown_editor', () => { expect.objectContaining({ renderMarkdown: expect.any(Function), uploadsPath: window.uploads_path, + useBottomToolbar: false, markdown: value, }), ); diff --git a/spec/frontend/work_items/components/work_item_labels_spec.js b/spec/frontend/work_items/components/work_item_labels_spec.js index 22ac709a7ff..083bb5bc4a4 100644 --- a/spec/frontend/work_items/components/work_item_labels_spec.js +++ b/spec/frontend/work_items/components/work_item_labels_spec.js @@ -5,7 +5,7 @@ import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; import { mountExtended } from 'helpers/vue_test_utils_helper'; import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants'; -import labelSearchQuery from '~/vue_shared/components/sidebar/labels_select_widget/graphql/project_labels.query.graphql'; +import labelSearchQuery from '~/sidebar/components/labels/labels_select_widget/graphql/project_labels.query.graphql'; import workItemQuery from '~/work_items/graphql/work_item.query.graphql'; import workItemLabelsSubscription from 'ee_else_ce/work_items/graphql/work_item_labels.subscription.graphql'; import updateWorkItemMutation from '~/work_items/graphql/update_work_item.mutation.graphql'; |