Skip to content

Commit

Permalink
Add failing test for attributes not available in didRender
Browse files Browse the repository at this point in the history
  • Loading branch information
simonihmig committed Apr 22, 2019
1 parent b66f1cc commit c11e259
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/integration/components/angle-bracket-invocation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,5 +476,25 @@ module('Integration | Component | angle-bracket-invocation', function(hooks) {
assert.dom('span').hasAttribute('data-right', 'right-inner');
});
}

test('attributes are available in didRender', async function(assert) {
assert.expect(2);
this.owner.register(
'template:components/foo-bar',
hbs`<span data-test-inner ...attributes>hi martin!</span>`
);
this.owner.register(
'component:foo-bar',
Component.extend({
tagName: '',
didRender() {
assert.dom('span').hasAttribute('data-test-inner');
assert.dom('span').hasAttribute('data-test-outer');
},
})
);

await render(hbs`<FooBar data-test-outer />`);
});
});
});

0 comments on commit c11e259

Please sign in to comment.