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

upgrade_spec.js « security_configuration « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 20bb38aa46998f02752369a3d7b17090a7c1f35a (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
import { mount } from '@vue/test-utils';
import { UPGRADE_CTA } from '~/security_configuration/components/constants';
import Upgrade from '~/security_configuration/components/upgrade.vue';

const TEST_URL = 'http://www.example.test';
let wrapper;
const createComponent = (componentData = {}) => {
  wrapper = mount(Upgrade, componentData);
};

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

describe('Upgrade component', () => {
  beforeEach(() => {
    createComponent({ provide: { upgradePath: TEST_URL } });
  });

  it('renders correct text in link', () => {
    expect(wrapper.text()).toMatchInterpolatedText(UPGRADE_CTA);
  });

  it('renders link with correct default attributes', () => {
    expect(wrapper.find('a').attributes()).toMatchObject({
      href: TEST_URL,
      target: '_blank',
    });
  });
});