diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-24 03:08:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-24 03:08:09 +0300 |
commit | a9720e77c10b98e427e54384b507683d4c4bfbbd (patch) | |
tree | 35448d685e5e29cad7563619f8c0de3c411453f7 /spec | |
parent | 145fb28542af4441ee8dc5752f9879ec1c1de15d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
3 files changed, 23 insertions, 16 deletions
diff --git a/spec/frontend/batch_comments/stores/modules/batch_comments/actions_spec.js b/spec/frontend/batch_comments/stores/modules/batch_comments/actions_spec.js index 172b510645d..9f50b12bac2 100644 --- a/spec/frontend/batch_comments/stores/modules/batch_comments/actions_spec.js +++ b/spec/frontend/batch_comments/stores/modules/batch_comments/actions_spec.js @@ -298,14 +298,18 @@ describe('Batch comments store actions', () => { const draft = { discussion_id: '1', id: '2', + file_path: 'lib/example.js', }; actions.scrollToDraft({ dispatch, rootGetters }, draft); - expect(dispatch.mock.calls[0]).toEqual([ - 'expandDiscussion', - { discussionId: '1' }, - { root: true }, + expect(dispatch.mock.calls).toEqual([ + [ + 'diffs/setFileCollapsedAutomatically', + { filePath: draft.file_path, collapsed: false }, + { root: true }, + ], + ['expandDiscussion', { discussionId: '1' }, { root: true }], ]); expect(window.mrTabs.tabShown).toHaveBeenCalledWith('diffs'); diff --git a/spec/frontend/projects/new/components/new_project_url_select_spec.js b/spec/frontend/projects/new/components/new_project_url_select_spec.js index ba22622e1f7..b6d4ee32cf5 100644 --- a/spec/frontend/projects/new/components/new_project_url_select_spec.js +++ b/spec/frontend/projects/new/components/new_project_url_select_spec.js @@ -4,6 +4,7 @@ import { GlDropdownItem, GlDropdownSectionHeader, GlSearchBoxByType, + GlTruncate, } from '@gitlab/ui'; import { mount, shallowMount } from '@vue/test-utils'; import Vue, { nextTick } from 'vue'; @@ -15,7 +16,6 @@ import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import eventHub from '~/projects/new/event_hub'; import NewProjectUrlSelect from '~/projects/new/components/new_project_url_select.vue'; import searchQuery from '~/projects/new/queries/search_namespaces_where_user_can_create_projects.query.graphql'; -import { s__ } from '~/locale'; describe('NewProjectUrlSelect component', () => { let wrapper; @@ -90,6 +90,7 @@ describe('NewProjectUrlSelect component', () => { const findButtonLabel = () => wrapper.findComponent(GlButton); const findDropdown = () => wrapper.findComponent(GlDropdown); + const findSelectedPath = () => wrapper.findComponent(GlTruncate); const findInput = () => wrapper.findComponent(GlSearchBoxByType); const findHiddenNamespaceInput = () => wrapper.find('[name="project[namespace_id]"]'); @@ -121,14 +122,15 @@ describe('NewProjectUrlSelect component', () => { describe('when namespaceId is provided', () => { beforeEach(() => { - wrapper = mountComponent(); + wrapper = mountComponent({ mountFn: mount }); }); it('renders a dropdown with the given namespace full path as the text', () => { - const dropdownProps = findDropdown().props(); + expect(findSelectedPath().props('text')).toBe(defaultProvide.namespaceFullPath); + }); - expect(dropdownProps.text).toBe(defaultProvide.namespaceFullPath); - expect(dropdownProps.toggleClass).not.toContain('gl-text-gray-500!'); + it('renders a dropdown without the class', () => { + expect(findDropdown().props('toggleClass')).not.toContain('gl-text-gray-500!'); }); it('renders a hidden input with the given namespace id', () => { @@ -150,14 +152,15 @@ describe('NewProjectUrlSelect component', () => { }; beforeEach(() => { - wrapper = mountComponent({ provide }); + wrapper = mountComponent({ provide, mountFn: mount }); }); it("renders a dropdown with the user's namespace full path as the text", () => { - const dropdownProps = findDropdown().props(); + expect(findSelectedPath().props('text')).toBe('Pick a group or namespace'); + }); - expect(dropdownProps.text).toBe(s__('ProjectsNew|Pick a group or namespace')); - expect(dropdownProps.toggleClass).toContain('gl-text-gray-500!'); + it('renders a dropdown with the class', () => { + expect(findDropdown().props('toggleClass')).toContain('gl-text-gray-500!'); }); it("renders a hidden input with the user's namespace id", () => { @@ -236,8 +239,8 @@ describe('NewProjectUrlSelect component', () => { expect(listItems.at(2).text()).toBe(data.currentUser.groups.nodes[2].fullPath); }); - it('sets the selection to the group', async () => { - expect(findDropdown().props('text')).toBe(fullPath); + it('sets the selection to the group', () => { + expect(findSelectedPath().props('text')).toBe(fullPath); }); }); diff --git a/spec/serializers/issue_entity_spec.rb b/spec/serializers/issue_entity_spec.rb index 9525ed02314..6b9c703c627 100644 --- a/spec/serializers/issue_entity_spec.rb +++ b/spec/serializers/issue_entity_spec.rb @@ -139,7 +139,7 @@ RSpec.describe IssueEntity do end it 'returns archived project doc' do - expect(subject[:archived_project_docs_path]).to eq('/help/user/project/settings/index.md#archiving-a-project') + expect(subject[:archived_project_docs_path]).to eq('/help/user/project/settings/index.md#archive-a-project') end end end |