{ const canvas = within(canvasElement); const drawButton = canvas.getAllByLabelText("Draw button")[0]; userEvent.click(drawButton); const drawCanvas = document.getElementsByTagName("canvas")[0]; if (!drawCanvas) { throw new Error("Could not find canvas"); } await new Promise((r) => setTimeout(r, 1000)); await userEvent.pointer({ keys: "[MouseLeft][MouseRight]", target: drawCanvas, coords: { clientX: 300, clientY: 100 } }); await userEvent.pointer({ keys: "[MouseLeft][MouseRight]", target: drawCanvas, coords: { clientX: 400, clientY: 200 } }); await userEvent.click(canvas.getByLabelText("Undo")); await userEvent.click(canvas.getByLabelText("Redo")); }} />