diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 21:09:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 21:09:51 +0300 |
commit | 9ee2305f46a2b3d1d1e8a1f1182512599a74dbe1 (patch) | |
tree | 82c0631433839156f7d2fa88a5026c385b2b5703 /spec/frontend/pipelines | |
parent | 9498dc957345829f29fe0bc4e55c969783b457be (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/pipelines')
-rw-r--r-- | spec/frontend/pipelines/pipeline_details_header_spec.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/frontend/pipelines/pipeline_details_header_spec.js b/spec/frontend/pipelines/pipeline_details_header_spec.js index 828c90211ec..18ae7454a7b 100644 --- a/spec/frontend/pipelines/pipeline_details_header_spec.js +++ b/spec/frontend/pipelines/pipeline_details_header_spec.js @@ -1,9 +1,10 @@ -import { GlAlert, GlBadge, GlLoadingIcon, GlModal } from '@gitlab/ui'; +import { GlAlert, GlBadge, GlLoadingIcon, GlModal, GlSprintf } from '@gitlab/ui'; import Vue, { nextTick } from 'vue'; import VueApollo from 'vue-apollo'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; +import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import PipelineDetailsHeader from '~/pipelines/components/pipeline_details_header.vue'; import { BUTTON_TOOLTIP_RETRY, BUTTON_TOOLTIP_CANCEL } from '~/pipelines/constants'; import TimeAgo from '~/pipelines/components/pipelines_list/time_ago.vue'; @@ -69,6 +70,7 @@ describe('Pipeline details header', () => { const findCancelButton = () => wrapper.findByTestId('cancel-pipeline'); const findDeleteButton = () => wrapper.findByTestId('delete-pipeline'); const findDeleteModal = () => wrapper.findComponent(GlModal); + const findPipelineUserLink = () => wrapper.findByTestId('pipeline-user-link'); const defaultHandlers = [[getPipelineDetailsQuery, successHandler]]; @@ -123,6 +125,7 @@ describe('Pipeline details header', () => { }, }, }, + stubs: { GlSprintf }, apolloProvider: createMockApolloProvider(handlers), }); }; @@ -177,6 +180,23 @@ describe('Pipeline details header', () => { it('displays ref text', () => { expect(findPipelineRefText()).toBe('Related merge request !1 to merge test'); }); + + it('displays pipeline user link with required user popover attributes', () => { + const { + data: { + project: { + pipeline: { user }, + }, + }, + } = pipelineHeaderSuccess; + + const userId = getIdFromGraphQLId(user.id).toString(); + + expect(findPipelineUserLink().classes()).toContain('js-user-link'); + expect(findPipelineUserLink().attributes('data-user-id')).toBe(userId); + expect(findPipelineUserLink().attributes('data-username')).toBe(user.username); + expect(findPipelineUserLink().attributes('href')).toBe(user.webUrl); + }); }); describe('without pipeline name', () => { |