#userEvents.click() doesn't work but element.click() does

2 messages · Page 1 of 1 (latest)

echo widget
#

I struggle with writing tests:

  play: async ({ canvasElement }) => {
    const canvas = within(canvasElement)
    const input = within(canvas.getAllByTestId("appointment-date-picker")[0])
    const month = input.getByLabelText("month")
    const day = input.getByLabelText("day")
    const year = input.getByLabelText("year")
    const arrowDownButton = input.getByRole("button")

    userEvent.click(month)
    userEvent.type(month, "[ArrowUp]")
    userEvent.tab()
    userEvent.type(day, "[ArrowUp]")
    userEvent.tab()
    userEvent.type(year, "[ArrowUp]")
    userEvent.tab()
    userEvent.click(arrowDownButton)
  },

I have following test.
And last one click doesn't work if done by the testing-library.
If I call just arrowDownButton.click() it works as expected opening calendar.

I'm using 7.0.0-rc4.

echo widget
#

I used await and it's still broken and doesn't work.

Typings are wrong for the library too.