about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
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>`
+    )
+  })
+})