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 393177c commit d36cdbe7eecb678d487918a1856643735f90e4d9
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 d36cdbe

Please sign in to comment.