module( 'plugins.autolink.autolink' );

test( '输入超链接后回车', function() {
    var editor = te.obj[0];
    var range = te.obj[1];
    var body = editor.body;
    setTimeout( function() {
        editor.setContent( '<p>http://www.baidu.com</p>' );
        editor.focus();
        range.setStart( body.firstChild, 1 ).collapse( 1 ).select();
//        var title = $( 'title' )[0].innerHTML;
//        var plugin = document.getElementById( 'plugin' );
//        var browser = ua.getBrowser();
               setTimeout( function() {
            te.presskey( "enter", "v" );
            editor.focus();
            setTimeout( function() {
                var a = body.firstChild.getElementsByTagName('a')[0];
                equal(ua.getChildHTML(a),'http://www.baidu.com','检查a的内容');
                ok($(a).attr('href').indexOf('http://www.baidu.com')!=-1,'检查a的href');
                start();
            }, 60 );
        },60 );
    } );
    stop();
} );

