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

incubation_banner_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: 92bc39bdff971158d6f481ace19585887908fd22 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { mount } from '@vue/test-utils';
import { GlAlert, GlLink } from '@gitlab/ui';
import IncubationBanner from '~/google_cloud/components/incubation_banner.vue';

describe('google_cloud/components/incubation_banner', () => {
  let wrapper;

  const findAlert = () => wrapper.findComponent(GlAlert);
  const findLinks = () => wrapper.findAllComponents(GlLink);
  const findFeatureRequestLink = () => findLinks().at(0);
  const findReportBugLink = () => findLinks().at(1);
  const findShareFeedbackLink = () => findLinks().at(2);

  beforeEach(() => {
    wrapper = mount(IncubationBanner);
  });

  it('contains alert', () => {
    expect(findAlert().exists()).toBe(true);
  });

  it('contains relevant text', () => {
    expect(findAlert().text()).toContain(
      'This is an experimental feature developed by GitLab Incubation Engineering.',
    );
  });

  describe('has relevant gl-links', () => {
    it('three in total', () => {
      expect(findLinks().length).toBe(3);
    });

    it('contains feature request link', () => {
      const link = findFeatureRequestLink();
      const expected =
        'https://gitlab.com/gitlab-org/incubation-engineering/five-minute-production/feedback/-/issues/new?issuable_template=feature_request';
      expect(link.text()).toBe('request a feature');
      expect(link.attributes('href')).toBe(expected);
    });

    it('contains report bug link', () => {
      const link = findReportBugLink();
      const expected =
        'https://gitlab.com/gitlab-org/incubation-engineering/five-minute-production/feedback/-/issues/new?issuable_template=report_bug';
      expect(link.text()).toBe('report a bug');
      expect(link.attributes('href')).toBe(expected);
    });

    it('contains share feedback link', () => {
      const link = findShareFeedbackLink();
      const expected =
        'https://gitlab.com/gitlab-org/incubation-engineering/five-minute-production/feedback/-/issues/new?issuable_template=general_feedback';
      expect(link.text()).toBe('share feedback');
      expect(link.attributes('href')).toBe(expected);
    });
  });
});