about summary refs log tree commit diff
path: root/test/components/NavLink.test.js
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-10-01 19:42:19 +0200
committerGitHub <noreply@github.com>2019-10-01 19:42:19 +0200
commit11b4d4779d7c955f99ababa5b7abe9281912de08 (patch)
treebe6289a6c5972312584cc315425171b828c8bf58 /test/components/NavLink.test.js
parent89837b8756590bd97b82450c6a445702f7ab5077 (diff)
parent89a60dbbbadee2fbccddddc47e92aaf8dce6525a (diff)
downloadpuszcza-11b4d4779d7c955f99ababa5b7abe9281912de08.tar.gz
puszcza-11b4d4779d7c955f99ababa5b7abe9281912de08.zip
Merge pull request #2 from 19pdh/develop
Merge from develop
Diffstat (limited to 'test/components/NavLink.test.js')
-rw-r--r--test/components/NavLink.test.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/components/NavLink.test.js b/test/components/NavLink.test.js
new file mode 100644
index 0000000..d35e6db
--- /dev/null
+++ b/test/components/NavLink.test.js
@@ -0,0 +1,23 @@
+import { shallowMount } from '@vue/test-utils'
+import NavLink from '../../components/NavLink'
+
+describe('NavLink', () => {
+  // Now mount the component and you have the wrapper
+  const wrapper = shallowMount(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>`
+    )
+  })
+
+  it('check text', () => {
+    expect(wrapper.text()).toBe('Link')
+  })
+
+  it('match snapshot', () => {
+    expect(wrapper.element).toMatchSnapshot()
+  })
+})