<commit_before>'use strict';

describe('Directive: barChart', function () {

  // load the directive's module
  beforeEach(module('sumaAnalysis'));

  var element,
      scope,
      linkScope,
      stub;

  beforeEach(inject(function ($rootScope, $compile) {
    element = angular.element('<bar-chart id="chart-2" data="data.barChartData"></bar-chart>');

    scope = $rootScope.$new();

    element = $compile(element)(scope);
    scope.$digest();

    linkScope = element.isolateScope();
  }));

  it('should make hidden element visible', inject(function ($compile) {
    stub = sinon.stub(linkScope, 'render');
    stub.returns(true);

    scope.$apply(function() {
      scope.data = {};
      scope.data.barChartData = [1, 2, 3, 4];
    });

    scope.$apply(function() {
      scope.data.barChartData = [5, 6, 7, 8];
    });

    expect(stub).to.be.calledTwice();
    stub.restore();
  }));
});<commit_msg>update barChart tests<commit_after>'use strict';

describe('Directive: barChart', function () {

  // load the directive's module
  beforeEach(module('sumaAnalysis'));

  var element,
      scope,
      linkScope,
      stub;

  beforeEach(inject(function ($rootScope, $compile) {
    element = angular.element('<bar-chart id="chart-2" data="data.barChartData"></bar-chart>');

    scope = $rootScope.$new();

    element = $compile(element)(scope);
    scope.$digest();

    linkScope = element.isolateScope();
  }));

  it('should respond to data change and call render', inject(function ($compile) {
    stub = sinon.stub(linkScope, 'render');
    stub.returns(true);

    scope.$apply(function() {
      scope.data = {};
      scope.data.barChartData = [1, 2, 3, 4];
    });

    scope.$apply(function() {
      scope.data.barChartData = [5, 6, 7, 8];
    });

    expect(stub).to.be.calledTwice();
    stub.restore();
  }));
});
{'fraction_non_alphanumeric': 0.18083378451543042, 'fraction_numerical': 0.009745533297238766, 'mean_word_length': 3.297674418604651, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4219442', 'n_tokens_mistral': 611, 'n_tokens_neox': 586, 'n_words': 115}