<commit_before>import React from 'react'
import ReactDom from 'react-dom'
import TestUtils from 'react/lib/ReactTestUtils'
import {wrap} from 'react-stateless-wrapper'

import Organization from '../organization'

describe('Organization component', () => {
  const props = {
    avatarUrl: 'http://foo.bar/avatar',
    description: 'Lorem ipsum',
    name: 'APSL',
    htmlUrl: 'http://foo.bar/'
  }
  const WrappedOrganization = wrap(Organization)
  const organization = TestUtils.renderIntoDocument(<WrappedOrganization {...props} />)
  const orgNode = ReactDom.findDOMNode(organization)

  it('should have an image avatar link', () => {
    const a = orgNode.querySelector('a');
    expect(a.href).toBe(props.htmlUrl)

    const img = a.querySelector('img');
    expect(img.src.startsWith(props.avatarUrl)).toBeTruthy()
  })

  it('should have a description in H1', () => {
    const h1 = orgNode.querySelector('h1');
    expect(h1.textContent).toBe(props.description)<commit_msg>Fix organization spec<commit_after>import React from 'react'
import ReactDom from 'react-dom'
import TestUtils from 'react/lib/ReactTestUtils'
import {wrap} from 'react-stateless-wrapper'

import Organization from '../organization'

describe('Organization component', () => {
  const props = {
    avatarUrl: 'http://foo.bar/avatar',
    description: 'Lorem ipsum',
    name: 'APSL',
    web: 'http://foo.bar/'
  }
  const WrappedOrganization = wrap(Organization)
  const organization = TestUtils.renderIntoDocument(<WrappedOrganization {...props} />)
  const orgNode = ReactDom.findDOMNode(organization)

  it('should have an image avatar link', () => {
    const a = orgNode.querySelector('a');
    expect(a.href).toBe(props.web)

    const img = a.querySelector('img');
    expect(img.src.startsWith(props.avatarUrl)).toBeTruthy()
  })

  it('should have a description in H1', () => {
    const h1 = orgNode.querySelector('h1');
    expect(h1.textContent).toBe(props.description)
{'fraction_non_alphanumeric': 0.14663951120162932, 'fraction_numerical': 0.004073319755600814, 'mean_word_length': 4.354223433242507, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '6803937', 'n_tokens_mistral': 613, 'n_tokens_neox': 605, 'n_words': 135}