File: initialize_hidden.js

package info (click to toggle)
ckeditor 4.16.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 258,804 kB
  • sloc: javascript: 239,590; sh: 184; makefile: 64; python: 37; php: 15; xml: 5
file content (43 lines) | stat: -rw-r--r-- 1,057 bytes parent folder | download | duplicates (4)
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
41
42
43
/* bender-tags: editor */
/* bender-ckeditor-plugins: wysiwygarea */

CKEDITOR.replaceClass = 'ckeditor';

bender.test( {
	'test auto initilization': function() {
		var editor = CKEDITOR.instances.editor1,
			expected = '<p>ed1</p>';

		// For Firefox 60.0.1+ this code is executed after 'instanceReady' event so listener won't be called.
		// For that case just assert it right away (#2019).
		if ( editor.status === 'ready' ) {
			this._assertEditor( expected, editor );
		} else {
			editor.once( 'instanceReady', function( evt ) {
				if ( evt.editor.name == editor.name ) {
					resume( function() {
						this._assertEditor( expected, editor );
					} );
				}
			} );

			wait();
		}
	},

	'test replace': function() {
		CKEDITOR.replace( 'editor2', { on: {
			instanceReady: function( evt ) {
				resume( function() {
					this._assertEditor( '<p>ed2</p>', evt.editor );
				} );
			}
		} } );

		wait();
	},

	_assertEditor: function( expectedData, editor ) {
		assert.areEqual( expectedData, bender.tools.compatHtml( editor.getData() ) );
	}
} );