{"size": 731, "ext": "js", "max_stars_repo_path": "src/actions/repository.test.js", "max_stars_repo_name": "codenation-dev/squad-3-ad-react-serasa", "max_stars_repo_stars_event_min_datetime": "2019-07-08T21:15:45.000Z", "max_stars_repo_stars_event_max_datetime": "2019-07-08T21:15:45.000Z", "max_issues_repo_path": "src/actions/repository.test.js", "max_issues_repo_name": "codenation-dev/squad-3-ad-react-serasa", "max_issues_repo_issues_event_min_datetime": "2019-07-28T15:02:18.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T15:43:09.000Z", "max_forks_repo_path": "src/actions/repository.test.js", "max_forks_repo_name": "codenation-dev/squad-3-ad-react-serasa", "max_forks_repo_forks_event_min_datetime": "2019-07-30T20:11:31.000Z", "max_forks_repo_forks_event_max_datetime": "2019-07-30T20:11:31.000Z"}
{"max_stars_count": 1, "max_issues_count": 6, "max_forks_count": 1, "avg_line_length": 30.4583333333, "max_line_length": 78, "alphanum_fraction": 0.6128590971}
import { GET_REPOSITORIES_LANGUAGE, CLEAR_ERROR } from '../utils/actionTypes';
import {
    getRepositoriesByLanguage,
    clearError
} from './repository';

describe('Repository Actions', () => {
    it('should create an action to get repositories by language', () => {
        const language = 'javascript';
        const expectedAction = {
            type: GET_REPOSITORIES_LANGUAGE,
            data: language
        };
        expect(getRepositoriesByLanguage(language)).toEqual(expectedAction);
    });

    it('should create an action to clear error', () => {
        const expectedAction = {
            type: CLEAR_ERROR,
            data: false
        };
        expect(clearError()).toEqual(expectedAction);
    })
})