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

organizations_list_spec.js « components « index « organizations « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0b59c2123145e727bed6430e658da1aa5b548c8a (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
import { shallowMount } from '@vue/test-utils';
import OrganizationsList from '~/organizations/index/components/organizations_list.vue';
import OrganizationsListItem from '~/organizations/index/components/organizations_list_item.vue';
import { organizations } from '~/organizations/mock_data';

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

  const createComponent = () => {
    wrapper = shallowMount(OrganizationsList, {
      propsData: {
        organizations,
      },
    });
  };

  const findAllOrganizationsListItem = () => wrapper.findAllComponents(OrganizationsListItem);

  describe('template', () => {
    beforeEach(() => {
      createComponent();
    });

    it('renders a list item for each organization', () => {
      expect(findAllOrganizationsListItem()).toHaveLength(organizations.length);
    });
  });
});