Skip to content

Commit c43f7fb

Browse files
author
Robert Jackson
committed
Add test fixtures for this.on transformation.
1 parent 44469f9 commit c43f7fb

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { moduleForComponent, test } from 'ember-qunit';
2+
import hbs from 'htmlbars-inline-precompile';
3+
4+
moduleForComponent('foo-bar', 'Integration | Component | FooBar', {
5+
integration: true
6+
});
7+
8+
test('it happens', function(assert) {
9+
assert.expect(1);
10+
11+
this.on('test', () => assert.ok(true));
12+
this.render(hbs`{{test-component test="test"}}`);
13+
});
14+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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 invokes a sendAction action', function(assert) {
15+
assert.expect(1);
16+
17+
this.actions.test = () => assert.ok(true);
18+
this.render(hbs`{{test-component test="test"}}`);
19+
});
20+
});
21+

0 commit comments

Comments
 (0)