<commit_before>
data =
  listComplete :
    id : "list-id"
    class : "list-class"
    action : ->
      Session.set('eventTest', "insideData")
    items : [
      {
        title :
          name : "First Item"
          class : "title-class-first"
        description:
          name : "First description"
          class : "description-class-first"
        id : "first-item-id"
        class : "first-item-class"
        action : ->
          Session.set('eventTest', "insideItem")
      },
      {
        class : "second-item-class"
        action : ->
          Session.set('eventTest', 'insideRow')
        cells : [
          {
            icons : [
              {
                id : "first-icon"
                class : "first-icon-class"
                icon : "first-icon"
                href : "first-icon-link"
                action : ->
                  Session.set('eventTest', "insideIcon")
              }
              {
                id : "second-icon"
                class : "second-icon-class"
                icon : "second-icon"
                href : "second-icon-link"
              }
            ]
          }
          {
            title : "Title One"
            description : "Description One"
            class : "first-cell-class"
            icons : [
              {
                icon : "first-icon"
              }
            ]
          }
          {
            title : "Title Two"
            description : "Description Two"
            class : "second-cell-class"
            action : ->
              Session.set('eventTest', 'insideCell')
          }
        ]
      }
      {
        id : 'third-item'
        cells : [
          {
            id : "item3-cell1"
            title : "first-cell"
            href : '/item3-cell1'
          }
          {
            icons : [
              {
                id : "item3-cell3-icon1"
                icon : "one-icon"
              }
            ]
          }
        ]
      }
      {
        class : "test-class test-class2"
        title : "Last Item"
        href : "/home"
        id : "last-item-id"
        icons : [
          {
            icon : "last-icon"
            class : "last-icon-class"
            id : "last-icon-id"
            href : "last-icon-href"
            action : ->
              Session.set('eventTest', 'insideLastIcon')
          }
        ]
      }
    ]


listTests =
  name : "Test list element"
  tests : [
    {
      name : "List : Helper"
      data : data.listComplete
      template : "TEList"
      test : (div)->
        # has list id
        expect(div.find("#list-id").length).toEqual(1)
        # has list class
        expect(div.find(".list-class").length).toEqual(1)

        # has first item class
        expect(div.find('.te-first-item').length).toEqual(1)
        # first item class is in the first item
        expect(div.find('[item="0"]').hasClass('te-first-item')).toBe(true)
        # has last item class
        expect(div.find('.te-last-item').length).toEqual(1)
        # last item class is in the last item
        expect(div.find('[item="3"]').hasClass('te-last-item')).toBe(true)
        # four items have title
        expect(div.find('.te-title').length).toEqual(5)
        # three items have description
        expect(div.find('.te-description').length).toEqual(3)

        # check single component item
          # id exists
        expect(div.find('#first-item-id').length).toEqual(1)
          # class exists
        expect(div.find('.first-item-class').length).toEqual(1)
        expect(div.find('.test-class').length).toEqual(1)
        expect(div.find('.test-class2').length).toEqual(1)
          # class in title object exists
        expect(div.find('.title-class-first').length).toEqual(1)
          # class in description object exists
        expect(div.find('.description-class-first').length).toEqual(1)
          # href exists
        expect(div.find('.test-class .te-content').attr('href')).toEqual('/home')
        expect(div.find('.test-class .last-icon-class').length).toEqual(1)
        expect(div.find('#last-icon-id').length).toEqual(1)
        expect(div.find('.test-class .last-icon-class').attr('href')).toEqual('last-icon-href')

          # last item first cell span 2
        expect(div.find('#last-item-id .te-first-cell').attr('colspan')).toEqual("2")
          # last item last cell has the same href
        expect(div.find('#last-item-id .te-last-cell > a').attr('href')).toEqual('/home')

        # check cells
          # icon in a cell is not displayed
        expect(div.find('.first-cell-class').find('.icon').length).toEqual(0)
          # three cells in a row
        expect(div.find('.second-item-class').find('td').length).toEqual(3)
          # id in icon exists
        expect(div.find('#first-icon').length).toEqual(1)
          # class in icon exists
        expect(div.find('.first-icon-class').length).toEqual(1)
          # three first cells
        expect(div.find('.te-first-cell').length).toEqual(4)
          #three last cells
        expect(div.find('.te-last-cell').length).toEqual(4)
          # icon href match
        expect(div.find('#second-icon').attr('href')).toEqual('second-icon-link')
          #icon exists
        expect(div.find('.fa-first-icon').length).toEqual(1)
          # check text
        expect(div.find('.first-cell-class .te-title').text()).toEqual('Title One')

          # third item first cell span 2
        expect(div.find('#item3-cell1').attr('colspan')).toEqual("2")
        expect(div.find('#item3-cell1 > a').attr('href')).toEqual('/item3-cell1')
          # third item last cell also has the same href as the first Item
        expect(div.find('#third-item .te-last-cell > a').attr('href')).toEqual('/item3-cell1')
    }
    {
      name : "List : Event, in item"
      data : data.listComplete
      template : "TEList"
      before : (div)->
        div.find('.title-class-first').trigger('click')
      test : (div)->
        expect(Session.get('eventTest')).toMatch("insideItem")
        Session.set('eventTest', undefined)
    }<commit_msg>Intentionally add a test failure to check travis ci<commit_after>
data =
  listComplete :
    id : "list-id"
    class : "list-class"
    action : ->
      Session.set('eventTest', "insideData")
    items : [
      {
        title :
          name : "First Item"
          class : "title-class-first"
        description:
          name : "First description"
          class : "description-class-first"
        id : "first-item-id"
        class : "first-item-class"
        action : ->
          Session.set('eventTest', "insideItem")
      },
      {
        class : "second-item-class"
        action : ->
          Session.set('eventTest', 'insideRow')
        cells : [
          {
            icons : [
              {
                id : "first-icon"
                class : "first-icon-class"
                icon : "first-icon"
                href : "first-icon-link"
                action : ->
                  Session.set('eventTest', "insideIcon")
              }
              {
                id : "second-icon"
                class : "second-icon-class"
                icon : "second-icon"
                href : "second-icon-link"
              }
            ]
          }
          {
            title : "Title One"
            description : "Description One"
            class : "first-cell-class"
            icons : [
              {
                icon : "first-icon"
              }
            ]
          }
          {
            title : "Title Two"
            description : "Description Two"
            class : "second-cell-class"
            action : ->
              Session.set('eventTest', 'insideCell')
          }
        ]
      }
      {
        id : 'third-item'
        cells : [
          {
            id : "item3-cell1"
            title : "first-cell"
            href : '/item3-cell1'
          }
          {
            icons : [
              {
                id : "item3-cell3-icon1"
                icon : "one-icon"
              }
            ]
          }
        ]
      }
      {
        class : "test-class test-class2"
        title : "Last Item"
        href : "/home"
        id : "last-item-id"
        icons : [
          {
            icon : "last-icon"
            class : "last-icon-class"
            id : "last-icon-id"
            href : "last-icon-href"
            action : ->
              Session.set('eventTest', 'insideLastIcon')
          }
        ]
      }
    ]


listTests =
  name : "Test list element"
  tests : [
    {
      name : "List : Helper"
      data : data.listComplete
      template : "TEList"
      test : (div)->
        # has list id
        expect(div.find("#list-id").length).toEqual(1)
        # has list class
        expect(div.find(".list-class").length).toEqual(1)

        # has first item class
        expect(div.find('.te-first-item').length).toEqual(1)
        # first item class is in the first item
        expect(div.find('[item="0"]').hasClass('te-first-item')).toBe(true)
        # has last item class
        expect(div.find('.te-last-item').length).toEqual(1)
        # last item class is in the last item
        expect(div.find('[item="3"]').hasClass('te-last-item')).toBe(true)
        # four items have title
        expect(div.find('.te-title').length).toEqual(5)
        # three items have description
        expect(div.find('.te-description').length).toEqual(3)

        # check single component item
          # id exists
        expect(div.find('#first-item-id').length).toEqual(1)
          # class exists
        expect(div.find('.first-item-class').length).toEqual(1)
        expect(div.find('.test-class').length).toEqual(1)
        expect(div.find('.test-class2').length).toEqual(1)
          # class in title object exists
        expect(div.find('.title-class-first').length).toEqual(1)
          # class in description object exists
        expect(div.find('.description-class-first').length).toEqual(1)
          # href exists
        expect(div.find('.test-class .te-content').attr('href')).toEqual('/home')
        expect(div.find('.test-class .last-icon-class').length).toEqual(1)
        expect(div.find('#last-icon-id').length).toEqual(1)
        expect(div.find('.test-class .last-icon-class').attr('href')).toEqual('last-icon-href')

          # last item first cell span 2
        expect(div.find('#last-item-id .te-first-cell').attr('colspan')).toEqual("2")
          # last item last cell has the same href
        expect(div.find('#last-item-id .te-last-cell > a').attr('href')).toEqual('/home')

        # check cells
          # icon in a cell is not displayed
        expect(div.find('.first-cell-class').find('.icon').length).toEqual(0)
          # three cells in a row
        expect(div.find('.second-item-class').find('td').length).toEqual(3)
          # id in icon exists
        expect(div.find('#first-icon').length).toEqual(1)
          # class in icon exists
        expect(div.find('.first-icon-class').length).toEqual(1)
          # three first cells
        expect(div.find('.te-first-cell').length).toEqual(4)
          #three last cells
        expect(div.find('.te-last-cell').length).toEqual(4)
          # icon href match
        expect(div.find('#second-icon').attr('href')).toEqual('second-icon-link')
          #icon exists
        expect(div.find('.fa-first-icon').length).toEqual(1)
          # check text
        expect(div.find('.first-cell-class .te-title').text()).toEqual('Title One')

          # third item first cell span 2
        expect(div.find('#item3-cell1').attr('colspan')).toEqual("2")
        expect(div.find('#item3-cell1 > a').attr('href')).toEqual('/item3-cell1')
          # third item last cell also has the same href as the first Item
        expect(div.find('#third-item .te-last-cell > a').attr('href')).toEqual('/item3-cell1-')
    }
    {
      name : "List : Event, in item"
      data : data.listComplete
      template : "TEList"
      before : (div)->
        div.find('.title-class-first').trigger('click')
      test : (div)->
        expect(Session.get('eventTest')).toMatch("insideItem")
        Session.set('eventTest', undefined)
    }
{'fraction_non_alphanumeric': 0.1525091799265606, 'fraction_numerical': 0.007180742554059568, 'mean_word_length': 1.5922165820642977, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '4985909', 'n_tokens_mistral': 3523, 'n_tokens_neox': 3547, 'n_words': 638}