<commit_before>import changeGridAction, {GRID_CHANGED} from "src/actions/GameActions.js";

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

  it("should exist", () => {
    changeGridAction.should.exist;
  });

  it("should be a function", () => {
    changeGridAction.should.be.function;
  });

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

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

    const gridChangedAt00 = {
      x: 0,
      y: 0,
      type: GRID_CHANGED
    };

    action.should.be.eql(gridChangedAt00);

    action = changeGridAction(2,1);

    const gridChangedAt21 = {
      x: 2,
      y: 1,
      type: GRID_CHANGED
    };

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


});<commit_msg>Add tests for new actions, and rename old one<commit_after>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);
    });

  });

});
{'fraction_non_alphanumeric': 0.1448051948051948, 'fraction_numerical': 0.01103896103896104, 'mean_word_length': 2.8225806451612905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1343142', 'n_tokens_mistral': 1022, 'n_tokens_neox': 969, 'n_words': 201}