about summary refs log tree commit diff
path: root/test/NavLink.test.js
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-08-30 10:36:23 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-08-30 10:36:23 +0200
commit021b6e975f6a263b96074502cabe4baf0eb6f875 (patch)
tree0ebe5c4ac8c8bf4817845df632b1fcbe1746e5a3 /test/NavLink.test.js
parent4f0d4d224e2d77a257e90d64d17d7218011f8613 (diff)
downloadpuszcza-021b6e975f6a263b96074502cabe4baf0eb6f875.tar.gz
puszcza-021b6e975f6a263b96074502cabe4baf0eb6f875.zip
Add testing
Diffstat (limited to 'test/NavLink.test.js')
-rw-r--r--test/NavLink.test.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/NavLink.test.js b/test/NavLink.test.js
new file mode 100644
index 0000000..8a1f144
--- /dev/null
+++ b/test/NavLink.test.js
@@ -0,0 +1,15 @@
+import { mount } from '@vue/test-utils'
+import NavLink from '../components/NavLink'
+
+describe('NavLink', () => {
+  // Now mount the component and you have the wrapper
+  const wrapper = mount(NavLink)
+
+  wrapper.setProps({ link: '/link', name: 'Link' })
+
+  it('renders the correct markup', () => {
+    expect(wrapper.html()).toContain(
+      `<li class="navlink"><nuxt-link class="link" to="/link">Link</nuxt-link></li>`
+    )
+  })
+})