File: blockless.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 (27 lines) | stat: -rw-r--r-- 828 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
/* bender-tags: editor */
/* bender-ckeditor-plugins: enterkey */
/* bender-ckeditor-remove-plugins: basicstyles */

bender.editor = {
	name: 'heading',
	creator: 'inline',
	allowedForTests: 'b'
};

bender.test( {
	// Executes ENTER on input, type some text and check output.
	enterKey: function( html ) {
		var bot = this.editorBot;
		bot.setHtmlWithSelection( html );
		bot.execCommand( 'enter' );
		return bot.getData( 1, true );
	},

	'test enter among inline text': function() {
		assert.areSame( 'foo<br />bar', this.enterKey( 'foo^bar' ) );
		assert.areSame( 'foo<br />&nbsp;', this.enterKey( 'foo^' ) );
		assert.areSame( '<br />foo', this.enterKey( '^foo' ) );
		assert.areSame( '<b>foo</b><br />bar', this.enterKey( '<b>foo^</b>bar' ) );
		assert.areSame( '<br /><b>foo</b>', this.enterKey( '<b>^foo</b>' ) );
	}
} );