mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-22 19:56:02 +10:00
32 lines
711 B
JavaScript
32 lines
711 B
JavaScript
import { mount, RouterLinkStub } from '@vue/test-utils'
|
|
import DropdownLink from '@/default-theme/DropdownLink.vue'
|
|
import { modeTestRunner } from '../util'
|
|
|
|
function test (mode, localVue) {
|
|
it(`$${mode} - renders dropdown link.`, () => {
|
|
const item = {
|
|
text: 'VuePress',
|
|
items: [
|
|
{
|
|
text: 'Guide',
|
|
link: '/guide/'
|
|
},
|
|
{
|
|
text: 'Config Reference',
|
|
link: '/config/'
|
|
}
|
|
]
|
|
}
|
|
const wrapper = mount(DropdownLink, {
|
|
localVue,
|
|
stubs: {
|
|
'router-link': RouterLinkStub
|
|
},
|
|
propsData: { item }
|
|
})
|
|
expect(wrapper.html()).toMatchSnapshot()
|
|
})
|
|
}
|
|
|
|
modeTestRunner('DropdownLink', test)
|