about summary refs log tree commit diff
path: root/test/components/NavBar.test.js
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-08-31 11:00:58 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-08-31 11:00:58 +0200
commitb259358616b5ca56e19b758b1f86ce2421f52c06 (patch)
tree1b7598c0b4bed7dcfaf3c009534872107888b7dc /test/components/NavBar.test.js
parentc27b3a8208fbfde63aa512ba9c5745cbee553eab (diff)
downloadpuszcza-b259358616b5ca56e19b758b1f86ce2421f52c06.tar.gz
puszcza-b259358616b5ca56e19b758b1f86ce2421f52c06.zip
Add snapshots
Diffstat (limited to 'test/components/NavBar.test.js')
-rw-r--r--test/components/NavBar.test.js27
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()
+  })
+})