Permalink
Browse files

Add detail component scaffold

`ember g component post-detail`

Again, instead of making the acceptance test pass as quickly as possible, we
 "write the code we wish we had": a post display component.
  • Loading branch information...
CodingItWrong committed Jan 11, 2018
1 parent 89b2f3b commit 1b635b94d9b85e5169bdcd3bdd85b26adc58026d
@@ -0,0 +1,4 @@
import Component from '@ember/component';
export default Component.extend({
});
@@ -0,0 +1 @@
{{yield}}
@@ -1 +1,3 @@
{{outlet}}
<h1>Post</h1>
<PostDetail @post={{model}} />
@@ -0,0 +1,26 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | post-detail', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`{{post-detail}}`);
assert.equal(this.element.textContent.trim(), '');
// Template block usage:
await render(hbs`
{{#post-detail}}
template block text
{{/post-detail}}
`);
assert.equal(this.element.textContent.trim(), 'template block text');
});
});

0 comments on commit 1b635b9

Please sign in to comment.