- Timestamp:
- 11/01/2016 08:05:48 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/qunit/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js
r37668 r39075 156 156 skin: false, 157 157 plugins: 'wptextpattern', 158 wptextpattern: { 159 inline: [ 160 { start: '`', end: '`', format: 'code' }, 161 { start: '``', end: '``', format: 'bold' } 162 ] 163 }, 158 164 init_instance_callback: function() { 159 165 editor = arguments[0]; … … 300 306 } ); 301 307 302 QUnit.test( 'Inline: single .', function( assert ) {308 QUnit.test( 'Inline: single character.', function( assert ) { 303 309 type( '`test`', function() { 304 310 assert.equal( editor.getContent(), '<p><code>test</code></p>' ); … … 307 313 } ); 308 314 315 QUnit.test( 'Inline: two characters.', function( assert ) { 316 type( '``test``', function() { 317 assert.equal( editor.getContent(), '<p><strong>test</strong></p>' ); 318 assert.equal( editor.selection.getRng().startOffset, 1 ); 319 }, assert.async() ); 320 } ); 321 309 322 QUnit.test( 'Inline: after typing.', function( assert ) { 310 323 editor.setContent( '<p>test test test</p>' ); … … 312 325 313 326 type( '`', function() { 314 editor.selection.setCursorLocation( editor.$( 'p' )[0].firstChild, 1 1);327 editor.selection.setCursorLocation( editor.$( 'p' )[0].firstChild, 10 ); 315 328 }, '`', function() { 316 329 assert.equal( editor.getContent(), '<p>test <code>test</code> test</p>' ); … … 324 337 }, assert.async() ); 325 338 } ); 339 340 QUnit.test( 'Convert with previously unconverted pattern', function( assert ) { 341 editor.setContent( '<p>`test` test </p>' ); 342 editor.selection.setCursorLocation( editor.$( 'p' )[0].firstChild, 12 ); 343 344 type( '`test`', function() { 345 assert.equal( editor.getContent(), '<p>`test` test <code>test</code></p>' ); 346 }, assert.async() ); 347 } ); 326 348 } )( window.jQuery, window.QUnit, window.tinymce, window.setTimeout );
Note: See TracChangeset
for help on using the changeset viewer.