/**
 * Integration test for the frost-list-content-container component
 */

import {expect} from 'chai'
import Ember from 'ember'
const {A} = Ember
import {$hook, initialize as initializeHook} from 'ember-hook'
import {registerMockComponent, unregisterMockComponent} from 'ember-test-utils/test-support/mock-component'
import {integration} from 'ember-test-utils/test-support/setup-component-test'
import hbs from 'htmlbars-inline-precompile'
import {afterEach, beforeEach, describe, it} from 'mocha'

const test = integration('frost-list-content-container')
describe(test.label, function () {
  test.setup()

  beforeEach(function () {
    initializeHook()
    const list = A([
      Ember.Object.create({uuid: '0'})
    ])

    this.setProperties({
      alwaysUseDefaultHeight: false,
      bufferSize: 10,
      defaultHeight: 50,
      hook: 'myListContentContainer',
      items: list,
      scrollTop: 0
    })
  })

  describe('without the pagination property set', function () {
    beforeEach(function () {
      this.render(hbs`
        {{frost-list-content-container
          alwaysUseDefaultHeight=alwaysUseDefaultHeight
          bufferSize=bufferSize
          defaultHeight=defaultHeight
          hook=hook
          items=items
          scrollTop=scrollTop
        }}
      `)
    })

    it('should have one vertical item created', function () {
      expect(this.$('.vertical-item')).to.have.length(1)
    })
  })

  describe('when the pagination property is set', function () {
    beforeEach(function () {
      registerMockComponent(this, 'mock-pagination')

      this.render(hbs`
        {{frost-list-content-container
          alwaysUseDefaultHeight=alwaysUseDefaultHeight
          bufferSize=bufferSize
          defaultHeight=defaultHeight
          hook=hook
          items=items
          pagination=(component 'mock-pagination' class='mock-pagination')
          scrollTop=scrollTop
        }}
      `)
    })

    afterEach(function () {
      unregisterMockComponent(this, 'mock-pagination')
    })

    it('should set the "paged" class', function () {
      expect($hook('myListContentContainer')).to.have.class('paged')
    })

    it('should have a scroll bar', function () {
      expect($hook('myListContentContainer-scroll')).to.have.length(1)
    })
  })
})

@@ -2292,12 +2292,374 @@
  %7D)%0A  %7D)
+%0A%0A  describe('when isLoading property is set', function () %7B%0A    beforeEach(function () %7B%0A      this.render(hbs%60%0A        %7B%7Bfrost-list-content-container%0A          hook=hook%0A          isLoading=true%0A        %7D%7D%0A      %60)%0A    %7D)%0A%0A    it('should show loading indicator', function () %7B%0A      expect($hook('myListContentContainer-loading')).to.have.length(1)%0A    %7D)%0A  %7D)
 %0A%7D)%0A

Add test