{"size": 791, "ext": "js", "max_stars_repo_path": "src/redux/test/build-action-name.spec.js", "max_stars_repo_name": "Gamediamond3757/Sudoku-AI-1", "max_stars_repo_stars_event_min_datetime": "2018-03-11T18:51:54.000Z", "max_stars_repo_stars_event_max_datetime": "2018-03-11T18:51:54.000Z", "max_issues_repo_path": "src/redux/test/build-action-name.spec.js", "max_issues_repo_name": "Gamediamond3757/Sudoku-AI-1", "max_issues_repo_issues_event_min_datetime": "2020-07-20T19:18:49.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-11T14:38:50.000Z", "max_forks_repo_path": "src/redux/test/build-action-name.spec.js", "max_forks_repo_name": "Gamediamond3757/Sudoku-AI-1", "max_forks_repo_forks_event_min_datetime": "2018-12-09T12:49:42.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-18T15:11:02.000Z"}
{"max_stars_count": 1, "max_issues_count": 3, "max_forks_count": 4, "avg_line_length": 30.4230769231, "max_line_length": 70, "alphanum_fraction": 0.5613147914}
import buildActionName from '../build-action-name';

describe('Build Action Name - Unit Test', () => {
    it('should return an action name', () => {
        const actual = buildActionName('someReducer', 'SOME_ACTION');
        const expected = 'Sudoku-AI/someReducer/SOME_ACTION';
        expect(actual).toEqual(expected);
    });

    it('should throw error when reducer name not given', () => {
        try {
            buildActionName();
        } catch (e) {
            expect(e.message).toEqual('Reducer name cannot be blank');
        }
    });

    it('should throw error when action name not given', () => {
        try {
            buildActionName('someReducer');
        } catch (e) {
            expect(e.message).toEqual('Action name cannot be blank');
        }
    });
});
