summaryrefslogtreecommitdiff
path: root/spec/frontend/security_configuration/upgrade_spec.js
blob: 0ab1108b2652202da5c6d4e4fcf9e20a3985f1c9 (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
import { mount } from '@vue/test-utils';
import { UPGRADE_CTA } from '~/security_configuration/components/features_constants';
import Upgrade from '~/security_configuration/components/upgrade.vue';

let wrapper;
const createComponent = () => {
  wrapper = mount(Upgrade, {});
};

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

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

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

  it('renders link with correct attributes', () => {
    expect(wrapper.find('a').attributes()).toMatchObject({
      href: 'https://about.gitlab.com/pricing/',
      target: '_blank',
    });
  });
});