File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -478,6 +478,24 @@ describe( "Autolinker", function() {
478
478
} ) ;
479
479
480
480
481
+ it ( "should automatically link twitter handles surrounded by parentheses" , function ( ) {
482
+ var result = Autolinker . link ( "Joe's twitter is (@joe_the_man12)" ) ;
483
+ expect ( result ) . toBe ( 'Joe\'s twitter is (<a href="https://twitter.com/joe_the_man12" target="_blank">@joe_the_man12</a>)' ) ;
484
+ } ) ;
485
+
486
+
487
+ it ( "should automatically link twitter handles surrounded by braces" , function ( ) {
488
+ var result = Autolinker . link ( "Joe's twitter is {@joe_the_man12}" ) ;
489
+ expect ( result ) . toBe ( 'Joe\'s twitter is {<a href="https://twitter.com/joe_the_man12" target="_blank">@joe_the_man12</a>}' ) ;
490
+ } ) ;
491
+
492
+
493
+ it ( "should automatically link twitter handles surrounded by brackets" , function ( ) {
494
+ var result = Autolinker . link ( "Joe's twitter is [@joe_the_man12]" ) ;
495
+ expect ( result ) . toBe ( 'Joe\'s twitter is [<a href="https://twitter.com/joe_the_man12" target="_blank">@joe_the_man12</a>]' ) ;
496
+ } ) ;
497
+
498
+
481
499
it ( "should automatically link multiple twitter handles in a string" , function ( ) {
482
500
var result = Autolinker . link ( "@greg is tweeting @joe with @josh" ) ;
483
501
expect ( result ) . toBe ( '<a href="https://twitter.com/greg" target="_blank">@greg</a> is tweeting <a href="https://twitter.com/joe" target="_blank">@joe</a> with <a href="https://twitter.com/josh" target="_blank">@josh</a>' ) ;
You can’t perform that action at this time.
0 commit comments