Make WordPress Core

Changeset 37080


Ignore:
Timestamp:
03/25/2016 01:30:10 PM (11 years ago)
Author:
iseulde
Message:

Editor: wptextpattern: add back inline tests

See [37024].
See #33300.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/qunit/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js

    r37024 r37080  
    1616                                'r': 82, 's': 83, 't': 84, 'u': 85,     'v': 86, 'w': 87, 'x': 88, 'y': 89, ' ': 32, ',': 188, '-': 189, '.': 190, '/': 191, '\\': 220,
    1717                                '[': 219, ']': 221, '\'': 222, ';': 186, '=': 187, ')': 41,
    18                                 '*': 48 // Anything will do.
     18                                '`': 48 // Anything will do.
    1919                        };
    2020
    … …  
    285285                }, assert.async() );
    286286        } );
     287
     288        QUnit.test( 'Inline: single.', function( assert ) {
     289                type( '`test`', function() {
     290                        assert.equal( editor.getContent(), '<p><code>test</code></p>' );
     291                        assert.equal( editor.selection.getRng().startOffset, 1 );
     292                }, assert.async() );
     293        } );
     294
     295        QUnit.test( 'Inline: after typing.', function( assert ) {
     296                editor.setContent( '<p>test test test</p>' );
     297                editor.selection.setCursorLocation( editor.$( 'p' )[0].firstChild, 5 );
     298
     299                type( '`', function() {
     300                        editor.selection.setCursorLocation( editor.$( 'p' )[0].firstChild, 11 );
     301                }, '`', function() {
     302                        assert.equal( editor.getContent(), '<p>test <code>test</code> test</p>' );
     303                        assert.equal( editor.selection.getRng().startOffset, 1 );
     304                }, assert.async() );
     305        } );
     306
     307        QUnit.test( 'Inline: no change.', function( assert ) {
     308                type( 'test `````', function() {
     309                        assert.equal( editor.getContent(), '<p>test `````</p>' );
     310                }, assert.async() );
     311        } );
    287312} )( window.jQuery, window.QUnit, window.tinymce, window.setTimeout );
Note: See TracChangeset for help on using the changeset viewer.