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

moduleForComponent('bits/emotes-intro', 'Integration | Component | bits/emotes intro');

test('it renders', function (assert) {
  assert.expect(4);

  this.on('howDoICheer', function () {
    assert.ok(true, 'howDoICheer action triggered');
  });

  this.render(hbs`
    {{bits/emotes-intro
        howDoICheer=(action 'howDoICheer')}}
    `);

  return wait().then(() => {
    assert.elementCount(this.$('header'), 1, 'header element');
    assert.elementCount(this.$('p'), 1, 'subtext');
    assert.elementCount(this.$('p a'), 1, 'how do i cheer link');

    // last assert
    this.$('p a').click();
  });
});
