diff --git a/addon/mixins/hook.js b/addon/mixins/hook.js index 4ba338e..63f88ef 100644 --- a/addon/mixins/hook.js +++ b/addon/mixins/hook.js @@ -17,8 +17,7 @@ const hookQualifierName = get(config, 'emberHook.hookQualifierName') || 'hookQua export default Mixin.create({ init() { this._super(...arguments); - - if (this.tagName || this.elementId) { + if (this.tagName !== '') { let newAttributeBindings = []; let bindings = get(this, 'attributeBindings'); diff --git a/tests/integration/components/tagless-test.js b/tests/integration/components/tagless-test.js new file mode 100644 index 0000000..01baaa1 --- /dev/null +++ b/tests/integration/components/tagless-test.js @@ -0,0 +1,23 @@ +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; +import Ember from 'ember'; +import {HookMixin} from 'ember-hook'; + +moduleForComponent('ember-hook', 'Integration | Component | tagless', { + integration: true +}); + +test('ember-hook does not tag less component', function(assert) { + + this.register('component:tag-less', Ember.Component.extend(HookMixin, { + tagName: '' + })); + + this.render(hbs` + {{#tag-less}} + template block text + {{/tag-less}} + `); + + assert.equal(this.$().text().trim(), 'template block text'); +});