File: state.js

package info (click to toggle)
ckeditor 4.5.7%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 30,020 kB
  • sloc: sh: 167; python: 37; makefile: 24; php: 15; xml: 5
file content (45 lines) | stat: -rw-r--r-- 1,005 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
38
39
40
41
42
43
44
45
/* bender-tags: editor,unit */
/* bender-ckeditor-plugins: richcombo,format,stylescombo,font,toolbar */

bender.test( {
	'test rich combos state when editor is readonly': function() {
		bender.editorBot.create( {
			name: 'readonly',
			config: {
				readOnly: true
			}
		}, function( bot ) {
			bot.setHtmlWithSelection( '<p>^foo</p>' );

			var editor = bot.editor,
				items = editor.ui.items,
				item,
				combos = [],
				combo,
				i;

			for ( i in items ) {
				item = items[ i ];
				if ( item.type == CKEDITOR.UI_RICHCOMBO )
					combos.push( editor.ui.get( i ) );
			}

			for ( i in combos ) {
				combo = combos[ i ];
				if ( !combo.readOnly )
					assert.areSame( CKEDITOR.TRISTATE_DISABLED, combo._.state );
			}
		} );
	},

	// #11793
	'test clicking while editor is blurred': function() {
		bender.editorBot.create( {
			name: 'blurred'
		}, function( bot ) {
			bot.combo( 'Styles', function( combo ) {
				assert.areSame( CKEDITOR.TRISTATE_ON, combo._.state );
			} );
		} );
	}
} );