From 51b96f0c0bc9e00477e24d1d799dba0e3a519f24 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Fri, 30 Aug 2019 22:31:54 +0200 Subject: Add NavBar test --- test/NavLink.test.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'test/NavLink.test.js') diff --git a/test/NavLink.test.js b/test/NavLink.test.js index 8a1f144..aeb16d0 100644 --- a/test/NavLink.test.js +++ b/test/NavLink.test.js @@ -1,9 +1,9 @@ -import { mount } from '@vue/test-utils' +import { shallowMount } from '@vue/test-utils' import NavLink from '../components/NavLink' describe('NavLink', () => { // Now mount the component and you have the wrapper - const wrapper = mount(NavLink) + const wrapper = shallowMount(NavLink) wrapper.setProps({ link: '/link', name: 'Link' }) @@ -12,4 +12,12 @@ describe('NavLink', () => { `` ) }) + + it('check text', () => { + expect(wrapper.text()).toBe('Link') + }) + + it('match snapshot', () => { + expect(wrapper.element).toMatchSnapshot() + }) }) -- cgit 1.4.1