本文整理匯總了TypeScript中react-dnd-test-backend.TestBackend類的典型用法代碼示例。如果您正苦於以下問題:TypeScript TestBackend類的具體用法?TypeScript TestBackend怎麽用?TypeScript TestBackend使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了TestBackend類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: it
it('should not react to a plain end drag', () => {
backend.simulateBeginDrag([source]);
backend.simulateHover([target]);
backend.simulateEndDrag();
expect(component.dropped).toBeFalsy();
expect(component.endDrag).toBeTruthy();
fixture.detectChanges();
expect(draggingClassApplied()).toBeFalsy();
});
示例4: 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)
})