colinrobertbrooks / react-beautiful-dnd-test-utils

Test utils for react-beautiful-dnd built with react-testing-library 🧤
https://www.npmjs.com/package/react-beautiful-dnd-test-utils
MIT License
32 stars 14 forks source link

Left/right movement not working #7

Open acchaulk opened 3 years ago

acchaulk commented 3 years ago

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',
      ]);
    });
colinrobertbrooks commented 3 years ago

From the README:

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

PRs welcome.

acchaulk commented 3 years ago

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)