diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/frontend/vue_shared/components/members/table/member_source_spec.js | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) | |
download | gitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/frontend/vue_shared/components/members/table/member_source_spec.js')
-rw-r--r-- | spec/frontend/vue_shared/components/members/table/member_source_spec.js | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/spec/frontend/vue_shared/components/members/table/member_source_spec.js b/spec/frontend/vue_shared/components/members/table/member_source_spec.js deleted file mode 100644 index 8b914d76674..00000000000 --- a/spec/frontend/vue_shared/components/members/table/member_source_spec.js +++ /dev/null @@ -1,71 +0,0 @@ -import { mount, createWrapper } from '@vue/test-utils'; -import { getByText as getByTextHelper } from '@testing-library/dom'; -import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; -import MemberSource from '~/vue_shared/components/members/table/member_source.vue'; - -describe('MemberSource', () => { - let wrapper; - - const createComponent = propsData => { - wrapper = mount(MemberSource, { - propsData: { - memberSource: { - id: 102, - name: 'Foo bar', - webUrl: 'https://gitlab.com/groups/foo-bar', - }, - ...propsData, - }, - directives: { - GlTooltip: createMockDirective(), - }, - }); - }; - - const getByText = (text, options) => - createWrapper(getByTextHelper(wrapper.element, text, options)); - - const getTooltipDirective = elementWrapper => getBinding(elementWrapper.element, 'gl-tooltip'); - - afterEach(() => { - wrapper.destroy(); - }); - - describe('direct member', () => { - it('displays "Direct member"', () => { - createComponent({ - isDirectMember: true, - }); - - expect(getByText('Direct member').exists()).toBe(true); - }); - }); - - describe('inherited member', () => { - let sourceGroupLink; - - beforeEach(() => { - createComponent({ - isDirectMember: false, - }); - - sourceGroupLink = getByText('Foo bar'); - }); - - it('displays a link to source group', () => { - createComponent({ - isDirectMember: false, - }); - - expect(sourceGroupLink.exists()).toBe(true); - expect(sourceGroupLink.attributes('href')).toBe('https://gitlab.com/groups/foo-bar'); - }); - - it('displays tooltip with "Inherited"', () => { - const tooltipDirective = getTooltipDirective(sourceGroupLink); - - expect(tooltipDirective).not.toBeUndefined(); - expect(sourceGroupLink.attributes('title')).toBe('Inherited'); - }); - }); -}); |