mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
refactor(directives): [repeat-click] use JSX in Unit test (#8785)
This commit is contained in:
@@ -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 () => {
|
||||
Reference in New Issue
Block a user