@mekari/mekari-ui-vue
Version:
--- General web components in Mekari. The components are made using vue.js as its framework. Styling of components on Mekari UI Vue uses [Mekari UI Toolkit](https://bitbucket.org/mid-kelola-indonesia/mekari-ui-toolkit/src/master/). Don't forget to import
41 lines (33 loc) • 875 B
JavaScript
import MLink from './index.vue';
import { shallowMount } from '@vue/test-utils';
import { BLink } from 'bootstrap-vue';
describe('Mekari UI Link Component', () => {
let wrapper;
afterEach(() => {
wrapper.destroy();
});
it('should match snapshot', () => {
wrapper = shallowMount(MLink, {
propsData: {
link: 'Link',
},
});
expect(wrapper.element).toMatchSnapshot();
});
it('should match set text from link props', () => {
wrapper = shallowMount(MLink, {
propsData: {
link: 'New Link',
},
});
expect(wrapper.findComponent(BLink).text()).toBe('New Link');
});
it('should match set text from default slots', () => {
wrapper = shallowMount(MLink, {
slots: {
default: 'New Link',
},
});
expect(wrapper.findComponent(BLink).text()).toBe('New Link');
});
});