diff options
Diffstat (limited to 'test/components/NavBar.test.js')
-rw-r--r-- | test/components/NavBar.test.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/components/NavBar.test.js b/test/components/NavBar.test.js new file mode 100644 index 0000000..be61915 --- /dev/null +++ b/test/components/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() + }) +}) |