Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('reuses DragDropManager provided to it', () => {
let capturedManager
const manager = createDragDropManager(TestBackend, {}, {})
const ManagerCapture = () => (
{({ dragDropManager }) => {
capturedManager = dragDropManager
return null
}}
)
TestUtils.renderIntoDocument()
expect(capturedManager).toBe(manager)
})
})
it('reuses DragDropManager provided to it', () => {
let capturedManager
const manager = createDragDropManager(TestBackend, {})
const ManagerCapture = () => (
{({ dragDropManager }) => {
capturedManager = dragDropManager
return null
}}
)
TestUtils.renderIntoDocument()
expect(capturedManager).toBe(manager)
})
})
export function createDndContext(
backend: BackendFactory,
context?: BackendContext,
debugMode?: boolean,
) {
return {
dragDropManager: createDragDropManager(backend, context, debugMode),
}
}
return zone.runOutsideAngular(() =>
createDragDropManager(backendFactory, context, backendOptions, debugMode)
);
export function createDndContext(
backend: BackendFactory,
context?: BackendContext,
options?: BackendOptions,
debugMode?: boolean,
) {
return {
dragDropManager: createDragDropManager(
backend,
context,
options,
debugMode,
),
}
}