Kirk Trombley 4 anni fa
parent
commit
f1a30c4b0d

+ 4 - 4
client/src/tests/GamePanel.test.js

@@ -15,7 +15,7 @@ describe("GamePanel", () => {
   it("renders for NORMAL game", () => {
     useCurrentRound.mockReturnValue("");
     useGameConfig.mockReturnValue({ ruleSet: NORMAL });
-    const rendered = shallow(<GamePanel/>);
+    const rendered = shallow(<GamePanel />);
     expect(rendered).toMatchSnapshot();
     expect(usePreventNavigation).toHaveBeenCalled();
     expect(useGameConfig).toHaveBeenCalled();
@@ -24,7 +24,7 @@ describe("GamePanel", () => {
   it("renders for end of game", () => {
     useCurrentRound.mockReturnValue(null);
     useGameConfig.mockReturnValue({ ruleSet: NORMAL });
-    const rendered = shallow(<GamePanel/>);
+    const rendered = shallow(<GamePanel />);
     expect(rendered).toMatchSnapshot();
     expect(usePreventNavigation).toHaveBeenCalled();
     expect(useGameConfig).toHaveBeenCalled();
@@ -33,7 +33,7 @@ describe("GamePanel", () => {
   it("renders for FROZEN game", () => {
     useCurrentRound.mockReturnValue("");
     useGameConfig.mockReturnValue({ ruleSet: FROZEN });
-    const rendered = shallow(<GamePanel/>);
+    const rendered = shallow(<GamePanel />);
     expect(rendered).toMatchSnapshot();
     expect(usePreventNavigation).toHaveBeenCalled();
     expect(useGameConfig).toHaveBeenCalled();
@@ -42,7 +42,7 @@ describe("GamePanel", () => {
   it("renders for RACE game", () => {
     useCurrentRound.mockReturnValue("");
     useGameConfig.mockReturnValue({ ruleSet: RACE });
-    const rendered = shallow(<GamePanel/>);
+    const rendered = shallow(<GamePanel />);
     expect(rendered).toMatchSnapshot();
     expect(usePreventNavigation).toHaveBeenCalled();
     expect(useGameConfig).toHaveBeenCalled();

+ 14 - 7
client/src/tests/PositionedStreetView.test.js

@@ -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");
   });
 });

+ 1 - 1
client/src/tests/RaceMode.test.js

@@ -7,7 +7,7 @@ jest.mock("../domain/apiMethods");
 
 describe("PositionedStreetView", () => {
   it("renders", () => {
-    const rendered = shallow(<RaceMode/>);
+    const rendered = shallow(<RaceMode />);
     expect(rendered).toMatchSnapshot();
   });
 });

+ 2 - 2
client/src/tests/StartGame.test.js

@@ -9,12 +9,12 @@ import { usePlayerName } from "../domain/gameStore";
 describe("StartGame", () => {
   it("renders without crashing", () => {
     usePlayerName.mockReturnValue("test-player");
-    const rendered = shallow(<StartGame/>);
+    const rendered = shallow(<StartGame />);
     expect(rendered).toMatchSnapshot();
   });
   it("responds to clicking the join button", () => {
     usePlayerName.mockReturnValue("test-player");
-    const handle = mount(<StartGame/>);
+    const handle = mount(<StartGame />);
     handle.find("button").first().simulate("click");
     expect(handle).toMatchSnapshot();
   });