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
|
/* bender-tags: editor,unit */
/* bender-ckeditor-plugins: preview */
bender.editor = {
startupData: '<p>Foo</p>'
};
bender.test( {
'test processing of data on contentPreview': function() {
var tc = this,
editor = tc.editor;
editor.once( 'contentPreview', function( event ) {
event.data.dataValue = event.data.dataValue.replace( 'Foo', 'Bar' );
}, null, null, 1 );
editor.once( 'contentPreview', function( event ) {
tc.resume( function() {
assert.isArray( event.data.dataValue.match( '<p>Bar</p>' ), 'Content has been altered.' );
} );
event.cancel(); // Don't open preview window.
}, null, null, 2 );
editor.execCommand( 'preview' );
tc.wait();
}
} );
|