Skip to content

Commit

Permalink
Tests: add TC.
Browse files Browse the repository at this point in the history
  • Loading branch information
engineering-this committed Jun 5, 2019
1 parent 47c6d3b commit 308a6fe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/core/creators/inline-textarea.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<textarea id="editor1">&lt;p&gt;foo&lt;/p&gt;</textarea>
<textarea id="editor2">&lt;p&gt;bar&lt;/p&gt;</textarea>
<textarea id="editor3">&lt;p&gt;bom&lt;/p&gt;</textarea>
</form>
<textarea id="editor4"></textarea>
</form>
21 changes: 21 additions & 0 deletions tests/core/creators/inline-textarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,27 @@
assert.isNull( editor.container.getCustomData( 'x' ), 'Custom data purged' );
} );
} );
},

'test destroy when editor.container is absent': function() {
bender.editorBot.create( {
creator: 'inline',
name: 'editor4'
}, function( bot ) {
var editor = bot.editor,
container = editor.container;

delete editor.container;
container.clearCustomData();
container.remove();

try {
editor.destroy();
assert.pass( 'Passed without errors' );
} catch ( err ) {
assert.fail( err.toString() );
}
} );
}
} );

Expand Down

0 comments on commit 308a6fe

Please sign in to comment.