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

runner_jobs_empty_state_spec.js « components « runner « ci « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 59c9383cb31ababd2210d8468ab20d5e1ad20b54 (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
import EMPTY_STATE_SVG_URL from '@gitlab/svgs/dist/illustrations/pipelines_empty.svg?url';

import { shallowMount } from '@vue/test-utils';
import { GlEmptyState } from '@gitlab/ui';
import RunnerJobsEmptyState from '~/ci/runner/components/runner_jobs_empty_state.vue';

const DEFAULT_PROPS = {
  emptyTitle: 'This runner has not run any jobs',
  emptyDescription:
    'Make sure the runner is online and available to run jobs (not paused). Jobs display here when the runner picks them up.',
};

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

  const mountComponent = () => {
    wrapper = shallowMount(RunnerJobsEmptyState);
  };

  const findEmptyState = () => wrapper.findComponent(GlEmptyState);

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

  describe('empty', () => {
    it('should show an empty state if it is empty', () => {
      const emptyState = findEmptyState();

      expect(emptyState.props('svgPath')).toBe(EMPTY_STATE_SVG_URL);
      expect(emptyState.props('title')).toBe(DEFAULT_PROPS.emptyTitle);
      expect(emptyState.text()).toContain(DEFAULT_PROPS.emptyDescription);
    });
  });
});