about summary refs log tree commit diff
path: root/test/NavBar.test.js
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-08-30 22:31:54 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-08-30 22:31:54 +0200
commit51b96f0c0bc9e00477e24d1d799dba0e3a519f24 (patch)
tree59fbd931207ba86976418cea57c928beee2e31cc /test/NavBar.test.js
parentf0d5b38eb23e85e993bf040f7e84c5b6b16d7566 (diff)
downloadpuszcza-51b96f0c0bc9e00477e24d1d799dba0e3a519f24.tar.gz
puszcza-51b96f0c0bc9e00477e24d1d799dba0e3a519f24.zip
Add NavBar test
Diffstat (limited to 'test/NavBar.test.js')
-rw-r--r--test/NavBar.test.js27
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()
+  })
+})