2020-11-24 15:15:51 +05:30
|
|
|
import { GlIcon } from '@gitlab/ui';
|
2021-03-11 19:13:27 +05:30
|
|
|
import { shallowMount } from '@vue/test-utils';
|
2019-02-15 15:39:39 +05:30
|
|
|
import MrWidgetIcon from '~/vue_merge_request_widget/components/mr_widget_icon.vue';
|
|
|
|
|
|
|
|
const TEST_ICON = 'commit';
|
|
|
|
|
|
|
|
describe('MrWidgetIcon', () => {
|
|
|
|
let wrapper;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
2020-03-13 15:44:24 +05:30
|
|
|
wrapper = shallowMount(MrWidgetIcon, {
|
2019-02-15 15:39:39 +05:30
|
|
|
propsData: {
|
|
|
|
name: TEST_ICON,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
wrapper.destroy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders icon and container', () => {
|
2021-03-08 18:12:59 +05:30
|
|
|
expect(wrapper.element.className).toContain('circle-icon-container');
|
2020-11-24 15:15:51 +05:30
|
|
|
expect(wrapper.find(GlIcon).props('name')).toEqual(TEST_ICON);
|
2019-02-15 15:39:39 +05:30
|
|
|
});
|
|
|
|
});
|