<commit_before>
import React from 'react'
import { mount, shallow } from 'enzyme';
import { expect } from 'chai';
import Avatar from '../Avatar.js'

let title = "testTitle";
let image = "picture.jpg";
let icon = 'icon={<i className="fa fa-github"></i>}';

describe('Testing Avatar component', () => {
  it('Set props should match what was passed in', function() {
    const result = mount(<Avatar title={title} image={image} icon={icon}/>);
    expect(result.props().title).to.equal(title);
    expect(result.props().image).to.equal(image);
    expect(result.find('img').length).to.equal(1);
    expect(result.props().icon).to.equal(icon);
  });

  it('If image is not set then state.image should be equal to defaultImage', function() {
    const result = mount(<Avatar defaultImage={image}/>);
    expect(result.state().image).to.equal(image);<commit_msg>Import via index.js instead of via Avatar.js to increase code coverage during testing.<commit_after>
import React from 'react'
import { mount, shallow } from 'enzyme';
import { expect } from 'chai';
import Avatar from '../index.js'

let title = "testTitle";
let image = "picture.jpg";
let icon = 'icon={<i className="fa fa-github"></i>}';

describe('Testing Avatar component', () => {
  it('Set props should match what was passed in', function() {
    const result = mount(<Avatar title={title} image={image} icon={icon}/>);
    expect(result.props().title).to.equal(title);
    expect(result.props().image).to.equal(image);
    expect(result.find('img').length).to.equal(1);
    expect(result.props().icon).to.equal(icon);
  });

  it('If image is not set then state.image should be equal to defaultImage', function() {
    const result = mount(<Avatar defaultImage={image}/>);
    expect(result.state().image).to.equal(image);
{'fraction_non_alphanumeric': 0.17769058295964127, 'fraction_numerical': 0.0011210762331838565, 'mean_word_length': 4.64873417721519, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '5042855', 'n_tokens_mistral': 547, 'n_tokens_neox': 536, 'n_words': 149}