또 다시 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)