Ghost/ghost/admin/tests/integration/components/gh-search-input-test.js
Kevin Ansfield 8c8365720b Revert to ember-wormhole@0.3.6 (#108)
closes https://github.com/TryGhost/Ghost/issues/7073
- reverts `ember-wormhole` to 0.3.6
- adds working test that was broken under `ember-wormhole` 0.4.0
2016-07-05 08:29:05 -06:00

40 lines
1.0 KiB
JavaScript

/* jshint expr:true */
import { expect } from 'chai';
import {
describeComponent,
it
} from 'ember-mocha';
import hbs from 'htmlbars-inline-precompile';
import run from 'ember-runloop';
import wait from 'ember-test-helpers/wait';
describeComponent(
'gh-search-input',
'Integration: Component: gh-search-input',
{
integration: true
},
function () {
it('renders', function () {
// renders the component on the page
this.render(hbs`{{gh-search-input}}`);
expect(this.$('.ember-power-select-search input')).to.have.length(1);
});
it('opens the dropdown on text entry', function (done) {
this.render(hbs`{{gh-search-input}}`);
// enter text to trigger search
run(() => {
this.$('input[type="search"]').val('test').trigger('input');
});
wait().then(() => {
expect(this.$('.ember-basic-dropdown-content').length).to.equal(1);
done();
});
});
}
);