diff --git a/packages/ember-glimmer/tests/integration/helpers/custom-helper-test.js b/packages/ember-glimmer/tests/integration/helpers/custom-helper-test.js index af8b531df31..d35d953b045 100644 --- a/packages/ember-glimmer/tests/integration/helpers/custom-helper-test.js +++ b/packages/ember-glimmer/tests/integration/helpers/custom-helper-test.js @@ -6,24 +6,39 @@ let assert = QUnit.assert; moduleFor('Helpers test: custom helpers', class extends RenderingTest { - ['@test it can resolve custom simple helpers']() { + ['@test it can resolve custom simple helpers with or without dashes']() { + this.registerHelper('hello', () => 'hello'); this.registerHelper('hello-world', () => 'hello world'); - this.render('{{hello-world}}'); + this.render('{{hello}} | {{hello-world}}'); + + this.assertText('hello | hello world'); + + this.runTask(() => this.rerender()); - this.assertText('hello world'); + this.assertText('hello | hello world'); } - ['@test it can resolve custom class-based helpers']() { + ['@test it can resolve custom class-based helpers with or without dashes']() { + this.registerHelper('hello', { + compute() { + return 'hello'; + } + }); + this.registerHelper('hello-world', { compute() { return 'hello world'; } }); - this.render('{{hello-world}}'); + this.render('{{hello}} | {{hello-world}}'); + + this.assertText('hello | hello world'); + + this.runTask(() => this.rerender()); - this.assertText('hello world'); + this.assertText('hello | hello world'); } ['@htmlbars class-based helper can recompute a new value']() { diff --git a/packages/ember-htmlbars/tests/integration/helper-lookup-test.js b/packages/ember-htmlbars/tests/integration/helper-lookup-test.js deleted file mode 100644 index e9f3e00ec37..00000000000 --- a/packages/ember-htmlbars/tests/integration/helper-lookup-test.js +++ /dev/null @@ -1,43 +0,0 @@ -import compile from 'ember-template-compiler/system/compile'; -import ComponentLookup from 'ember-views/component_lookup'; -import Component from 'ember-views/components/component'; -import { helper } from 'ember-htmlbars/helper'; -import { runAppend, runDestroy } from 'ember-runtime/tests/utils'; -import buildOwner from 'container/tests/test-helpers/build-owner'; -import { OWNER } from 'container/owner'; - -var owner, component; - -QUnit.module('component - invocation', { - setup() { - owner = buildOwner(); - owner.registerOptionsForType('component', { singleton: false }); - owner.registerOptionsForType('view', { singleton: false }); - owner.registerOptionsForType('template', { instantiate: false }); - owner.registerOptionsForType('helper', { instantiate: false }); - owner.register('component-lookup:main', ComponentLookup); - }, - - teardown() { - runDestroy(owner); - runDestroy(component); - owner = component = null; - } -}); - -QUnit.test('non-dashed helpers are found', function() { - expect(1); - - owner.register('helper:fullname', helper(function( [first, last]) { - return `${first} ${last}`; - })); - - component = Component.extend({ - [OWNER]: owner, - layout: compile('{{fullname "Robert" "Jackson"}}') - }).create(); - - runAppend(component); - - equal(component.$().text(), 'Robert Jackson'); -});