30 lines
908 B
JavaScript
30 lines
908 B
JavaScript
import { shallowMount } from '@vue/test-utils';
|
|
import navButton from '@/iss-components/nav-button/nav-button';
|
|
|
|
describe('NavButton', () => {
|
|
it('should display input when type is button', () => {
|
|
const wrapper = shallowMount(navButton, {
|
|
propsData: {
|
|
text: 'Hello',
|
|
scenario: 'test',
|
|
type: 'button'
|
|
}
|
|
});
|
|
|
|
expect(wrapper.find('input').exists()).toBe(true);
|
|
expect(wrapper.find('p').exists()).toBe(false);
|
|
});
|
|
|
|
it('should display p element when type is text', () => {
|
|
const wrapper = shallowMount(navButton, {
|
|
propsData: {
|
|
text: 'Hello',
|
|
scenario: 'test',
|
|
type: 'text'
|
|
}
|
|
});
|
|
|
|
expect(wrapper.find('input').exists()).toBe(false);
|
|
expect(wrapper.find('p').exists()).toBe(true);
|
|
});
|
|
});
|