Skip to content

Commit

Permalink
add test for changing editor content
Browse files Browse the repository at this point in the history
  • Loading branch information
rlivsey authored and bantic committed Dec 17, 2015
1 parent ba0eb55 commit 2e235df
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/integration/components/mobiledoc-editor/component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,27 @@ test('it boots mobiledoc editor with mobiledoc', function(assert) {
);
});

test('it updates the editor when the mobiledoc changes', function(assert) {
assert.expect(2);
let mobiledoc1 = simpleMobileDoc('Howdy');
let mobiledoc2 = simpleMobileDoc('Doody');

this.set('mobiledoc', mobiledoc1);
this.render(hbs`{{mobiledoc-editor mobiledoc=mobiledoc}}`);

assert.ok(
!!this.$('.mobiledoc-editor__editor:contains(Howdy)').length,
'Mobiledoc editor is booted with text'
);

this.set('mobiledoc', mobiledoc2);

assert.ok(
!!this.$('.mobiledoc-editor__editor:contains(Doody)').length,
'Mobiledoc editor is updated'
);
});

test('it renders a yielded toolbar', function(assert) {
assert.expect(1);
this.render(hbs`
Expand Down

0 comments on commit 2e235df

Please sign in to comment.