diff --git a/src/components/Pronunciations/RecorderIcon.tsx b/src/components/Pronunciations/RecorderIcon.tsx index 3a91f27e31..b19e04a872 100644 --- a/src/components/Pronunciations/RecorderIcon.tsx +++ b/src/components/Pronunciations/RecorderIcon.tsx @@ -50,11 +50,9 @@ export default function RecorderIcon(props: RecorderIconProps): ReactElement { // Temporarily disable context menu since some browsers // interpret a long-press touch as a right-click. document.addEventListener("contextmenu", disableContextMenu, false); - toggleIsRecordingToTrue(); } function handleTouchEnd(): void { enableContextMenu(); - toggleIsRecordingToFalse(); } function disableContextMenu(event: any): void { @@ -68,15 +66,15 @@ export default function RecorderIcon(props: RecorderIconProps): ReactElement { return ( { expect(testRenderer.toJSON()).toMatchSnapshot(); }); - it("mouseDown and mouseUp", () => { + it("pointereDown and pointerUp", () => { const mockStartRecording = jest.fn(); const mockStopRecording = jest.fn(); renderer.act(() => { @@ -91,11 +91,11 @@ describe("Pronunciations", () => { }); expect(mockStartRecording).not.toBeCalled(); - testRenderer.root.findByProps({ id: recordButtonId }).props.onMouseDown(); + testRenderer.root.findByProps({ id: recordButtonId }).props.onPointerDown(); expect(mockStartRecording).toBeCalled(); expect(mockStopRecording).not.toBeCalled(); - testRenderer.root.findByProps({ id: recordButtonId }).props.onMouseUp(); + testRenderer.root.findByProps({ id: recordButtonId }).props.onPointerUp(); expect(mockStopRecording).toBeCalled(); }); diff --git a/src/components/Pronunciations/tests/__snapshots__/Pronunciations.test.tsx.snap b/src/components/Pronunciations/tests/__snapshots__/Pronunciations.test.tsx.snap index 58ae2a4910..f6d3831c85 100644 --- a/src/components/Pronunciations/tests/__snapshots__/Pronunciations.test.tsx.snap +++ b/src/components/Pronunciations/tests/__snapshots__/Pronunciations.test.tsx.snap @@ -19,6 +19,8 @@ Array [ onMouseLeave={[Function]} onMouseOver={[Function]} onMouseUp={[Function]} + onPointerDown={[Function]} + onPointerUp={[Function]} onTouchEnd={[Function]} onTouchMove={[Function]} onTouchStart={[Function]}