diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-19 17:16:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-19 17:16:28 +0300 |
commit | e4384360a16dd9a19d4d2d25d0ef1f2b862ed2a6 (patch) | |
tree | 2fcdfa7dcdb9db8f5208b2562f4b4e803d671243 /spec/frontend/users/profile | |
parent | ffda4e7bcac36987f936b4ba515995a6698698f0 (diff) |
Add latest changes from gitlab-org/gitlab@16-2-stable-eev16.2.0-rc42
Diffstat (limited to 'spec/frontend/users/profile')
-rw-r--r-- | spec/frontend/users/profile/actions/components/user_actions_app_spec.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/frontend/users/profile/actions/components/user_actions_app_spec.js b/spec/frontend/users/profile/actions/components/user_actions_app_spec.js new file mode 100644 index 00000000000..d27962440ee --- /dev/null +++ b/spec/frontend/users/profile/actions/components/user_actions_app_spec.js @@ -0,0 +1,38 @@ +import { GlDisclosureDropdown } from '@gitlab/ui'; +import { mountExtended } from 'helpers/vue_test_utils_helper'; +import UserActionsApp from '~/users/profile/actions/components/user_actions_app.vue'; + +describe('User Actions App', () => { + let wrapper; + + const USER_ID = 'test-id'; + + const createWrapper = (propsData = {}) => { + wrapper = mountExtended(UserActionsApp, { + propsData: { + userId: USER_ID, + ...propsData, + }, + }); + }; + + const findDropdown = () => wrapper.findComponent(GlDisclosureDropdown); + const findActions = () => wrapper.findAllByTestId('disclosure-dropdown-item'); + const findAction = (position = 0) => findActions().at(position); + + it('shows dropdown', () => { + createWrapper(); + expect(findDropdown().exists()).toBe(true); + }); + + it('shows actions correctly', () => { + createWrapper(); + expect(findActions()).toHaveLength(1); + }); + + it('shows copy user id action', () => { + createWrapper(); + expect(findAction().text()).toBe(`Copy user ID: ${USER_ID}`); + expect(findAction().findComponent('button').attributes('data-clipboard-text')).toBe(USER_ID); + }); +}); |