diff options
Diffstat (limited to 'test/NavBar.test.js')
-rw-r--r-- | test/NavBar.test.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/NavBar.test.js b/test/NavBar.test.js new file mode 100644 index 0000000..88bc5db --- /dev/null +++ b/test/NavBar.test.js @@ -0,0 +1,27 @@ +import { shallowMount } from '@vue/test-utils' +import NavBar from '../components/NavBar' + +describe('NavBar', () => { + // Now mount the component and you have the wrapper + const wrapper = shallowMount(NavBar) + + wrapper.setProps({ + title: 'Title', + routes: [ + { + path: '/', + name: 'Home' + } + ] + }) + + it('check title', () => { + expect(wrapper.html()).toContain( + '<nuxt-link to="/" class="title-name">Title</nuxt-link>' + ) + }) + + it('match snapshot', () => { + expect(wrapper.element).toMatchSnapshot() + }) +}) |