<commit_before>'use strict';

describe('Filter: pageInfo', function () {

  // load the controller's module
  beforeEach(module('stPagination'));

  beforeEach(function () {
    jasmine.addMatchers(customJasmineMatchers);
  });

  var $scope;

  // Initialize the controller and a mock scope
  beforeEach(inject(function ($controller, $rootScope, $filter) {
    $scope = $rootScope.$new();
    $scope.commits = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23];
    $filter("pagination")($scope.commits);
  }));

  it('should throw an error for undefined properties', inject(function ($filter) {
    expect(function () {
      $filter("pageInfo")($scope.commits, 'undefinedProperty');
    }).toThrow(new Error("No display property 'undefinedProperty' defined for the pageInfo filter"));
  }));

  it('should pass the input for inputs without pagination', inject(function ($filter) {
    expect($filter("pageInfo")([], 'totalPages')).toEqual([]);
    expect($filter("pageInfo")(123, 'currentPage')).toEqual(123);
    expect($filter("pageInfo")({}, 'totalPages')).toEqual({});
    expect($filter("pageInfo")(undefined, 'totalPages')).toEqual(undefined);<commit_msg>Removed uneccessary customMatcher definition from test.<commit_after>'use strict';

describe('Filter: pageInfo', function () {

  // load the controller's module
  beforeEach(module('stPagination'));

  var $scope;

  // Initialize the controller and a mock scope
  beforeEach(inject(function ($controller, $rootScope, $filter) {
    $scope = $rootScope.$new();
    $scope.commits = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23];
    $filter("pagination")($scope.commits);
  }));

  it('should throw an error for undefined properties', inject(function ($filter) {
    expect(function () {
      $filter("pageInfo")($scope.commits, 'undefinedProperty');
    }).toThrow(new Error("No display property 'undefinedProperty' defined for the pageInfo filter"));
  }));

  it('should pass the input for inputs without pagination', inject(function ($filter) {
    expect($filter("pageInfo")([], 'totalPages')).toEqual([]);
    expect($filter("pageInfo")(123, 'currentPage')).toEqual(123);
    expect($filter("pageInfo")({}, 'totalPages')).toEqual({});
    expect($filter("pageInfo")(undefined, 'totalPages')).toEqual(undefined);
{'fraction_non_alphanumeric': 0.18787878787878787, 'fraction_numerical': 0.03722943722943723, 'mean_word_length': 5.797058823529412, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7240575', 'n_tokens_mistral': 743, 'n_tokens_neox': 717, 'n_words': 142}