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

pipeline_schedules_table_spec.js « table « components « pipeline_schedules « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 914897946eebc4874a1df29d87806f547875402b (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
import { GlTableLite } from '@gitlab/ui';
import { mountExtended } from 'helpers/vue_test_utils_helper';
import PipelineSchedulesTable from '~/pipeline_schedules/components/table/pipeline_schedules_table.vue';
import { mockPipelineScheduleNodes } from '../../mock_data';

describe('Pipeline schedules table', () => {
  let wrapper;

  const defaultProps = {
    schedules: mockPipelineScheduleNodes,
  };

  const createComponent = (props = defaultProps) => {
    wrapper = mountExtended(PipelineSchedulesTable, {
      propsData: {
        ...props,
      },
    });
  };

  const findTable = () => wrapper.findComponent(GlTableLite);
  const findScheduleDescription = () => wrapper.findByTestId('pipeline-schedule-description');

  beforeEach(() => {
    createComponent();
  });

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

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

  it('displays schedule description', () => {
    expect(findScheduleDescription().text()).toBe('pipeline schedule');
  });
});