2018-08-09 10:41:52 -07:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
|
|
import { render } from '@ember/test-helpers';
|
2017-12-11 13:13:34 -08:00
|
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
|
|
import { triggerEvent } from 'ember-native-dom-helpers';
|
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
module('Integration | Component | disable bubble input', function(hooks) {
|
|
|
|
setupRenderingTest(hooks);
|
2017-12-11 13:13:34 -08:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
test('it renders', async function(assert) {
|
|
|
|
await render(hbs`{{disable-bubble-input id='test-disable'}}`);
|
2017-12-11 13:13:34 -08:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
assert.equal(document.querySelector('#test-disable').tagName, 'INPUT');
|
|
|
|
});
|
2017-12-11 13:13:34 -08:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
test('it invokes the click action on click', async function(assert) {
|
|
|
|
const inputClickAction = () => {
|
|
|
|
assert.ok(true, 'disable input click action invoked');
|
|
|
|
};
|
|
|
|
this.set('inputClickAction', inputClickAction);
|
2017-12-11 13:13:34 -08:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
await render(hbs`{{disable-bubble-input click=inputClickAction}}`);
|
2017-12-11 13:13:34 -08:00
|
|
|
|
2018-08-09 10:41:52 -07:00
|
|
|
triggerEvent('input[type=text]', 'click');
|
|
|
|
});
|
2017-12-11 13:13:34 -08:00
|
|
|
});
|