import moduleForComponent from 'web-client/tests/helpers/module-for-component';
import { test } from 'ember-qunit';

moduleForComponent('infinite-scroll-slug', 'Unit | Component | infinite-scroll-slug', {
  unit: true
});

test('should emit loadMore action if not in loading state and in viewport', function(assert) {
  assert.expect(1);
  let slug = this.subject({
    loadMore: function() {
      assert.ok("loadMore called");
    },
    isLoading: false
  });

  slug.send('enteredViewport');

  slug.set('isLoading', true);
  slug.send('enteredViewport');
});
