diff --git a/src/modules/GameWithHooks/hooks/use-game/use-game.test.tsx b/src/modules/GameWithHooks/hooks/use-game/use-game.test.tsx index 02c66567..805bc2d6 100644 --- a/src/modules/GameWithHooks/hooks/use-game/use-game.test.tsx +++ b/src/modules/GameWithHooks/hooks/use-game/use-game.test.tsx @@ -1,4 +1,4 @@ -import { Field } from "@helpers/field"; +import { CellState, Field } from "@helpers/field"; import { GameLevels, GameSettings } from "@modules/GameSettings"; import { useGame } from "@modules/GameWithHooks/hooks/use-game/index"; import { act, renderHook } from "@testing-library/react"; @@ -35,4 +35,14 @@ describe("useGame test cases", function () { const { playerField: expertPlayerField } = result.current; expect(expertPlayerField).toHaveLength(22); }); + + it("should handler contextMenu handler", function () { + const { result } = renderHook(useGame); + + const { onContextMenuHandler, playerField: newPlayerField } = result.current; + + act(() => onContextMenuHandler([0, 0])); + + expect(flatWithFilter(newPlayerField, CellState.mark)).toHaveLength(1); + }); });