diff options
Diffstat (limited to 'spec/frontend/members/components/icons/private_icon_spec.js')
-rw-r--r-- | spec/frontend/members/components/icons/private_icon_spec.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/frontend/members/components/icons/private_icon_spec.js b/spec/frontend/members/components/icons/private_icon_spec.js new file mode 100644 index 00000000000..ea2b65e3307 --- /dev/null +++ b/spec/frontend/members/components/icons/private_icon_spec.js @@ -0,0 +1,30 @@ +import { GlIcon } from '@gitlab/ui'; +import { mountExtended } from 'helpers/vue_test_utils_helper'; +import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; +import PrivateIcon from '~/members/components/icons/private_icon.vue'; + +describe('PrivateIcon', () => { + let wrapper; + + const createComponent = () => { + wrapper = mountExtended(PrivateIcon, { + directives: { + GlTooltip: createMockDirective('gl-tooltip'), + }, + }); + }; + + beforeEach(() => { + createComponent(); + }); + + it('renders private icon with tooltip', () => { + const icon = wrapper.findComponent(GlIcon); + const tooltipDirective = getBinding(icon.element, 'gl-tooltip'); + + expect(icon.props('name')).toBe('eye-slash'); + expect(tooltipDirective.value).toBe( + 'Private group information is only accessible to its members.', + ); + }); +}); |