{"size": 1192, "ext": "js", "max_stars_repo_path": "test/spec/details/details-constants-directive.spec.js", "max_stars_repo_name": "azavea/ashlar-schema-editor", "max_stars_repo_stars_event_min_datetime": "2018-07-13T20:13:34.000Z", "max_stars_repo_stars_event_max_datetime": "2018-07-13T20:13:34.000Z", "max_issues_repo_path": "test/spec/details/details-constants-directive.spec.js", "max_issues_repo_name": "azavea/ashlar-schema-editor", "max_issues_repo_issues_event_min_datetime": "2018-07-17T17:13:33.000Z", "max_issues_repo_issues_event_max_datetime": "2018-08-23T19:37:29.000Z", "max_forks_repo_path": "grout-schema-editor/test/spec/details/details-constants-directive.spec.js", "max_forks_repo_name": "jeancochrane/philly-fliers", "max_forks_repo_forks_event_min_datetime": "2018-09-08T13:30:13.000Z", "max_forks_repo_forks_event_max_datetime": "2018-09-08T13:30:13.000Z"}
{"max_stars_count": 1, "max_issues_count": 22, "max_forks_count": 1, "avg_line_length": 33.1111111111, "max_line_length": 92, "alphanum_fraction": 0.6224832215}
'use strict';

describe('ase.details: DetailsConstants', function () {

    beforeEach(module('ase.templates'));
    beforeEach(module('ase.details'));
    beforeEach(module('ase.mock.resources'));

    var $compile;
    var $httpBackend;
    var $rootScope;
    var ResourcesMock;

    beforeEach(inject(function (_$compile_, _$httpBackend_, _$rootScope_, _ResourcesMock_) {
        $compile = _$compile_;
        $httpBackend = _$httpBackend_;
        $rootScope = _$rootScope_;
        ResourcesMock = _ResourcesMock_;
    }));

    it('should render constants', function () {
        var scope = $rootScope.$new();
        scope.record = ResourcesMock.RecordResponse.results[0];

        var element = $compile('<ase-details-constants record="record">' +
                               '</ase-details-constants>')(scope);
        $rootScope.$apply();

        expect(element.find('.map').length).toEqual(1);
        expect(element.find('.value.created').length).toEqual(1);
        expect(element.find('.value.latitude').length).toEqual(1);
        expect(element.find('.value.longitude').length).toEqual(1);
        expect(element.find('.value.occurred').length).toEqual(1);
    });
});
