Files
ULIVZandGitHub e5d8ed4655 feat: refine node api (#1395)
- fix($core): markdown slot doesn‘t work. (regression of c85f62d)
- docs: fresh Node.JS API.
- test: official plugins.
2019-03-04 23:46:13 +08:00

33 lines
820 B
JavaScript

import { mount, RouterLinkStub } from '@vue/test-utils'
import { createLocalVue } from '@vuepress/test-utils/client'
import NavLink from '../../components/NavLink.vue'
describe('NavLink', () => {
test('renders nav link with internal link', () => {
const item = {
link: '/',
text: 'VuePress'
}
const wrapper = mount(NavLink, {
localVue: createLocalVue(),
stubs: {
'router-link': RouterLinkStub
},
propsData: { item }
})
expect(wrapper.html()).toMatchSnapshot()
})
test('renders nav link with external link', () => {
const item = {
link: 'http://vuejs.org/',
text: 'Vue'
}
const wrapper = mount(NavLink, {
localVue: createLocalVue(),
propsData: { item }
})
expect(wrapper.html()).toMatchSnapshot()
})
})