Skip to content

Commit

Permalink
Add manager to test backend (#1564)
Browse files Browse the repository at this point in the history
  • Loading branch information
ezr-ondrej authored and darthtrevino committed Nov 12, 2019
1 parent 68de9c9 commit 2a50f87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ it('can be tested with the testing backend', () => {
To use it with react-dnd, you'll need to call `.instance()` on `mount`-ed nodes to access the react-dnd helper methods:

```jsx
import { getBackendFromInstance } from 'react-dnd-test-utils';

var root = Enzyme.mount(<BoxContext name="test" />)

// ...

var backend = root
.instance()
.getManager()
.getBackend()
var backend = getBackendFromInstance(root);
var manager = backend.manager;

// ...

Expand Down
2 changes: 2 additions & 0 deletions packages/testing/test-backend/src/TestBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ export interface TestBackend extends Backend {
export default class TestBackendImpl implements Backend, TestBackend {
public didCallSetup = false
public didCallTeardown = false
public manager: DragDropManager;
private actions: DragDropActions

public constructor(manager: DragDropManager) {
this.manager = manager;
this.actions = manager.getActions()
}

Expand Down

0 comments on commit 2a50f87

Please sign in to comment.