<commit_before>import React from 'react'
import { shallow } from 'enzyme'
import CatalogPreview from '../CatalogPreview'
import Percent from '../../Statistics/Percent/Percent'
import Counter from '../../Statistics/Counter/Counter'

import catalog from '../../../fetch/__test__/catalog.json'

describe('<CatalogPreview />', () => {
  describe('metrics is defined', () => {
    let wrapper
    beforeEach(() =>  {
      wrapper = shallow(<CatalogPreview catalog={catalog} />)
    })

    it('should display the number of records', () => {
      const records = <Counter value={catalog.metrics.records.totalCount} label="Enregistrements" />
      expect(wrapper.contains(records)).to.be.true
    })

    it('should display the openness percent', () => {
      const open = <Percent value={ catalog.metrics.datasets.partitions['openness'].yes} label="Données ouvertes" total={catalog.metrics.datasets.totalCount} icon="unlock alternate icon" />
      expect(wrapper.contains(open)).to.be.true
    })

    it('should display the downloadable percent', () => {
      const download = <Percent value={ catalog.metrics.datasets.partitions['download'].yes} label="Téléchargeable" total={catalog.metrics.datasets.totalCount} icon="download" />

      expect(wrapper.contains(download)).to.be.true<commit_msg>Update test<commit_after>import React from 'react'
import { shallow } from 'enzyme'
import CatalogPreview from '../CatalogPreview'
import Percent from '../../Statistics/Percent/Percent'
import Counter from '../../Statistics/Counter/Counter'

import catalog from '../../../fetch/__test__/catalog.json'

describe('<CatalogPreview />', () => {
  describe('metrics is defined', () => {
    let wrapper
    beforeEach(() =>  {
      wrapper = shallow(<CatalogPreview catalog={catalog} />)
    })

    it('should display the number of records', () => {
      const records = <Counter value={catalog.metrics.records.totalCount} size="small" label="Enregistrements" />
      expect(wrapper.contains(records)).to.be.true
    })

    it('should display the openness percent', () => {
      const open = <Percent value={ catalog.metrics.datasets.partitions['openness'].yes} size="small" label="Données ouvertes" total={catalog.metrics.datasets.totalCount} icon="unlock alternate icon" />
      expect(wrapper.contains(open)).to.be.true
    })

    it('should display the downloadable percent', () => {
      const download = <Percent value={ catalog.metrics.datasets.partitions['download'].yes} size="small" label="Téléchargeable" total={catalog.metrics.datasets.totalCount} icon="download" />

      expect(wrapper.contains(download)).to.be.true
{'fraction_non_alphanumeric': 0.1614128370679833, 'fraction_numerical': 0.0, 'mean_word_length': 4.114563106796116, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5775661', 'n_tokens_mistral': 714, 'n_tokens_neox': 707, 'n_words': 157}