/
destroy.js
40 lines (34 loc) · 1.03 KB
/
destroy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* bender-tags: editor,unit */
/* bender-ckeditor-plugins: toolbar,button,stylescombo */
bender.editor = true;
bender.test(
{
'test destroy editor with rich combo panel opened': function() {
var bot = this.editorBot, editor = this.editor;
bot.combo( 'Styles', function( combo ) {
var panelEl = combo._.panel.element;
editor.destroy();
assert.isFalse( CKEDITOR.document.getBody().contains( panelEl ) );
// #4552: Do that one more time.
bender.editorBot.create( {}, function( bot ) {
this.wait( function() {
bot.combo( 'Styles', function( combo ) {
var panelEl = combo._.panel.element;
bot.editor.destroy();
assert.isFalse( CKEDITOR.document.getBody().contains( panelEl ) );
} );
}, 0 );
} );
} );
},
// #13385.
'test getSnapshot returns empty string after editor destroyed': function() {
bender.editorBot.create( {}, function( bot ) {
this.wait( function() {
var editor = bot.editor;
editor.destroy();
assert.areSame( '', editor.getSnapshot() );
}, 0 );
} );
}
} );