refactor(directives): [repeat-click] use JSX in Unit test (#8785)

This commit is contained in:
zz
2022-07-12 19:42:38 +08:00
committed by GitHub
parent 23b131770e
commit 9fef09333f

View File

@@ -5,19 +5,24 @@ import RepeatClick from '../repeat-click'
const handler = vi.fn()
const _mount = () =>
mount({
template: `
<div id="block" v-repeat-click="onClick">TEST</div>
`,
directives: {
repeatClick: RepeatClick,
},
methods: {
onClick() {
handler()
mount(
{
setup() {
return () => (
<div id="block" v-repeat-click={handler}>
TEST
</div>
)
},
},
})
{
global: {
directives: {
RepeatClick,
},
},
}
)
describe('Directives.vue', () => {
test('Click test', async () => {