File: checkbox.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 (38 lines) | stat: -rw-r--r-- 1,115 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
29
30
31
32
33
34
35
36
37
38
/* bender-tags: editor,unit */
/* bender-ckeditor-plugins: dialog,button,forms,htmlwriter,toolbar */

bender.editor = { config : { autoParagraph : false } };

bender.test(
{
	'test fill fields' : function() {
		var bot = this.editorBot;

		bot.dialog( 'checkbox', function( dialog ) {
				dialog.setValueOf( 'info', 'txtName', 'name' );
				dialog.setValueOf( 'info', 'txtValue', '' );
				dialog.setValueOf( 'info', 'cmbSelected', 'checked' );

				dialog.getButton( 'ok' ).click();

				assert.areSame( '<input checked="checked" name="name" type="checkbox" />',
								bot.getData( false, true ) );
			} );
	},

	'test empty fields': function() {
		var bot = this.editorBot;

		bot.setHtmlWithSelection( '[<input checked="checked" name="name" type="checkbox" value="value" />]' );

		bot.dialog( 'checkbox', function( dialog ) {
				dialog.setValueOf( 'info', 'txtName', '' );
				dialog.setValueOf( 'info', 'txtValue', '' );
				dialog.setValueOf( 'info', 'cmbSelected', '' );

				dialog.getButton( 'ok' ).click();

				assert.areSame( '<input type="checkbox" />', bot.getData( false, true ) );
			} );
	}
} );