<commit_before>import Icon from '../index.es6';

describe('Icon', () => {
  let icon;
  let renderedIcon;
  beforeEach(() => {
    icon = new Icon({
      icon: 'facebook',
      uri: '/test-icons.svg'
    });
    renderedIcon = icon.render();
  });
  it('Is an SVG pointing to the passed SVG URI', () => {
    renderedIcon.type.should.equal('svg');
    renderedIcon.props.dangerouslySetInnerHTML.__html.should.match(/xlink:href="\/test-icons.svg#facebook"/);
  });
  it('Has aria role and labelledby attributes', () => {
    renderedIcon.props.role.should.eql('img');
    renderedIcon.props['aria-labelledby'].should.eql('title desc');
    renderedIcon.props.dangerouslySetInnerHTML.__html.should.match(/<title id="title">Icon/i);
    renderedIcon.props.dangerouslySetInnerHTML.__html.should.match(/<desc id="desc">facebook/i);
  });
});<commit_msg>update tests for new a11y<commit_after>import Icon from '../index.es6';

describe('Icon', () => {
  let icon;
  let renderedIcon;
  beforeEach(() => {
    icon = new Icon({
      icon: 'facebook',
      uri: '/test-icons.svg'
    });
    renderedIcon = icon.render();
  });
  it('Is an SVG pointing to the passed SVG URI', () => {
    renderedIcon.type.should.equal('svg');
    renderedIcon.props.dangerouslySetInnerHTML.__html.should.match(/xlink:href="\/test-icons.svg#facebook"/);
  });
  it('Has aria role and labelledby attributes', () => {
    renderedIcon.props.role.should.eql('img');
    renderedIcon.props['aria-labelledby'].should.eql('title');
    renderedIcon.props.dangerouslySetInnerHTML.__html.should.match(/<title id="title">facebook icon/i);
  });
});
{'fraction_non_alphanumeric': 0.18468190240889437, 'fraction_numerical': 0.0024706609017912293, 'mean_word_length': 3.909090909090909, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 14, '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': '7079933', 'n_tokens_mistral': 526, 'n_tokens_neox': 511, 'n_words': 88}