<commit_before>import chai from 'chai'
import React from 'react'
import {
  findRenderedDOMComponentWithTag,
  renderIntoDocument
} from 'react-addons-test-utils'

import ReactSVG from '../src'

chai.should()

describe('react-svg', () => {
  describe('while rendering', () => {
    it('should add the className to the rendered component', () => {
      const reactSVG = renderIntoDocument(
        <ReactSVG
          className={'not-vml'}
          path={'http://localhost:9876/base/test/fixtures/atomic.svg'}
        />
      )

      findRenderedDOMComponentWithTag(reactSVG, 'img').className
        .should.eql('not-vml')
    })

    it('should add the path to the rendered component', () => {
      const reactSVG = renderIntoDocument(
        <ReactSVG
          className={'not-vml'}
          path={'http://localhost:9876/base/test/fixtures/atomic.svg'}
        />
      )

      findRenderedDOMComponentWithTag(reactSVG, 'img').dataset.src
        .should.eql('http://localhost:9876/base/test/fixtures/atomic.svg')
    })
  })

  describe('after mounting', () => {
    it('should run the callback when the SVGInjector has finished', (done) => {
      renderIntoDocument(
        <ReactSVG
          className={'not-vml'}
          path={'http://localhost:9876/base/test/fixtures/atomic.svg'}
          callback={(svg) => {
            svg.classList.contains('not-vml').should.be.true
            done()
          }}<commit_msg>Add test for inline style support<commit_after>import chai from 'chai'
import React from 'react'
import {
  findRenderedDOMComponentWithTag,
  renderIntoDocument
} from 'react-addons-test-utils'

import ReactSVG from '../src'

chai.should()

describe('react-svg', () => {
  describe('while rendering', () => {
    it('should add the className to the rendered component', () => {
      const reactSVG = renderIntoDocument(
        <ReactSVG
          className={'not-vml'}
          path={'http://localhost:9876/base/test/fixtures/atomic.svg'}
        />
      )

      findRenderedDOMComponentWithTag(reactSVG, 'img').className
        .should.eql('not-vml')
    })

    it('should add the path to the rendered component', () => {
      const reactSVG = renderIntoDocument(
        <ReactSVG
          className={'not-vml'}
          path={'http://localhost:9876/base/test/fixtures/atomic.svg'}
        />
      )

      findRenderedDOMComponentWithTag(reactSVG, 'img').dataset.src
        .should.eql('http://localhost:9876/base/test/fixtures/atomic.svg')
    })

    it('should add any inline styles to the rendered component', () => {
      const reactSVG = renderIntoDocument(
        <ReactSVG
          path={'http://localhost:9876/base/test/fixtures/atomic.svg'}
          style={{
            height: 200
          }}
        />
      )

      findRenderedDOMComponentWithTag(reactSVG, 'img').style.height
        .should.eql('200px')
    })
  })

  describe('after mounting', () => {
    it('should run the callback when the SVGInjector has finished', (done) => {
      renderIntoDocument(
        <ReactSVG
          className={'not-vml'}
          path={'http://localhost:9876/base/test/fixtures/atomic.svg'}
          callback={(svg) => {
            svg.classList.contains('not-vml').should.be.true
            done()
          }}
{'fraction_non_alphanumeric': 0.14573170731707316, 'fraction_numerical': 0.012804878048780487, 'mean_word_length': 2.5053418803418803, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 23, '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': '6111761', 'n_tokens_mistral': 1007, 'n_tokens_neox': 992, 'n_words': 173}