2022-01-04 09:15:15 +08:00
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
export const genTooltipProvides = () => {
|
|
|
|
const onOpen = jest.fn()
|
|
|
|
const onClose = jest.fn()
|
|
|
|
const onToggle = jest.fn()
|
|
|
|
const onShow = jest.fn()
|
|
|
|
const onHide = jest.fn()
|
2022-02-21 17:08:21 +08:00
|
|
|
const onBeforeShow = jest.fn()
|
|
|
|
const onBeforeHide = jest.fn()
|
2022-01-04 09:15:15 +08:00
|
|
|
const id = ref('test_id')
|
|
|
|
const open = ref(false)
|
|
|
|
const controlled = ref(false)
|
|
|
|
const trigger = ref('hover')
|
|
|
|
|
|
|
|
return {
|
|
|
|
onToggle,
|
|
|
|
onOpen,
|
|
|
|
onClose,
|
|
|
|
onShow,
|
|
|
|
onHide,
|
2022-02-21 17:08:21 +08:00
|
|
|
onBeforeShow,
|
|
|
|
onBeforeHide,
|
2022-01-04 09:15:15 +08:00
|
|
|
id,
|
|
|
|
open,
|
|
|
|
controlled,
|
|
|
|
trigger,
|
|
|
|
}
|
|
|
|
}
|