File: plugin.js

package info (click to toggle)
ckeditor 4.4.4%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 25,632 kB
  • ctags: 2,419
  • sloc: sh: 190; python: 37; makefile: 29; php: 15; xml: 5
file content (28 lines) | stat: -rw-r--r-- 1,120 bytes parent folder | download
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
/* bender-tags: editor,unit */
/* bender-ckeditor-plugins: format,toolbar */

bender.editor = true;
bender.test(
{
   'test apply format style' : function() {
	   var bot = this.editorBot, ed = this.editor;
	   bot.setHtmlWithSelection( '<p>^foo</p>' );
	   var name = 'Format', combo = ed.ui.get( name );
	   assert.areSame( CKEDITOR.TRISTATE_OFF, combo._.state, 'check state OFF' );
	   bot.combo( name, function( combo ) {
			  assert.areSame( CKEDITOR.TRISTATE_ON, combo._.state, 'check state ON when opened' );
			  combo.onClick( 'h1' );
			  assert.areSame( '<h1>^foo</h1>', bot.htmlWithSelection(), 'applied h1 block style' );
		  } );
   },
   'test format style not in context': function() {
	   // TODO: IE throws selection inside of form legend.
	   if ( CKEDITOR.env.ie )
	   	assert.ignore();

	   var bot = this.editorBot, ed = this.editor;
	   bot.setHtmlWithSelection( '<fieldset><legend>^foo</legend><form>bar</form></fieldset>' );
	   var name = 'Format', combo = ed.ui.get( name );
	   assert.areSame( CKEDITOR.TRISTATE_DISABLED, combo._.state, 'check state disabled when not in context' );
   }
} );