react-beautiful-dnd-test-utils
Version:
Test utils for react-beautiful-dnd built with react-testing-library.
48 lines (31 loc) • 2.19 kB
Markdown
<div align="center">
<h1>react-beautiful-dnd-test-utils</h1>
<a href="https://emojipedia.org/gloves/">
<img height="80" width="80" alt="gloves" src="https://raw.githubusercontent.com/colinrcummings/react-beautiful-dnd-test-utils/master/other/gloves.png" />
</a>
<p>Test utils for <a href="https://github.com/atlassian/react-beautiful-dnd">react-beautiful-dnd (rbd)</a> built with <a href="https://github.com/testing-library/react-testing-library">react-testing-library</a>.</p>
<br />
</div>
<hr />
[](https://github.com/colinrobertbrooks/react-beautiful-dnd-test-utils/actions/workflows/main.yml)
[](https://www.npmjs.com/package/react-beautiful-dnd-test-utils)
[](http://www.npmtrends.com/react-beautiful-dnd-test-utils)
[](https://github.com/colinrobertbrooks/react-beautiful-dnd-test-utils/blob/master/LICENSE)
## Installation
This module is distributed via [`npm`](https://www.npmjs.com/), which is bundled with [`node`](https://nodejs.org/en/), and
should be installed as one of your project's `devDependencies`:
```
npm install --save-dev react-beautiful-dnd-test-utils
```
The following packages must also be installed:
- `-library/jest-dom`
- `-library/react`
- `-library/user-event`
- `jest`
## Supported versions of `rbd`
Versions 3+ of this library supports testing `rbd` version 12+. Use version 2 of this library for testing `rbd` version 11.
## Usage
Currently supports moving a [`<Draggable />`](https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/api/draggable.md) _n_ positions up or down inside a [`<Droppable />`](https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/api/droppable.md).
See an [example test](./example/src/App.test.tsx).
## License
MIT