| 15 | } |
| 16 | |
| 17 | export class TestBackendImpl implements Backend, ITestBackend { |
| 18 | public didCallSetup = false |
| 19 | public didCallTeardown = false |
| 20 | public manager: DragDropManager |
| 21 | public context: TestBackendContext |
| 22 | private actions: DragDropActions |
| 23 | |
| 24 | public constructor(manager: DragDropManager, context: TestBackendContext) { |
| 25 | this.manager = manager |
| 26 | this.context = context |
| 27 | this.actions = manager.getActions() |
| 28 | } |
| 29 | |
| 30 | public profile(): Record<string, number> { |
| 31 | return {} |
| 32 | } |
| 33 | |
| 34 | public setup(): void { |
| 35 | this.didCallSetup = true |
| 36 | } |
| 37 | |
| 38 | public teardown(): void { |
| 39 | this.didCallTeardown = true |
| 40 | } |
| 41 | |
| 42 | public connectDragSource(): Unsubscribe { |
| 43 | return noop |
| 44 | } |
| 45 | |
| 46 | public connectDragPreview(): Unsubscribe { |
| 47 | return noop |
| 48 | } |
| 49 | |
| 50 | public connectDropTarget(): Unsubscribe { |
| 51 | return noop |
| 52 | } |
| 53 | |
| 54 | public simulateBeginDrag( |
| 55 | sourceIds: Identifier[], |
| 56 | options: BeginDragOptions, |
| 57 | ): void { |
| 58 | this.actions.beginDrag(sourceIds, options) |
| 59 | } |
| 60 | |
| 61 | public simulatePublishDragSource(): void { |
| 62 | this.actions.publishDragSource() |
| 63 | } |
| 64 | |
| 65 | public simulateHover(targetIds: Identifier[], options: HoverOptions): void { |
| 66 | this.actions.hover(targetIds, options) |
| 67 | } |
| 68 | |
| 69 | public simulateDrop(): void { |
| 70 | this.actions.drop() |
| 71 | } |
| 72 | |
| 73 | public simulateEndDrag(): void { |
| 74 | this.actions.endDrag() |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…