2020-01-08 15:08:01 +00:00
|
|
|
import { shallowMount } from '@vue/test-utils';
|
2018-11-29 22:57:30 +00:00
|
|
|
import MrWidgetIcon from '~/vue_merge_request_widget/components/mr_widget_icon.vue';
|
|
|
|
import Icon from '~/vue_shared/components/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', () => {
|
|
|
|
expect(wrapper.is('.circle-icon-container')).toBe(true);
|
|
|
|
expect(wrapper.find(Icon).props('name')).toEqual(TEST_ICON);
|
|
|
|
});
|
|
|
|
});
|