Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Added manual test for #142 ticket.
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarwrobel committed Sep 25, 2017
1 parent 5a776fd commit c9b6400
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/manual/tickets/142/1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<p><button class="start">Insert image after delay</button></p>

<div id="editor">
<p>foo <a href="foo">bar</a> biz</p>
</div>
47 changes: 47 additions & 0 deletions tests/manual/tickets/142/1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* global document, console, window, setTimeout */

import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import Enter from '@ckeditor/ckeditor5-enter/src/enter';
import Typing from '@ckeditor/ckeditor5-typing/src/typing';
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
import Link from '@ckeditor/ckeditor5-link/src/link';
import Image from '../../../../src/image';
import ImageCaption from '../../../../src/imagecaption';

import Element from '@ckeditor/ckeditor5-engine/src/model/element';
import Position from '@ckeditor/ckeditor5-engine/src/model/position';

ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ Enter, Typing, Paragraph, Link, Image, ImageCaption ],
toolbar: [],
} )
.then( editor => {
window.editor = editor;

const doc = editor.document;

document.querySelector( '.start' ).addEventListener( 'click', () => {
wait( 3000 ).then( () => {
doc.enqueueChanges( () => {
const image = new Element( 'image', { src: 'https://www.w3schools.com/w3images/fjords.jpg' } );

doc.batch( 'transparent' ).insert( new Position( doc.getRoot(), [ 0 ] ), image );
} );
} );
} );
} )
.catch( err => {
console.error( err.stack );
} );

function wait( delay ) {
return new Promise( resolve => {
setTimeout( () => resolve(), delay );
} );
}
4 changes: 4 additions & 0 deletions tests/manual/tickets/142/1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Re-render view document after image load [#142](https://github.com/ckeditor/ckeditor5-image/issues/142)

1. Click **Insert image after delay** then quickly select the link in the content (the link editing balloon should show up).
2. Observe if the balloon remains attached to the link.

0 comments on commit c9b6400

Please sign in to comment.