How to use the @ckeditor/ckeditor5-engine/src/dev-utils/view.stringify function in @ckeditor/ckeditor5-engine

To help you get started, we’ve selected a few @ckeditor/ckeditor5-engine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ckeditor / ckeditor5-image / tests / imageupload / imageuploadediting.js View on Github external
editor.plugins.get( 'Clipboard' ).on( 'inputTransformation', ( evt, data ) => {
			const clipboardData = injectLoaderId( expectedClipboardData || '', adapterMocks );
			const modelData = injectLoaderId( expectedModel, adapterMocks );
			const finalModelData = injectLoaderId( expectedModelOnFile, adapterMocks );

			if ( clipboardData.length ) {
				expect( stringifyView( data.content ) ).to.equal( clipboardData );
			}
			expect( getModelData( model ) ).to.equal( modelData );

			if ( onSuccess !== false ) {
				adapterMocks[ 0 ].loader.file.then( () => {
					// Deffer so the promise could be resolved.
					setTimeout( () => {
						expectModel( doneFn, getModelData( model ), finalModelData );
					} );
				} );
			} else {
				adapterMocks[ 0 ].loader.file.then( () => {
					expect.fail( 'The `loader.file` should be rejected.' );
				} ).catch( () => {
					// Deffer so the promise could be resolved.
					setTimeout( () => {
github ckeditor / ckeditor5-markdown-gfm / tests / gfmdataprocessor / escaping.js View on Github external
it( `should escape ${ key }`, () => {
					const documentFragment = dataProcessor.toView( test );

					expect( stringify( documentFragment ) ).to.equal( `<p>${ result }</p>` );
				} );
github ckeditor / ckeditor5-markdown-gfm / tests / gfmdataprocessor / manual / gfmdataprocessor.js View on Github external
function convertToView() {
	const markdown = markdownTextArea.value;

	viewTextArea.value = stringify( dataProcessor.toView( markdown ) );
}