{"size": 783, "ext": "js", "max_stars_repo_path": "tests/models/awards/CoreAward-test.js", "max_stars_repo_name": "KulieX/usaspending-website", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "tests/models/awards/CoreAward-test.js", "max_issues_repo_name": "KulieX/usaspending-website", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "tests/models/awards/CoreAward-test.js", "max_forks_repo_name": "KulieX/usaspending-website", "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": 26.1, "max_line_length": 64, "alphanum_fraction": 0.6245210728}
/**
 * CoreAward-test.js
 * Created by Lizzie Salita 3/12/18
 */

import CoreAward from 'models/v2/awards/CoreAward';

const awardData = {
    category: null,
    startDate: '1989-01-02',
    endDate: '1999-12-31',
    subawardTotal: '12004.75'
};

const award = Object.create(CoreAward);
award.populateCore(awardData);

describe('Core Award getter functions', () => {
    it('should use IDV when the category is null', () => {
        expect(award.category).toEqual('idv');
    });
    it('should properly format the start and end dates', () => {
        expect(award.startDate).toEqual('01/02/1989');
        expect(award.endDate).toEqual('12/31/1999');
    });
    it('should format the subaward total', () => {
        expect(award.subawardTotal).toEqual('$12,005');
    });
});
