本文整理汇总了TypeScript中dom-testing-library.fireEvent.mouseOver方法的典型用法代码示例。如果您正苦于以下问题:TypeScript fireEvent.mouseOver方法的具体用法?TypeScript fireEvent.mouseOver怎么用?TypeScript fireEvent.mouseOver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dom-testing-library.fireEvent
的用法示例。
在下文中一共展示了fireEvent.mouseOver方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test('dismiss on popover unhover', async () => {
setDocumentBody('single.html')
littlefoot({
activateDelay: 1,
activateOnHover: true,
dismissDelay: 1,
dismissOnUnhover: true,
hoverDelay: 1
})
const button = getButton('1')
fireEvent.mouseOver(button)
await waitForChange(button)
const popover = getPopover('1')
fireEvent.mouseOut(button)
fireEvent.mouseOver(popover)
fireEvent.mouseOut(popover)
await waitForChange(button)
expect(button).not.toHaveClass('is-hovered')
expect(button).not.toHaveClass('is-active')
})
示例2: test
test('activate multiple footnotes on hover', async () => {
littlefoot({ activateDelay: 1, activateOnHover: true, allowMultiple: true })
const one = getButton('1')
fireEvent.mouseOver(one)
await waitForChange(one)
const two = getButton('2')
fireEvent.mouseOver(two)
await waitForChange(two)
expect(getAllActiveButtons()).toHaveLength(2)
})
示例3: test
test('activate on hover', async () => {
setDocumentBody('single.html')
littlefoot({ activateDelay: 1, activateOnHover: true, hoverDelay: 1 })
const button = getButton('1')
fireEvent.mouseOver(button)
await waitForChange(button)
expect(button).toHaveClass('is-hovered')
expect(button).toHaveClass('is-active')
})