diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-08-30 10:08:13 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-08-30 10:08:13 +0200 |
commit | 768b047e89f419deca3ddd00af7cb75209de97b6 (patch) | |
tree | 2e94259cc97a4370897278b6845ce5a7ddf31629 /components/NavLink/NavLink.test.js | |
parent | cef8ab49453e4ce8a2e19de4e27862b059f7d9d9 (diff) | |
download | puszcza-768b047e89f419deca3ddd00af7cb75209de97b6.tar.gz puszcza-768b047e89f419deca3ddd00af7cb75209de97b6.zip |
Move to nuxtjs
Diffstat (limited to 'components/NavLink/NavLink.test.js')
-rw-r--r-- | components/NavLink/NavLink.test.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/components/NavLink/NavLink.test.js b/components/NavLink/NavLink.test.js new file mode 100644 index 0000000..a5da412 --- /dev/null +++ b/components/NavLink/NavLink.test.js @@ -0,0 +1,20 @@ +import { mount } from '@vue/test-utils'; +import NavLink from './index.vue'; + +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"> + <a class="link" href="/link">Link</a> + </li>`); + }); + + // it's also easy to check for the existence of elements + it('has a button', () => { + expect(wrapper.contains('button')).toBe(true); + }); +}); |