@@ -76,6 +76,7 @@ describe('markdown-toolbar-element', function() {
7676 <md-quote>quote</md-quote>
7777 <md-code>code</md-code>
7878 <md-link>link</md-link>
79+ <md-image>image</md-image>
7980 <md-unordered-list>unordered-list</md-unordered-list>
8081 <md-ordered-list>ordered-list</md-ordered-list>
8182 <md-task-list>task-list</md-task-list>
@@ -492,6 +493,32 @@ describe('markdown-toolbar-element', function() {
492493 } )
493494 } )
494495
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+
495522 describe ( 'header' , function ( ) {
496523 it ( 'inserts header syntax with cursor in description' , function ( ) {
497524 setVisualValue ( '|title|' )
0 commit comments