{"size": 1426, "ext": "js", "max_stars_repo_path": "src/__tests__/actions/index.test.js", "max_stars_repo_name": "RyanDanielWalker/tap-room-redux", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/__tests__/actions/index.test.js", "max_issues_repo_name": "RyanDanielWalker/tap-room-redux", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/__tests__/actions/index.test.js", "max_forks_repo_name": "RyanDanielWalker/tap-room-redux", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.4642857143, "max_line_length": 130, "alphanum_fraction": 0.5652173913}
import * as a from '../../actions';
import * as c from '../../actions/ActionTypes';

describe('tap room actions', () => {
  test('addKeg should create ADD_TICKET action', () => {
    expect(a.addKeg({ name: 'Rainier', brand: 'Pabst', price: '3', abv: '4.2', pintsRemaining: '124', id: 1 })).toEqual({
      type: c.ADD_KEG,
      name: 'Rainier',
      brand: 'Pabst',
      price: '3',
      abv: '4.2',
      pintsRemaining: '124',
      id: 1
    });
  });

  test('toggleForm should create TOGGLE_FORM action', () => {
    expect(a.toggleForm()).toEqual({
      type: c.TOGGLE_FORM
    });
  });

  test('deleteKeg should create DELETE_KEG action', () => {
    expect(a.deleteKeg(1)).toEqual({
      type: c.DELETE_KEG,
      id: 1
    });
  });

  test('makeSelectedKeg should create MAKE_SELECTED_KEG action', () => {
    expect(a.makeSelectedKeg({ name: 'Rainier', brand: 'Pabst', price: '3', abv: '4.2', pintsRemaining: '124', id: 1 })).toEqual({
      type: c.MAKE_SELECTED_KEG,
      name: 'Rainier',
      brand: 'Pabst',
      price: '3',
      abv: '4.2',
      pintsRemaining: '124',
      id: 1
    });
  });

  test('nullSelectedKeg should create NULL_SELECTED_KEG action', () => {
    expect(a.nullSelectedKeg()).toEqual({
      type: c.NULL_SELECTED_KEG
    })
  })

  test('isEditing should create IS_EDITING action', () => {
    expect(a.isEditing()).toEqual({
      type: c.IS_EDITING
    });
  });
});


