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

infrastructure_icon_and_name_spec.js « shared « components « infrastructure_registry « packages_and_registries « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: abb0d23b6e44370796130e9cee9a76dd604dc6d3 (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 { GlIcon } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import InfrastructureIconAndName from '~/packages_and_registries/infrastructure_registry/shared/infrastructure_icon_and_name.vue';

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

  const findIcon = () => wrapper.find(GlIcon);

  const mountComponent = () => {
    wrapper = shallowMount(InfrastructureIconAndName, {});
  };

  it('has an icon', () => {
    mountComponent();

    const icon = findIcon();

    expect(icon.exists()).toBe(true);
    expect(icon.props('name')).toBe('infrastructure-registry');
  });

  it('has the type fixed to terraform', () => {
    mountComponent();

    expect(wrapper.text()).toBe('Terraform');
  });
});