import React from "react";
import { shallow } from "enzyme";
import RaceMode from "../components/screens/GamePanel/RaceMode";

jest.mock("../domain/gameStore");
jest.mock("../domain/apiMethods");
jest.mock("../components/screens/GamePanel/useRaceModeCheck");

import useRaceModeCheck from "../components/screens/GamePanel/useRaceModeCheck";

describe("PositionedStreetView", () => {
  it("renders", () => {
    useRaceModeCheck.mockReturnValue([null, false]);
    const rendered = shallow(<RaceMode />);
    expect(rendered).toMatchSnapshot();
  });
  it("renders when cut off", () => {
    useRaceModeCheck.mockReturnValue(["cutoff-player", false]);
    const rendered = shallow(<RaceMode cutoffTime={10} />);
    expect(rendered).toMatchSnapshot();
  });
  it("renders when faded", () => {
    useRaceModeCheck.mockReturnValue(["cutoff-player", true]);
    const rendered = shallow(<RaceMode cutoffTime={10} />);
    expect(rendered).toMatchSnapshot();
  });
});
