<commit_before>import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha';
import { setupComponentTest } from 'ember-mocha';
import Ember from 'ember';

const { get } = Ember;

describe('Unit | Component | r-avatar', function() {
  setupComponentTest('r-avatar', {
    unit: true
  });

  let component;

  beforeEach(function () {
    component = this.subject();
  });

  describe('properties', function () {
    it('should have correct tag name', function () {
      expect(get(component, 'tagName')).to.be.eql('img');
    });

    it('should have correct classNameBindings set', function () {
      expect(get(component, 'classNameBindings')).to.be.eql([
        // sizes
        'small:icon-small',
        'medium:icon-medium',
        'large:icon-large',
        'x-large:icon-x-large'
      ]);
    });

    it('should have correct attributes set', function () {
      expect(get(component, 'allowedAttributes')).to.be.eql({
        size: ['small', 'medium', 'large', 'x-large']
      });
    });

    it('should have correct defaults set', function () {
      expect(get(component, 'defaults')).to.be.eql({
        size: 'medium'
      });
    });
  });

  // describe('methods', function () {
  //   describe('init', function () {
  //     const method = this.title;
  //
  //     it('should call _setOptionFlag for each key in options property', function () {
  //       set(component, '_setOptionFlag', sinon.spy());
  //
  //       component[method]();
  //
  //       Object.keys(get(component, 'options')).forEach(key => {
  //         expect(get(component, '_setOptionFlag').calledWith(key)).to.be.equal(true);
  //       });
  //     });
  //   });
  //
  //   describe('_setOptionFlag', function () {
  //     const method = this.title;
  //     const flagType = 'size';
  //     const flagName = 'large';
  //
  //     it('should set given flagName', function () {
  //       component.setProperties({
  //         _isValidFlagName: sinon.stub().returns(true),
  //         [flagType]: flagName
  //       });
  //
  //       component[method](flagType);
  //
  //       expect(get(component, flagName)).to.be.equal(true);
  //     });
  //
  //     it('should set default flagName', function () {
  //       component.setProperties({
  //         _isValidFlagName: sinon.stub().returns(false),
  //         [flagType]: flagName
  //       });
  //
  //       component[method](flagType);
  //
  //       expect(get(component, get(component, `defaults.${flagType}`))).to.be.equal(true);
  //     })
  //   });
  //
  //   describe('_isValidFlagName', function () {
  //     const method = this.title;
  //
  //     it('should return true', function () {
  //       expect(component[method]('size', 'large')).to.be.equal(true);
  //     });
  //
  //     it('should return false', function () {
  //       expect(component[method]('size', 'foo-bar')).to.be.equal(false);
  //     });
  //   });
  //});
});<commit_msg>Remove old avatar tests<commit_after>import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha';
import { setupComponentTest } from 'ember-mocha';
import Ember from 'ember';

const { get } = Ember;

describe('Unit | Component | r-avatar', function() {
  setupComponentTest('r-avatar', {
    unit: true
  });

  let component;

  beforeEach(function () {
    component = this.subject();
  });

  describe('properties', function () {
    it('should have correct tag name', function () {
      expect(get(component, 'tagName')).to.be.eql('img');
    });

    it('should have correct classNameBindings set', function () {
      expect(get(component, 'classNameBindings')).to.be.eql([
        // sizes
        'small:icon-small',
        'medium:icon-medium',
        'large:icon-large',
        'x-large:icon-x-large'
      ]);
    });

    it('should have correct attributes set', function () {
      expect(get(component, 'allowedAttributes')).to.be.eql({
        size: ['small', 'medium', 'large', 'x-large']
      });
    });

    it('should have correct defaults set', function () {
      expect(get(component, 'defaults')).to.be.eql({
        size: 'medium'
      });
    });
  });
});
{'fraction_non_alphanumeric': 0.19284341978866473, 'fraction_numerical': 0.0, 'mean_word_length': 2.4027777777777777, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '6533218', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1297, 'n_words': 241}