diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-03 03:12:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-03 03:12:53 +0300 |
commit | a77c9fccd057514a8b78a10642779f54a22f3f76 (patch) | |
tree | 5746326ff4e1e25f01af2062454f90bdc3f57d35 /spec/frontend/profile | |
parent | a88ffaad9f9f321a71657ac0aca4d947f5bc6a5b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/profile')
-rw-r--r-- | spec/frontend/profile/components/followers_tab_spec.js | 21 | ||||
-rw-r--r-- | spec/frontend/profile/components/following_tab_spec.js | 21 |
2 files changed, 34 insertions, 8 deletions
diff --git a/spec/frontend/profile/components/followers_tab_spec.js b/spec/frontend/profile/components/followers_tab_spec.js index 4af428c4e0c..9cc5bdea9be 100644 --- a/spec/frontend/profile/components/followers_tab_spec.js +++ b/spec/frontend/profile/components/followers_tab_spec.js @@ -1,4 +1,4 @@ -import { GlTab } from '@gitlab/ui'; +import { GlBadge, GlTab } from '@gitlab/ui'; import { s__ } from '~/locale'; import FollowersTab from '~/profile/components/followers_tab.vue'; @@ -8,12 +8,25 @@ describe('FollowersTab', () => { let wrapper; const createComponent = () => { - wrapper = shallowMountExtended(FollowersTab); + wrapper = shallowMountExtended(FollowersTab, { + provide: { + followers: 2, + }, + }); }; - it('renders `GlTab` and sets `title` prop', () => { + it('renders `GlTab` and sets title', () => { createComponent(); - expect(wrapper.findComponent(GlTab).attributes('title')).toBe(s__('UserProfile|Followers')); + 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'); }); }); diff --git a/spec/frontend/profile/components/following_tab_spec.js b/spec/frontend/profile/components/following_tab_spec.js index 75123274ccb..c9d56360c3e 100644 --- a/spec/frontend/profile/components/following_tab_spec.js +++ b/spec/frontend/profile/components/following_tab_spec.js @@ -1,4 +1,4 @@ -import { GlTab } from '@gitlab/ui'; +import { GlBadge, GlTab } from '@gitlab/ui'; import { s__ } from '~/locale'; import FollowingTab from '~/profile/components/following_tab.vue'; @@ -8,12 +8,25 @@ describe('FollowingTab', () => { let wrapper; const createComponent = () => { - wrapper = shallowMountExtended(FollowingTab); + wrapper = shallowMountExtended(FollowingTab, { + provide: { + followees: 3, + }, + }); }; - it('renders `GlTab` and sets `title` prop', () => { + it('renders `GlTab` and sets title', () => { createComponent(); - expect(wrapper.findComponent(GlTab).attributes('title')).toBe(s__('UserProfile|Following')); + expect(wrapper.findComponent(GlTab).element.textContent).toContain( + s__('UserProfile|Following'), + ); + }); + + it('renders `GlBadge`, sets size and content', () => { + createComponent(); + + expect(wrapper.findComponent(GlBadge).attributes('size')).toBe('sm'); + expect(wrapper.findComponent(GlBadge).element.textContent).toBe('3'); }); }); |