|
@@ -5,7 +5,11 @@ import PositionedStreetView from "../components/screens/GamePanel/PositionedStre
|
|
|
jest.mock("../domain/gameStore");
|
|
|
jest.mock("../components/screens/GamePanel/usePano");
|
|
|
|
|
|
-import { usePanoStartPosition, usePanoStartPov, useTargetPoint } from "../domain/gameStore";
|
|
|
+import {
|
|
|
+ usePanoStartPosition,
|
|
|
+ usePanoStartPov,
|
|
|
+ useTargetPoint,
|
|
|
+} from "../domain/gameStore";
|
|
|
import usePano from "../components/screens/GamePanel/usePano";
|
|
|
|
|
|
describe("PositionedStreetView", () => {
|
|
@@ -14,7 +18,7 @@ describe("PositionedStreetView", () => {
|
|
|
usePanoStartPov.mockReturnValue();
|
|
|
useTargetPoint.mockReturnValue();
|
|
|
|
|
|
- const rendered = shallow(<PositionedStreetView/>);
|
|
|
+ const rendered = shallow(<PositionedStreetView />);
|
|
|
expect(rendered).toMatchSnapshot();
|
|
|
expect(usePano).toHaveBeenCalled();
|
|
|
});
|
|
@@ -24,9 +28,9 @@ describe("PositionedStreetView", () => {
|
|
|
usePanoStartPov.mockReturnValue();
|
|
|
useTargetPoint.mockReturnValue("point");
|
|
|
const setPosition = jest.fn();
|
|
|
- usePano.mockReturnValue({ current: { setPosition }});
|
|
|
+ usePano.mockReturnValue({ current: { setPosition } });
|
|
|
|
|
|
- const handle = shallow(<PositionedStreetView/>);
|
|
|
+ const handle = shallow(<PositionedStreetView />);
|
|
|
expect(handle).toMatchSnapshot();
|
|
|
handle.find("div.resetButton").first().simulate("click");
|
|
|
expect(setPosition).toHaveBeenCalledWith("point");
|
|
@@ -37,11 +41,14 @@ describe("PositionedStreetView", () => {
|
|
|
usePanoStartPov.mockReturnValue();
|
|
|
useTargetPoint.mockReturnValue("point");
|
|
|
const setPosition = jest.fn();
|
|
|
- usePano.mockReturnValue({ current: { setPosition }});
|
|
|
+ usePano.mockReturnValue({ current: { setPosition } });
|
|
|
|
|
|
- const handle = shallow(<PositionedStreetView/>);
|
|
|
+ const handle = shallow(<PositionedStreetView />);
|
|
|
expect(handle).toMatchSnapshot();
|
|
|
- handle.find("div.resetButton").first().simulate("keydown", { key: "Enter" });
|
|
|
+ handle
|
|
|
+ .find("div.resetButton")
|
|
|
+ .first()
|
|
|
+ .simulate("keydown", { key: "Enter" });
|
|
|
expect(setPosition).toHaveBeenCalledWith("point");
|
|
|
});
|
|
|
});
|