2023-05-27 22:25:52 +05:30
|
|
|
import { GlBadge, GlTab } from '@gitlab/ui';
|
2023-04-23 21:23:45 +05:30
|
|
|
|
|
|
|
import { s__ } from '~/locale';
|
|
|
|
import FollowersTab from '~/profile/components/followers_tab.vue';
|
|
|
|
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
|
|
|
|
|
|
|
|
describe('FollowersTab', () => {
|
|
|
|
let wrapper;
|
|
|
|
|
|
|
|
const createComponent = () => {
|
2023-05-27 22:25:52 +05:30
|
|
|
wrapper = shallowMountExtended(FollowersTab, {
|
|
|
|
provide: {
|
|
|
|
followers: 2,
|
|
|
|
},
|
|
|
|
});
|
2023-04-23 21:23:45 +05:30
|
|
|
};
|
|
|
|
|
2023-05-27 22:25:52 +05:30
|
|
|
it('renders `GlTab` and sets title', () => {
|
2023-04-23 21:23:45 +05:30
|
|
|
createComponent();
|
|
|
|
|
2023-05-27 22:25:52 +05:30
|
|
|
expect(wrapper.findComponent(GlTab).element.textContent).toContain(
|
|
|
|
s__('UserProfile|Followers'),
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders `GlBadge`, sets size and content', () => {
|
|
|
|
createComponent();
|
|
|
|
|
|
|
|
expect(wrapper.findComponent(GlBadge).attributes('size')).toBe('sm');
|
|
|
|
expect(wrapper.findComponent(GlBadge).element.textContent).toBe('2');
|
2023-04-23 21:23:45 +05:30
|
|
|
});
|
|
|
|
});
|