@@ -74,6 +74,7 @@ describe('markdown-toolbbar-element', function() {
74
74
<md-quote>quote</md-quote>
75
75
<md-code>code</md-code>
76
76
<md-link>link</md-link>
77
+ <md-image>image</md-image>
77
78
<md-unordered-list>unordered-list</md-unordered-list>
78
79
<md-ordered-list>ordered-list</md-ordered-list>
79
80
<md-task-list>task-list</md-task-list>
@@ -489,5 +490,31 @@ describe('markdown-toolbbar-element', function() {
489
490
assert . equal ( "GitHub's [homepage](|url|)" , visualValue ( ) )
490
491
} )
491
492
} )
493
+
494
+ describe ( 'images' , function ( ) {
495
+ it ( 'inserts image syntax with cursor in description' , function ( ) {
496
+ setVisualValue ( '|' )
497
+ clickToolbar ( 'md-image' )
498
+ assert . equal ( '' , visualValue ( ) )
499
+ } )
500
+
501
+ it ( 'selected url is wrapped in image syntax with cursor in description' , function ( ) {
502
+ setVisualValue ( 'Octocat is |https://octodex.github.com/images/original.png|' )
503
+ clickToolbar ( 'md-image' )
504
+ assert . equal ( 'Octocat is ' , visualValue ( ) )
505
+ } )
506
+
507
+ it ( 'cursor on url is wrapped in image syntax with cursor in description' , function ( ) {
508
+ setVisualValue ( 'Octocat is https://octodex.git|hub.com/images/original.png' )
509
+ clickToolbar ( 'md-image' )
510
+ assert . equal ( 'Octocat is ' , visualValue ( ) )
511
+ } )
512
+
513
+ it ( 'selected plan text is wrapped in image syntax with cursor in url' , function ( ) {
514
+ setVisualValue ( "GitHub's |logo|" )
515
+ clickToolbar ( 'md-image' )
516
+ assert . equal ( "GitHub's " , visualValue ( ) )
517
+ } )
518
+ } )
492
519
} )
493
520
} )
0 commit comments