react-beautiful-dnd-test-utils
react-beautiful-dnd-test-utils copied to clipboard
Left/right movement not working
Does this library support left/right movement? I'm trying to modify the example tests to move a task to the right to the "in progress" column. Here's an example
test('moves a task right inside a column', async () => {
const { getByText, getByTestId, makeGetDragEl } = renderApp();
await makeDnd({
getByText,
getDragEl: makeGetDragEl('Cook dinner'),
direction: DND_DIRECTION_RIGHT,
positions: 1,
});
const { getAllByTestId: getAllByTestIdWithinColumn } = within(
getByTestId('in-progress-column'),
);
const testTextOrderByTestId = createTestTextOrderByTestIdHelper(
getAllByTestIdWithinColumn,
);
testTextOrderByTestId('task-content', [
'Cook dinner',
]);
});
From the README:
Currently supports moving a <Draggable /> n positions up or down inside a <Droppable />.
PRs welcome.
Missed that originally. I do believe that it works, the only problem that I'm seeing is the You have moved the item
screen reader statement isn't reached. Locally, if I comment that line it seems to work and the element is added to the right droppable (if moving right)