2020-01-08 15:08:01 +00:00
|
|
|
import { shallowMount } from '@vue/test-utils';
|
2020-08-24 15:10:11 +00:00
|
|
|
import { GlIcon } from '@gitlab/ui';
|
2018-11-29 22:57:30 +00:00
|
|
|
import MrWidgetIcon from '~/vue_merge_request_widget/components/mr_widget_icon.vue';
|
|
|
|
|
|
|
|
const TEST_ICON = 'commit';
|
|
|
|
|
|
|
|
describe('MrWidgetIcon', () => {
|
|
|
|
let wrapper;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
2020-01-08 15:08:01 +00:00
|
|
|
wrapper = shallowMount(MrWidgetIcon, {
|
2018-11-29 22:57:30 +00:00
|
|
|
propsData: {
|
|
|
|
name: TEST_ICON,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
wrapper.destroy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders icon and container', () => {
|
2020-12-24 09:10:15 +00:00
|
|
|
expect(wrapper.element.className).toContain('circle-icon-container');
|
2020-08-24 15:10:11 +00:00
|
|
|
expect(wrapper.find(GlIcon).props('name')).toEqual(TEST_ICON);
|
2018-11-29 22:57:30 +00:00
|
|
|
});
|
|
|
|
});
|