RoundTimer.test.js 614 B

1234567891011121314151617181920
  1. import React from "react";
  2. import { shallow } from "enzyme";
  3. import RoundTimer from "../components/screens/GamePanel/GuessPane/RoundTimer";
  4. jest.mock("../domain/gameStore");
  5. import { useRoundSeconds } from "../domain/gameStore";
  6. describe("RoundTimer", () => {
  7. it("renders with time left", () => {
  8. useRoundSeconds.mockReturnValue(100);
  9. const rendered = shallow(<RoundTimer />);
  10. expect(rendered).toMatchSnapshot();
  11. });
  12. it("renders with no time left", () => {
  13. useRoundSeconds.mockReturnValue(0);
  14. const rendered = shallow(<RoundTimer />);
  15. expect(rendered).toMatchSnapshot();
  16. });
  17. });