react-beautiful-dnd-test-utils icon indicating copy to clipboard operation
react-beautiful-dnd-test-utils copied to clipboard

Left/right movement not working

Open acchaulk opened this issue 4 years ago • 2 comments

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',
      ]);
    });

acchaulk avatar Oct 07 '20 19:10 acchaulk

From the README:

Currently supports moving a <Draggable /> n positions up or down inside a <Droppable />.

PRs welcome.

colinrobertbrooks avatar Oct 08 '20 11:10 colinrobertbrooks

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)

acchaulk avatar Oct 09 '20 17:10 acchaulk