import { playerMoveAction, PLAYER_MOVE } from "src/actions/GameActions.js";
import { computerMoveAction, COMPUTER_MOVE } from "src/actions/GameActions.js";
import { resetGameAction, RESET_GAME } from "src/actions/GameActions.js";

describe("Game Actions", () => {

  it("should exist", () => {
    playerMoveAction.should.exist;
    computerMoveAction.should.exist;
    resetGameAction.should.exist;
  });

  it("should be a function", () => {
    playerMoveAction.should.be.function;
    computerMoveAction.should.be.function;
    resetGameAction.should.be.function;
  });

  describe("playerMoveAction", () => {

    it("should create action of type PLAYER_MOVE", () => {
      const action = playerMoveAction(0,0);
      action.type.should.be.equal(PLAYER_MOVE);
    });

    it("should have props x, y equal to function arguments", () => {
      var action = playerMoveAction(0,0);

      const playerMoveAt00 = {
        x: 0,
        y: 0,
        type: PLAYER_MOVE
      };

      action.should.be.eql(playerMoveAt00);
    });

    it("should have props x, y equal to function arguments", () => {
      var action = playerMoveAction(2,1);

      const playerMoveAt21 = {
        x: 2,
        y: 1,
        type: PLAYER_MOVE
      };

      action.should.be.eql(playerMoveAt21);
    });

  });

  describe("computerMoveAction", () => {

    it("should create action of type COMPUTER_MOVE", () => {
      const action = computerMoveAction();
      action.type.should.be.equal(COMPUTER_MOVE);
    });

    it("should have nothing else but action type", () => {
      var action = computerMoveAction( );

      const computerMove = {
        type: COMPUTER_MOVE
      };

      action.should.be.eql(computerMove);
    });

  });

  describe("resetGameAction", () => {

    it("should create action of type RESET_GAME", () => {
      const action = resetGameAction();
      action.type.should.be.equal(RESET_GAME);
    });

    it("should have props x, y equal to function arguments", () => {
      var action = resetGameAction();

      const computerMove = {
        type: RESET_GAME
      };

      action.should.be.eql(computerMove);
    });

  });

});

@@ -222,16 +222,95 @@
 ons.js%22;
+%0Aimport %7B setGameModeAction, SET_GAME_MODE %7D from %22src/actions/GameActions.js%22;
 %0A%0Adescri
@@ -472,16 +472,52 @@
 .exist;%0A
+    setGameModeAction.should.exist;%0A
   %7D);%0A%0A 
@@ -632,24 +632,24 @@
 e.function;%0A
-
     resetGam
@@ -676,16 +676,58 @@
 nction;%0A
+    setGameModeAction.should.be.function;%0A
   %7D);%0A%0A 
@@ -2307,12 +2307,726 @@
 %0A  %7D);%0A%0A
+  describe(%22setGameModeAction%22, () =%3E %7B%0A%0A    it(%22should create action of type SET_GAME_MODE%22, () =%3E %7B%0A      const action = setGameModeAction(%22TEST%22);%0A      action.type.should.be.equal(SET_GAME_MODE);%0A    %7D);%0A%0A    it(%22should first argument as game mode%22, () =%3E %7B%0A      const action = setGameModeAction(%22TEST%22);%0A%0A      const testAction = %7B%0A        mode: %22TEST%22,%0A        type: SET_GAME_MODE%0A      %7D;%0A%0A      action.should.be.eql(testAction);%0A    %7D);%0A%0A    it(%22should first argument as game mode%22, () =%3E %7B%0A      const action = setGameModeAction(%22TEST_NUMBER_TWO%22);%0A%0A      const testAction = %7B%0A        mode: %22TEST_NUMBER_TWO%22,%0A        type: SET_GAME_MODE%0A      %7D;%0A%0A      action.should.be.eql(testAction);%0A    %7D);%0A%0A  %7D);%0A%0A
 %7D);%0A

Add tests for setGameModeAction