diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-25 21:08:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-25 21:08:55 +0300 |
commit | 1e3f5ab634699e9d50779f05d2ae8dfc8a3ab9b3 (patch) | |
tree | c96727e136f4dc4fdbc1190895439d41e0b07fc5 /spec/frontend/invite_members/components | |
parent | ba8e92f7c9938d7dba333d2396cdd14bfa0de726 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/invite_members/components')
-rw-r--r-- | spec/frontend/invite_members/components/invite_members_trigger_spec.js | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/spec/frontend/invite_members/components/invite_members_trigger_spec.js b/spec/frontend/invite_members/components/invite_members_trigger_spec.js index cdb6182e2ae..58c40a49b3c 100644 --- a/spec/frontend/invite_members/components/invite_members_trigger_spec.js +++ b/spec/frontend/invite_members/components/invite_members_trigger_spec.js @@ -1,4 +1,4 @@ -import { GlButton, GlLink, GlDropdownItem } from '@gitlab/ui'; +import { GlButton, GlLink, GlDropdownItem, GlDisclosureDropdownItem } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import InviteMembersTrigger from '~/invite_members/components/invite_members_trigger.vue'; import eventHub from '~/invite_members/event_hub'; @@ -7,6 +7,7 @@ import { TRIGGER_DEFAULT_QA_SELECTOR, TRIGGER_ELEMENT_WITH_EMOJI, TRIGGER_ELEMENT_DROPDOWN_WITH_EMOJI, + TRIGGER_ELEMENT_DISCLOSURE_DROPDOWN, } from '~/invite_members/constants'; import { GlEmoji } from '../mock_data/member_modal'; @@ -23,6 +24,7 @@ const triggerComponent = { anchor: GlLink, 'text-emoji': GlLink, 'dropdown-text-emoji': GlDropdownItem, + 'dropdown-text': GlButton, }; const createComponent = (props = {}) => { @@ -34,6 +36,8 @@ const createComponent = (props = {}) => { }, stubs: { GlEmoji, + GlDisclosureDropdownItem, + GlButton, }, }); }; @@ -116,3 +120,22 @@ describe('dropdown item with emoji', () => { expect(findEmoji().attributes('data-name')).toBe('shaking_hands'); }); }); + +describe('disclosure dropdown item', () => { + const findTrigger = () => wrapper.findComponent(GlDisclosureDropdownItem); + + beforeEach(() => { + createComponent({ triggerElement: TRIGGER_ELEMENT_DISCLOSURE_DROPDOWN }); + }); + + it('renders a trigger button', () => { + expect(findTrigger().exists()).toBe(true); + expect(findTrigger().text()).toBe(displayText); + }); + + it('emits modalOpened which clicked', () => { + findTrigger().vm.$emit('action'); + + expect(wrapper.emitted('modal-opened')).toHaveLength(1); + }); +}); |