<commit_before>import {
  injectHTML,
  $$,
  $,
  getNextSibling,
  getPreviousSibling,
  normalizeHTML,
  fireEvent
} from '../../helpers/index'

// include special tags to test specific features
import '../../tag/loop-svg-nodes.tag'
import '../../tag/loop-position.tag'
import '../../tag/table-data.tag'
import '../../tag/loop-option.tag'
import '../../tag/loop-optgroup.tag'
import '../../tag/loop-optgroup2.tag'
import '../../tag/loop-arraylike.tag'
import '../../tag/loop-ids.tag'
import '../../tag/loop-unshift.tag'
import '../../tag/loop-virtual.tag'
import '../../tag/loop-null-items.tag'
import '../../tag/loop-named.tag'
import '../../tag/loop-single-tags.tag'
import '../../tag/loop.tag'
import '../../tag/loop-cols.tag'
import '../../tag/loop-child.tag'
import '../../tag/loop-combo.tag'
import '../../tag/loop-reorder.tag'
import '../../tag/loop-swap-type.tag'
import '../../tag/loop-manip.tag'
import '../../tag/loop-object.tag'
import '../../tag/loop-tag-instances.tag'
import '../../tag/loop-numbers-nested.tag'
import '../../tag/loop-nested-strings-array.tag'
import '../../tag/loop-events.tag'
import '../../tag/loop-sync-options-nested.tag'
import '../../tag/loop-inherit.tag'
import '../../tag/loop-root.tag'
import '../../tag/loop-double-curly-brackets.tag'
import '../../tag/loop-conditional.tag'
import '../../tag/loop-protect-internal-attrs.tag'
import '../../tag/loop-noloop-option.tag'
import '../../tag/ploop-tag.tag'
import '../../tag/table-loop-extra-row.tag'
import '../../tag/obj-key-loop.tag'
import '../../tag/loop-sync-options.tag'
import '../../tag/outer.tag'
import '../../tag/reserved-names.tag'
import '../../tag/nested-parallel-loop.tag'
import '../../tag/loop-bug-1649.tag'

import '../../tag/select-test.tag'
import '../../tag/named-select.tag'

import '../../tag/table-thead-tfoot.tag'
import '../../tag/table-multibody.tag'
import '../../tag/table-thead-tfoot-nested.tag'
import '../../tag/table-test.tag'

import '../../tag/virtual-no-loop.tag'
import '../../tag/virtual-yield-loop.tag'

const expect = chai.expect

describe('Riot each', function() {
  it('the loop elements keep their position in the DOM', function() {
    injectHTML('<loop-position></loop-position>')
    var tag = riot.mount('loop-position')[0],
      h3 = $('h3', tag.root)

    expect(getPreviousSibling(h3).tagName.toLowerCase()).to.be.equal('p')
    expect(getNextSibling(h3).tagName.toLowerCase()).to.be.equal('p')

    tag.unmount()

  })

  it('SVGs nodes can be properly looped', function() {

    injectHTML('<loop-svg-nodes></loop-svg-nodes>')<commit_msg>fixed: wrong import<commit_after>import {
  injectHTML,
  $$,
  $,
  getNextSibling,
  getPreviousSibling,
  normalizeHTML,
  fireEvent
} from '../../helpers/index'

// include special tags to test specific features
import '../../tag/loop-svg-nodes.tag'
import '../../tag/loop-position.tag'
import '../../tag/table-data.tag'
import '../../tag/loop-option.tag'
import '../../tag/loop-optgroup.tag'
import '../../tag/loop-optgroup2.tag'
import '../../tag/loop-arraylike.tag'
import '../../tag/loop-ids.tag'
import '../../tag/loop-unshift.tag'
import '../../tag/loop-virtual.tag'
import '../../tag/loop-null-items.tag'
import '../../tag/loop-named.tag'
import '../../tag/loop-single-tags.tag'
import '../../tag/loop.tag'
import '../../tag/loop-cols.tag'
import '../../tag/loop-child.tag'
import '../../tag/loop-combo.tag'
import '../../tag/loop-reorder.tag'
import '../../tag/loop-swap-type.tag'
import '../../tag/loop-manip.tag'
import '../../tag/loop-object.tag'
import '../../tag/loop-tag-instances.tag'
import '../../tag/loop-numbers-nested.tag'
import '../../tag/loop-nested-strings-array.tag'
import '../../tag/loop-events.tag'
import '../../tag/loop-sync-options-nested.tag'
import '../../tag/loop-inherit.tag'
import '../../tag/loop-root.tag'
import '../../tag/loop-double-curly-brackets.tag'
import '../../tag/loop-conditional.tag'
import '../../tag/loop-protect-internal-attrs.tag'
import '../../tag/loop-noloop-option.tag'
import '../../tag/ploop-tag.tag'
import '../../tag/table-loop-extra-row.tag'
import '../../tag/obj-key-loop.tag'
import '../../tag/loop-sync-options.tag'
import '../../tag/outer.tag'
import '../../tag/reserved-names.tag'
import '../../tag/loop-bug-1649.tag'

import '../../tag/select-test.tag'
import '../../tag/named-select.tag'

import '../../tag/table-thead-tfoot.tag'
import '../../tag/table-multibody.tag'
import '../../tag/table-thead-tfoot-nested.tag'
import '../../tag/table-test.tag'

import '../../tag/virtual-no-loop.tag'
import '../../tag/virtual-yield-loop.tag'

const expect = chai.expect

describe('Riot each', function() {
  it('the loop elements keep their position in the DOM', function() {
    injectHTML('<loop-position></loop-position>')
    var tag = riot.mount('loop-position')[0],
      h3 = $('h3', tag.root)

    expect(getPreviousSibling(h3).tagName.toLowerCase()).to.be.equal('p')
    expect(getNextSibling(h3).tagName.toLowerCase()).to.be.equal('p')

    tag.unmount()

  })

  it('SVGs nodes can be properly looped', function() {

    injectHTML('<loop-svg-nodes></loop-svg-nodes>')
{'fraction_non_alphanumeric': 0.2620999219359875, 'fraction_numerical': 0.0039032006245121, 'mean_word_length': 2.658101356174161, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1859872', 'n_tokens_mistral': 1701, 'n_tokens_neox': 1777, 'n_words': 289}