提交 f74ccddd 编写于 作者: U ULIVZ

test: clean Content.spec.js

上级 1dc7cc61
import Content from '../../lib/app/components/Content'
import { mount } from '@vue/test-utils'
import modeTestRunner from '@vuepress/test-utils/modeTestRunner'
import getRouter from '@vuepress/test-utils/getRouter'
function test (mode, localVue) {
it(`${mode} - add custom class by default.`, () => {
const wrapper = mount(Content, {
localVue,
router: getRouter()
})
expect(wrapper.contains('.custom')).toBe(true)
})
it(`${mode} - remove custom when custom set to false.`, () => {
const wrapper = mount(Content, {
// https://vue-test-utils.vuejs.org/api/options.html#context
context: {
props: {
custom: false
}
},
localVue,
router: getRouter()
})
expect(wrapper.contains('.custom')).toBe(false)
})
}
modeTestRunner('Content', test)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册