about summary refs log tree commit diff
path: root/test
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
parent4f0d4d224e2d77a257e90d64d17d7218011f8613 (diff)
downloadpuszcza-021b6e975f6a263b96074502cabe4baf0eb6f875.tar.gz
puszcza-021b6e975f6a263b96074502cabe4baf0eb6f875.zip
Add testing
Diffstat (limited to 'test')
-rw-r--r--test/Logo.spec.js9
-rw-r--r--test/NavLink.test.js15
2 files changed, 15 insertions, 9 deletions
diff --git a/test/Logo.spec.js b/test/Logo.spec.js
deleted file mode 100644
index 1628640..0000000
--- a/test/Logo.spec.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import { mount } from '@vue/test-utils'
-import Logo from '@/components/Logo.vue'
-
-describe('Logo', () => {
-  test('is a Vue instance', () => {
-    const wrapper = mount(Logo)
-    expect(wrapper.isVueInstance()).toBeTruthy()
-  })
-})
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>`
+    )
+  })
+})