|
| 1 | +import { module, test } from 'qunit'; |
| 2 | +import { setupRenderingTest } from 'ember-qunit'; |
| 3 | +import { render } from 'ember-test-helpers'; |
| 4 | +import hbs from 'htmlbars-inline-precompile'; |
| 5 | + |
| 6 | +module('Integration | Component | FooBar', function(hooks) { |
| 7 | + setupRenderingTest(hooks); |
| 8 | + |
| 9 | + hooks.beforeEach(function() { |
| 10 | + this.actions = {}; |
| 11 | + this.send = (actionName, ...args) => this.actions[actionName].apply(this, args); |
| 12 | + }); |
| 13 | + |
| 14 | + test('it happens', async function(assert) { |
| 15 | + assert.expect(1); |
| 16 | + |
| 17 | + this.actions.test = () => assert.ok(true); |
| 18 | + await render(hbs`{{test-component test="test"}}`); |
| 19 | + }); |
| 20 | + |
| 21 | + test('it happens non-dotable identifier e.g. [test-foo]', async function(assert) { |
| 22 | + assert.expect(1); |
| 23 | + |
| 24 | + this.actions['test-foo'] = () => assert.ok(true); |
| 25 | + await render(hbs`{{test-component test="test"}}`); |
| 26 | + }); |
| 27 | +}); |
| 28 | + |
| 29 | +module('Integration | Component | FooBar', function(hooks) { |
| 30 | + setupRenderingTest(hooks); |
| 31 | + |
| 32 | + hooks.beforeEach(function() { |
| 33 | + this.actions = {}; |
| 34 | + this.send = (actionName, ...args) => this.actions[actionName].apply(this, args); |
| 35 | + }); |
| 36 | + |
| 37 | + hooks.beforeEach(function(assert) { |
| 38 | + this.actions.test = () => assert.ok(true); |
| 39 | + }); |
| 40 | + |
| 41 | + test('it happens', async function(assert) { |
| 42 | + assert.expect(1); |
| 43 | + |
| 44 | + await render(hbs`{{test-component test="test"}}`); |
| 45 | + }); |
| 46 | +}); |
0 commit comments