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