{"size": 1072, "ext": "js", "max_stars_repo_path": "test/unit/utils/final-diff.spec.js", "max_stars_repo_name": "darvelo/ether", "max_stars_repo_stars_event_min_datetime": "2015-12-15T03:33:53.000Z", "max_stars_repo_stars_event_max_datetime": "2016-03-15T21:48:26.000Z", "max_issues_repo_path": "test/unit/utils/final-diff.spec.js", "max_issues_repo_name": "darvelo/ether", "max_issues_repo_issues_event_min_datetime": "2016-10-07T16:30:12.000Z", "max_issues_repo_issues_event_max_datetime": "2016-10-07T16:32:29.000Z", "max_forks_repo_path": "test/unit/utils/final-diff.spec.js", "max_forks_repo_name": "darvelo/ether", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 35.7333333333, "max_line_length": 76, "alphanum_fraction": 0.6128731343}
import finalDiff from '../../../src/utils/final-diff';

describe('Final Diff Util', () => {
    it('returns null if both arguments are null', () => {
        expect(finalDiff(null, null)).to.equal(null);
    });

    it('returns an object if paramsDiff is not null', () => {
        let paramsDiff = {};
        let queryParamsDiff = null;
        let result = finalDiff(paramsDiff, queryParamsDiff);
        expect(result.params).to.equal(paramsDiff);
        expect(result.queryParams).to.equal(queryParamsDiff);
    });

    it('returns an object if queryParamsDiff is not null', () => {
        let paramsDiff = null;
        let queryParamsDiff = {};
        let result = finalDiff(paramsDiff, queryParamsDiff);
        expect(result.params).to.equal(paramsDiff);
        expect(result.queryParams).to.equal(queryParamsDiff);
    });

    it('does not modify either argument', () => {
        let paramsDiff = Object.freeze({});
        let queryParamsDiff = Object.freeze({});
        expect(() => finalDiff(paramsDiff, queryParamsDiff)).to.not.throw();
    });
});
