diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-18 15:10:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-18 15:10:03 +0300 |
commit | 38a1a6cb91bd4cd95d18db9a4bfd219bfb75401b (patch) | |
tree | 7b3d217aa21180af6256b99a8a6ba76775edd4b8 /spec/frontend/vue_shared/components/user_popover | |
parent | e6779ab919283efbd93a0e3ed2356c58b19f9c93 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared/components/user_popover')
-rw-r--r-- | spec/frontend/vue_shared/components/user_popover/user_popover_spec.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/spec/frontend/vue_shared/components/user_popover/user_popover_spec.js b/spec/frontend/vue_shared/components/user_popover/user_popover_spec.js index 87fe8619f28..538e67ef354 100644 --- a/spec/frontend/vue_shared/components/user_popover/user_popover_spec.js +++ b/spec/frontend/vue_shared/components/user_popover/user_popover_spec.js @@ -1,5 +1,5 @@ -import { GlSkeletonLoader, GlSprintf, GlIcon } from '@gitlab/ui'; -import { shallowMount } from '@vue/test-utils'; +import { GlSkeletonLoader, GlIcon } from '@gitlab/ui'; +import { mountExtended } from 'helpers/vue_test_utils_helper'; import { AVAILABILITY_STATUS } from '~/set_status_modal/utils'; import UserNameWithStatus from '~/sidebar/components/assignees/user_name_with_status.vue'; import UserPopover from '~/vue_shared/components/user_popover/user_popover.vue'; @@ -13,6 +13,7 @@ const DEFAULT_PROPS = { bio: null, workInformation: null, status: null, + pronouns: 'they/them', loaded: true, }, }; @@ -30,23 +31,18 @@ describe('User Popover Component', () => { wrapper.destroy(); }); - const findByTestId = (testid) => wrapper.find(`[data-testid="${testid}"]`); const findUserStatus = () => wrapper.find('.js-user-status'); const findTarget = () => document.querySelector('.js-user-link'); const findUserName = () => wrapper.find(UserNameWithStatus); - const findSecurityBotDocsLink = () => findByTestId('user-popover-bot-docs-link'); + const findSecurityBotDocsLink = () => wrapper.findByTestId('user-popover-bot-docs-link'); const createWrapper = (props = {}, options = {}) => { - wrapper = shallowMount(UserPopover, { + wrapper = mountExtended(UserPopover, { propsData: { ...DEFAULT_PROPS, target: findTarget(), ...props, }, - stubs: { - GlSprintf, - UserNameWithStatus, - }, ...options, }); }; @@ -232,6 +228,12 @@ describe('User Popover Component', () => { expect(wrapper.text()).not.toContain('(Busy)'); }); + + it('passes `pronouns` prop to `UserNameWithStatus` component', () => { + createWrapper(); + + expect(findUserName().props('pronouns')).toBe('they/them'); + }); }); describe('bot user', () => { |