Permalink
Browse files

Specify form component should render the form

We create a component test that reproduces the acceptance test error.

We also go ahead and specify the body field as well, even though that's not strictly necessary to reproduce the current acceptance error. We're pretty sure it'll error out on that field missing too, so this is a case where it's safe to go ahead and specify it at the unit level.

Inner red:
✘ Element .js-post-form-title exists
✘ Element .js-post-form-body exists
  • Loading branch information...
CodingItWrong committed Jan 10, 2018
1 parent 9e57b06 commit 2abc6e4b55d53285ad1d43cc6b8fbdcbfb81d524
Showing with 3 additions and 14 deletions.
  1. +3 −14 tests/integration/components/post-form-test.js
@@ -6,21 +6,10 @@ import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | post-form', 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) { ... });

test('it renders the form', async function(assert) {
await render(hbs`{{post-form}}`);

assert.equal(this.element.textContent.trim(), '');

// Template block usage:
await render(hbs`
{{#post-form}}
template block text
{{/post-form}}
`);

assert.equal(this.element.textContent.trim(), 'template block text');
assert.dom('.js-post-form-title').exists();
assert.dom('.js-post-form-body').exists();
});
});

0 comments on commit 2abc6e4

Please sign in to comment.