diff options
Diffstat (limited to 'spec/frontend/invite_member/components/invite_member_trigger_spec.js')
-rw-r--r-- | spec/frontend/invite_member/components/invite_member_trigger_spec.js | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/spec/frontend/invite_member/components/invite_member_trigger_spec.js b/spec/frontend/invite_member/components/invite_member_trigger_spec.js deleted file mode 100644 index 630e2dbfc16..00000000000 --- a/spec/frontend/invite_member/components/invite_member_trigger_spec.js +++ /dev/null @@ -1,48 +0,0 @@ -import { GlLink } from '@gitlab/ui'; -import { shallowMount } from '@vue/test-utils'; -import { mockTracking, unmockTracking, triggerEvent } from 'helpers/tracking_helper'; -import InviteMemberTrigger from '~/invite_member/components/invite_member_trigger.vue'; -import triggerProvides from './invite_member_trigger_mock_data'; - -const createComponent = () => { - return shallowMount(InviteMemberTrigger, { propsData: triggerProvides }); -}; - -describe('InviteMemberTrigger', () => { - let wrapper; - - beforeEach(() => { - wrapper = createComponent(); - }); - - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - - const findLink = () => wrapper.find(GlLink); - - describe('displayText', () => { - it('includes the correct displayText for the link', () => { - expect(findLink().text()).toBe(triggerProvides.displayText); - }); - }); - - describe('tracking', () => { - let trackingSpy; - - afterEach(() => { - unmockTracking(); - }); - - it('send an event when go to pipelines is clicked', () => { - trackingSpy = mockTracking('_category_', wrapper.element, jest.spyOn); - - triggerEvent(findLink().element); - - expect(trackingSpy).toHaveBeenCalledWith('_category_', triggerProvides.event, { - label: triggerProvides.label, - }); - }); - }); -}); |