<commit_before>import AlbumInfo from '@/components/main-wrapper/extra/album-info.vue'
import TrackListItem from '@/components/shared/track-list-item.vue'
import album from '@/tests/blobs/album'
import _ from 'lodash'

describe('components/main-wrapper/extra/album-info', () => {
  it('displays the info as a sidebar by default', () => {
    const wrapper = shallow(AlbumInfo, {
      propsData: {
        album
      }
    })
    expect(wrapper.findAll('#albumInfo.sidebar')).toHaveLength(1)
    expect(wrapper.findAll('#albumInfo.full')).toHaveLength(0)
  })

  it('can display the info in full mode', () => {
    const wrapper = shallow(AlbumInfo, {
      propsData: {
        album,
        mode: 'full'
      }
    })
    expect(wrapper.findAll('#albumInfo.sidebar')).toHaveLength(0)
    expect(wrapper.findAll('#albumInfo.full')).toHaveLength(1)
  })

  it('triggers showing full wiki', () => {
    const wrapper = shallow(AlbumInfo, {
      propsData: {
        album
      }
    })
    wrapper.find('.wiki button.more').trigger('click')
    expect(wrapper.html()).toContain(album.info.wiki.full)
  })

  it('lists the correct number of tracks', () => {
    const wrapper = mount(AlbumInfo, {
      propsData: {
        album
      }
    })
    expect(wrapper.findAll(TrackListItem)).toHaveLength(2)
  })

  it('displays a message if the album has no info', () => {
    const albumWithNoInfo = _.clone(album)
    albumWithNoInfo.info = null
    const wrapper = mount(AlbumInfo, {
      propsData: {
        album: albumWithNoInfo
      }
    })
    expect(wrapper.html()).toContain('No album information found.')
  })
})
<commit_msg>Add tests for extra/album-info<commit_after>import AlbumInfo from '@/components/main-wrapper/extra/album-info.vue'
import TrackListItem from '@/components/shared/track-list-item.vue'
import album from '@/tests/blobs/album'

describe('components/main-wrapper/extra/album-info', () => {
  it('displays the info as a sidebar by default', () => {
    const wrapper = shallow(AlbumInfo, {
      propsData: {
        album
      }
    })
    expect(wrapper.findAll('#albumInfo.sidebar')).toHaveLength(1)
    expect(wrapper.findAll('#albumInfo.full')).toHaveLength(0)
  })

  it('can display the info in full mode', () => {
    const wrapper = shallow(AlbumInfo, {
      propsData: {
        album,
        mode: 'full'
      }
    })
    expect(wrapper.findAll('#albumInfo.sidebar')).toHaveLength(0)
    expect(wrapper.findAll('#albumInfo.full')).toHaveLength(1)
  })

  it('triggers showing full wiki', () => {
    const wrapper = shallow(AlbumInfo, {
      propsData: {
        album
      }
    })
    wrapper.find('.wiki button.more').trigger('click')
    expect(wrapper.html()).toContain(album.info.wiki.full)
  })

  it('lists the correct number of tracks', () => {
    const wrapper = mount(AlbumInfo, {
      propsData: {
        album
      }
    })
    expect(wrapper.findAll(TrackListItem)).toHaveLength(2)
  })

  it('displays a message if the album has no info', () => {
    const albumWithNoInfo = _.clone(album)
    albumWithNoInfo.info = null
    const wrapper = mount(AlbumInfo, {
      propsData: {
        album: albumWithNoInfo
      }
    })
    expect(wrapper.html()).toContain('No album information found.')
  })
})

{'fraction_non_alphanumeric': 0.15097799511002444, 'fraction_numerical': 0.003056234718826406, 'mean_word_length': 2.9914634146341466, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2499397', 'n_tokens_mistral': 1031, 'n_tokens_neox': 1009, 'n_words': 190}