Skip to content

Commit

Permalink
Merge pull request #15 from rwjblue/fix-normal-helper-usage
Browse files Browse the repository at this point in the history
Fix issues with normal helper usage.
  • Loading branch information
rwjblue authored Jun 6, 2018
2 parents 6b202c6 + 0d827d7 commit 067751a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tests/integration/components/angle-bracket-invocation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@ import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

import Service, { inject as injectService } from '@ember/service';
import { helper as buildHelper } from '@ember/component/helper';
import Component from '@ember/component';

module('Integration | Component | angle-bracket-invocation', function(hooks) {
setupRenderingTest(hooks);

module('static component support', function() {
test('does not affect helper usage', async function(assert) {
this.owner.register('helper:my-helper', buildHelper(() => 'my-helper'));

await render(hbs`{{my-helper}}`);

assert.dom().hasText('my-helper');
});

test('invoke without block', async function(assert) {
this.owner.register('template:components/foo-bar', hbs`hi martin!`);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ import { lte, gte } from 'ember-compatibility-helpers';
// call the original implementation
let definition = ORIGINAL_LOOKUP_COMPONENT_DEFINITION.apply(this, arguments);

if (!installedCustomDidCreateElement) {
if (!installedCustomDidCreateElement && definition) {
let { manager } = definition;

let ORIGINAL_DID_CREATE_ELEMENT = manager.didCreateElement;
Expand Down

0 comments on commit 067751a

Please sign in to comment.