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

jira_upgrade_cta_spec.js « components « edit « integrations « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e49a16196276753bea570809cca575c0a7e808ca (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 { shallowMount } from '@vue/test-utils';
import JiraUpgradeCta from '~/integrations/edit/components/jira_upgrade_cta.vue';

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

  const contentMessage = 'Upgrade your plan to enable this feature of the Jira Integration.';

  const createComponent = (propsData) => {
    wrapper = shallowMount(JiraUpgradeCta, {
      propsData,
    });
  };

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

  it('displays the correct message for premium and lower users', () => {
    createComponent({ showPremiumMessage: true });
    expect(wrapper.html()).toContain('This is a Premium feature');
    expect(wrapper.html()).toContain(contentMessage);
  });

  it('displays the correct message for ultimate and lower users', () => {
    createComponent({ showUltimateMessage: true });
    expect(wrapper.html()).toContain('This is an Ultimate feature');
    expect(wrapper.html()).toContain(contentMessage);
  });
});