summaryrefslogtreecommitdiff
path: root/spec/frontend/vue_mr_widget/components/mr_widget_icon_spec.js
blob: ebd10f31fa71f1a2e62f1f3fd8c02dbfc9d350bd (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
import { GlIcon } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import MrWidgetIcon from '~/vue_merge_request_widget/components/mr_widget_icon.vue';

const TEST_ICON = 'commit';

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

  beforeEach(() => {
    wrapper = shallowMount(MrWidgetIcon, {
      propsData: {
        name: TEST_ICON,
      },
    });
  });

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

  it('renders icon and container', () => {
    expect(wrapper.element.className).toContain('circle-icon-container');
    expect(wrapper.find(GlIcon).props('name')).toEqual(TEST_ICON);
  });
});