本文整理汇总了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)
})