File: cellproperties.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 (37 lines) | stat: -rw-r--r-- 806 bytes parent folder | download | duplicates (2)
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
/* exported doTest, assertChildren */

function doTest( name, dialogCallback ) {
	return function() {
		var bot = this.editorBot;

		bender.tools.testInputOut( name, function( source, expected ) {
			bot.setHtmlWithSelection( source );

			bot.dialog( 'cellProperties', function( dialog ) {
				try {
					if ( dialogCallback ) {
						dialogCallback( dialog );
					}

					dialog.getButton( 'ok' ).click();
				} catch ( e ) {
					throw e;
				} finally {
					dialog.hide();
				}

				assert.areSame( bender.tools.compatHtml( expected ), bot.getData( true ) );
			} );
		} );
	};
}

function assertChildren( children ) {
	CKEDITOR.tools.array.forEach( children, function( item ) {
		if ( item && item.children ) {
			assertChildren( item.children );
		} else {
			assert.isObject( item );
		}
	} );
}