blob: ea2b65e3307d3eabe5479c109abca2a7f2485a8d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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.',
);
});
});
|