<commit_before>describe 'thumb_selector', ->
  beforeEach ->
    loadFixtures 'thumb_selector.html'
    window.thumb_selector_init()

  describe 'inidividual selection', ->
    it 'gives its parents the selected class when checked', ->
      $('#check1').prop('checked', true).trigger('change')

      expect($('#div1')).toHaveClass('selected')

    it 'toggles the checkbox when the parent div is clicked', ->
      $('#div1').click()

      expect($('#check1')).toBeChecked()

    it 'updates the selected count', ->
      $('#div1').click()
      $('#div2').click()
      $('#div2').click()

      expect($('.selected-count')).toHaveText('1')

  it 'selects all when a select all button is clicked', ->
    $('.select-all').click()

    expect($('#check1')).toBeChecked()
    expect($('#check2')).toBeChecked()
    expect($('#check3')).toBeChecked()

  it 'selects none when a select none button is clicked', ->
    $('.select-all').click()
    $('.select-none').click()

    expect($('#check1')).not.toBeChecked()
    expect($('#check2')).not.toBeChecked()
    expect($('#check3')).not.toBeChecked()

  xit 'disables disable-none-selected when none are selected'

  xit 'enables enable-some-selected when some are selected'<commit_msg>Add specs for none selected and some selected callbacks.<commit_after>describe 'thumb_selector', ->
  beforeEach ->
    loadFixtures 'thumb_selector.html'
    window.thumb_selector_init()

  describe 'individual selection', ->
    it 'gives its parents the selected class when checked', ->
      $('#check1').prop('checked', true).trigger('change')

      expect($('#div1')).toHaveClass('selected')

    it 'toggles the checkbox when the parent div is clicked', ->
      $('#div1').click()

      expect($('#check1')).toBeChecked()

    it 'updates the selected count', ->
      $('#div1').click()
      $('#div2').click()
      $('#div2').click()

      expect($('.selected-count')).toHaveText('1')

  it 'selects all when a select all button is clicked', ->
    $('.select-all').click()

    expect($('#check1')).toBeChecked()
    expect($('#check2')).toBeChecked()
    expect($('#check3')).toBeChecked()

  it 'selects none when a select none button is clicked', ->
    $('.select-all').click()
    $('.select-none').click()

    expect($('#check1')).not.toBeChecked()
    expect($('#check2')).not.toBeChecked()
    expect($('#check3')).not.toBeChecked()

  it 'disables disable-none-selected when none are selected', ->
    $('#div1').click()
    $('.select-none').click()

    expect($('.disable-none-selected')).toHaveClass('disabled')

  it 'enables enable-some-selected when some are selected', ->
    $('#div1').click()
    expect($('.enable-some-selected')).not.toHaveClass('disabled')

{'fraction_non_alphanumeric': 0.20255941499085922, 'fraction_numerical': 0.010968921389396709, 'mean_word_length': 3.7091222030981066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '5385296', 'n_tokens_mistral': 806, 'n_tokens_neox': 802, 'n_words': 182}