{"size": 1334, "ext": "js", "max_stars_repo_path": "test/spec/ngPdfSpec.js", "max_stars_repo_name": "Huespal/angularjs-pdf", "max_stars_repo_stars_event_min_datetime": "2016-04-20T10:01:38.000Z", "max_stars_repo_stars_event_max_datetime": "2017-03-15T00:54:10.000Z", "max_issues_repo_path": "test/spec/ngPdfSpec.js", "max_issues_repo_name": "Huespal/angular-js-pdf", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/spec/ngPdfSpec.js", "max_forks_repo_name": "Huespal/angular-js-pdf", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.3181818182, "max_line_length": 111, "alphanum_fraction": 0.6371814093}
describe('ngPdf', function() {
  console.log = function() {};
  var element, $scope;

  // Load the myApp module, which contains the directive
  beforeEach(module('App'));

  beforeEach(module('my.templates'));

  beforeEach(inject(function(_$compile_, _$rootScope_, _$document_){
    // The injector unwraps the underscores (_) from around the parameter names when matching
    var $compile = _$compile_;
    var $rootScope = _$rootScope_;
    var $document = _$document_;
    $scope = $rootScope.$new();
    // Compile a piece of HTML containing the directive
    var html = '<ng-pdf template-url="partials/viewer.html" canvasid="pdf" scale="page-fit" page=13></ng-pdf>';
    var elmnt = angular.element(html);
    $document.find('body').append(elmnt);
    element = $compile(elmnt)($scope);
    $scope.pdfUrl = '/pdf/relativity.pdf';
    $scope.$digest();
  }));

  beforeEach(function(done){
      setTimeout(function() {
        done();
      }, 9000);
  }, 10000);

  it('ng-pdf maust have 1 canvas', function() {
    var canvas = element.find('canvas');
    expect(canvas.length).toBe(1);
  });

  it('goNext and goPrevious change page', function(){
      expect($scope.pageNum).toBe(13);
      $scope.goPrevious();
      expect($scope.pageNum).toBe(12);
      $scope.goNext();
      expect($scope.pageNum).toBe(13);
  });
});
