summaryrefslogtreecommitdiff
path: root/spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_section_card_spec.js
blob: 3a511a009a98659e04dadd7b6cb9f4c0726563f3 (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
import { shallowMount } from '@vue/test-utils';
import LearnGitlabSectionCard from '~/pages/projects/learn_gitlab/components/learn_gitlab_section_card.vue';
import { testActions } from './mock_data';

const defaultSection = 'workspace';
const testImage = 'workspace.svg';

describe('Learn GitLab Section Card', () => {
  let wrapper;

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

  const createWrapper = () => {
    wrapper = shallowMount(LearnGitlabSectionCard, {
      propsData: { section: defaultSection, actions: testActions, svg: testImage },
    });
  };

  it('renders correctly', () => {
    createWrapper({ completed: false });

    expect(wrapper.element).toMatchSnapshot();
  });
});