import moduleForComponent from 'web-client/tests/helpers/module-for-component';
import { test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import Service from 'ember-service';

const impressionTrackingStub = Service.extend({
  registerComponent() {
  },
  deregisterComponent() {
  }
});

moduleForComponent('infinite-scroll-slug', 'Integration | Component | infinite-scroll-slug', {
  integration: true,
  beforeEach: function () {
    this.register('service:impression-tracking-service', impressionTrackingStub);

    this.inject.service('impression-tracking', { as: 'impressionTracking' });
  }
});

test('should compute styles properly', function(assert) {
  assert.expect(3);
  this.render(hbs`{{infinite-scroll-slug buffer=100}}`);
  assert.equal(this.$('div').css('height'), '100px', 'height is set properly');
  assert.equal(this.$('div').css('visibility'), 'hidden', 'visibility is set properly');
  assert.equal(this.$('div').css('margin-top'), '-100px', 'margin-top is set properly');
});

