<commit_before>describe('mdProgressCircular', function() {
  beforeEach(module('material.components.progressCircular'));

  it('should update aria-valuenow', inject(function($compile, $rootScope) {
    var element = $compile('<div>' +
      '<md-progress-circular value="{{progress}}">' +
      '</md-progress-circular>' +
      '</div>')($rootScope);

    $rootScope.$apply(function() {
      $rootScope.progress = 50;
    });

    var progress = element.find('md-progress-circular');

    expect(progress.eq(0).attr('aria-valuenow')).toEqual('50');
  }));
});<commit_msg>update(progessCircular): add tests for md-diameter and scaling<commit_after>ddescribe('mdProgressCircular', function() {
  var $compile, $rootScope;

  beforeEach(module('material.components.progressCircular'));
  beforeEach(inject(function(_$compile_, _$rootScope_) {
    $compile = _$compile_;
    $rootScope = _$rootScope_;
  }));

  it('should update aria-valuenow', inject(function($compile, $rootScope) {
    var element = $compile('<div>' +
      '<md-progress-circular value="{{progress}}">' +
      '</md-progress-circular>' +
      '</div>')($rootScope);

    $rootScope.$apply(function() {
      $rootScope.progress = 50;
    });

    var progress = element.find('md-progress-circular');

    expect(progress.eq(0).attr('aria-valuenow')).toEqual('50');
  }));

  it('should set scaling using percentage values',function() {
    var progress = buildIndicator('<md-progress-circular md-diameter="25%"></md-progress-circular>');
    expect( getScale(progress) ).toBe(0.25);
  });

  it('should set scaling using pixel values', function() {
    var DEFAULT_SIZE = 96;

    var progress = buildIndicator('<md-progress-circular md-diameter="37px"></md-progress-circular>');
    var value = Math.round( (37 / DEFAULT_SIZE) * 100 )/100;

    expect( getScale(progress) ).toBe(value);
  });

  /**
   * Build a progressCircular
   */
  function buildIndicator(template) {
    var element = $compile('<div>' + template + '</div>')($rootScope);
        $rootScope.$digest();

    return element.find('md-progress-circular');
  }

  /**
   * Lookup the scale value assigned; based on the md-diameter attribute value
   */
  function getScale(element) {
    var el = angular.element(element)[0];
    var transform = el.style['transform'] || el.style['-webkit-transform'];
    var matches = /scale\(([0-9\.]+)\)/.exec(transform);
    var scale = parseFloat(matches[1]);

    return Math.round(scale * 100)/100;
  }
});
{'fraction_non_alphanumeric': 0.18528938906752412, 'fraction_numerical': 0.01487138263665595, 'mean_word_length': 4.00804828973843, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '3952981', 'n_tokens_mistral': 801, 'n_tokens_neox': 769, 'n_words': 138}