userEvent.click is not working..

오늘도 삽질중·2023년 3월 20일
0

React-Test-App

목록 보기
4/8
post-thumbnail

또 다시 userEvent사용이 안되는 경우가 발생했다.
이번엔 click메소드가 사용안됐는데..

test("update option's total when options change", async () => {
  const event = userEvent.setup();
  render(<Type orderType="options" />);

  const optionsTotal = screen.getByText("총 가격:", { exact: false });
  expect(optionsTotal).toHaveTextContent("0");

  const insuranceCheckbox = await screen.findByRole("checkbox", {
    name: "Insurance",
  });
  event.click(insuranceCheckbox);
  expect(optionsTotal).toHaveTextContent("500");
}

뭐가 문제지?

await을 안붙였다..ㅠ 분명 나같은 사람있을것같아서 추가해 놓는다.

await event.click(insuranceCheckbox)
profile
의미없는 삽질은 없다1

0개의 댓글