本文整理匯總了TypeScript中react-dnd-test-backend.ITestBackend類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ITestBackend類的具體用法?TypeScript ITestBackend怎麽用?TypeScript ITestBackend使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ITestBackend類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: NormalSource
it('endDrag() sees null as drop result if dropped outside a target', () => {
const source = new NormalSource()
const sourceId = registry.addSource(Types.FOO, source)
backend.simulateBeginDrag([sourceId])
backend.simulateEndDrag()
expect(source.recordedDropResult).toEqual(null)
})
示例2: drop
it('ignores drop() if no drop targets entered', () => {
const source = new NormalSource()
const sourceId = registry.addSource(Types.FOO, source)
backend.simulateBeginDrag([sourceId])
backend.simulateDrop()
backend.simulateEndDrag()
expect(source.recordedDropResult).toEqual(null)
})
示例3: beginDrag
it('lets beginDrag() be called again in a next operation', () => {
const source = new NormalSource()
const sourceId = registry.addSource(Types.FOO, source)
backend.simulateBeginDrag([sourceId])
backend.simulateEndDrag()
source.didCallBeginDrag = false
expect(() => backend.simulateBeginDrag([sourceId])).not.toThrow()
expect(source.didCallBeginDrag).toEqual(true)
})