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
|
/* bender-tags: editor,unit */
/* bender-ckeditor-plugins: dialog,button,forms,htmlwriter,toolbar */
bender.editor = { config : { autoParagraph : false } };
bender.test(
{
'test fill fields' : function() {
var bot = this.editorBot;
bot.dialog( 'checkbox', function( dialog ) {
dialog.setValueOf( 'info', 'txtName', 'name' );
dialog.setValueOf( 'info', 'txtValue', '' );
dialog.setValueOf( 'info', 'cmbSelected', 'checked' );
dialog.getButton( 'ok' ).click();
assert.areSame( '<input checked="checked" name="name" type="checkbox" />',
bot.getData( false, true ) );
} );
},
'test empty fields': function() {
var bot = this.editorBot;
bot.setHtmlWithSelection( '[<input checked="checked" name="name" type="checkbox" value="value" />]' );
bot.dialog( 'checkbox', function( dialog ) {
dialog.setValueOf( 'info', 'txtName', '' );
dialog.setValueOf( 'info', 'txtValue', '' );
dialog.setValueOf( 'info', 'cmbSelected', '' );
dialog.getButton( 'ok' ).click();
assert.areSame( '<input type="checkbox" />', bot.getData( false, true ) );
} );
}
} );
|