Welcome to mirror list, hosted at ThFree Co, Russian Federation.

following_tab_spec.js « components « profile « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c0583cf487716a5f7ff71f8ba596e1a8f5c03116 (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
31
32
import { GlBadge, GlTab } from '@gitlab/ui';

import { s__ } from '~/locale';
import FollowingTab from '~/profile/components/following_tab.vue';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';

describe('FollowingTab', () => {
  let wrapper;

  const createComponent = () => {
    wrapper = shallowMountExtended(FollowingTab, {
      provide: {
        followeesCount: 3,
      },
    });
  };

  it('renders `GlTab` and sets title', () => {
    createComponent();

    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');
  });
});