{"size": 876, "ext": "js", "max_stars_repo_path": "client/src/reducers/geometry/fitPoint/fitPointResultReducer/fitPointResultReducer.test.js", "max_stars_repo_name": "sigma3Dev/sigma3DSolutions", "max_stars_repo_stars_event_min_datetime": "2018-03-07T14:36:28.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-06T15:58:21.000Z", "max_issues_repo_path": "client/src/reducers/geometry/fitPoint/fitPointResultReducer/fitPointResultReducer.test.js", "max_issues_repo_name": "sigma3Dev/sigma3DSolutions", "max_issues_repo_issues_event_min_datetime": "2018-03-06T08:28:58.000Z", "max_issues_repo_issues_event_max_datetime": "2018-05-24T08:59:30.000Z", "max_forks_repo_path": "client/src/reducers/geometry/fitPoint/fitPointResultReducer/fitPointResultReducer.test.js", "max_forks_repo_name": "sigma3Dev/sigma3DSolutions", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 77, "max_forks_count": null, "avg_line_length": 24.3333333333, "max_line_length": 119, "alphanum_fraction": 0.551369863}
import { SUBMIT_FIT_POINT_COORDS_SUCCESS } from '../../../../actions/submitFitPointCoords/submitFitPointCoordsActions';
import fitPointResultReducer from './fitPointResultReducer';

describe('fitPointResultReducer', () => {
  it('should handle SUBMIT_FIT_POINT_COORDS_SUCCESS', () => {
    const state = {
      x: 0,
      y: 0,
      z: 0,
      stdev: 0,
      fittingErrors: [],
    };
    const action = {
      type: SUBMIT_FIT_POINT_COORDS_SUCCESS,
      response: {
        result: {
          x: 11.833,
          y: 8.633,
          z: 11.6,
          stdev: 0,
          fittingErrors: [0, 0, 0],
        },
      },
    };
    const expectedState = {
      x: 11.833,
      y: 8.633,
      z: 11.6,
      stdev: 0,
      fittingErrors: [0, 0, 0],
    };
    const result = fitPointResultReducer(state, action);
    expect(result).toEqual(expectedState);
  });
});
