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

deployments_service_table_spec.js « components « google_cloud « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 76c3bfd00a82eb7633b067e4faf3c27d3adc1e61 (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
33
34
35
36
37
38
39
40
import { mount } from '@vue/test-utils';
import { GlButton, GlTable } from '@gitlab/ui';
import DeploymentsServiceTable from '~/google_cloud/components/deployments_service_table.vue';

describe('google_cloud DeploymentsServiceTable component', () => {
  let wrapper;

  const findTable = () => wrapper.findComponent(GlTable);
  const findButtons = () => findTable().findAllComponents(GlButton);
  const findCloudRunButton = () => findButtons().at(0);
  const findCloudStorageButton = () => findButtons().at(1);

  beforeEach(() => {
    const propsData = {
      cloudRunUrl: '#url-deployments-cloud-run',
      cloudStorageUrl: '#url-deployments-cloud-storage',
    };
    wrapper = mount(DeploymentsServiceTable, { propsData });
  });

  afterEach(() => {
    wrapper.destroy();
  });

  it('should contain a table', () => {
    expect(findTable().exists()).toBe(true);
  });

  it('should contain configure cloud run button', () => {
    const cloudRunButton = findCloudRunButton();
    expect(cloudRunButton.exists()).toBe(true);
    expect(cloudRunButton.props().disabled).toBe(true);
  });

  it('should contain configure cloud storage button', () => {
    const cloudStorageButton = findCloudStorageButton();
    expect(cloudStorageButton.exists()).toBe(true);
    expect(cloudStorageButton.props().disabled).toBe(true);
  });
});