@@ -404,6 +404,29 @@ suite('Navigation', function () {
404404 this . blocks . hiddenInput . inputList [ 2 ] . fieldRow [ 0 ] ,
405405 ) ;
406406 } ) ;
407+ test ( 'from icon to icon' , function ( ) {
408+ this . blocks . statementInput1 . setCommentText ( 'test' ) ;
409+ this . blocks . statementInput1 . setWarningText ( 'test' ) ;
410+ const icons = this . blocks . statementInput1 . getIcons ( ) ;
411+ const nextNode = this . navigator . getNextSibling ( icons [ 0 ] ) ;
412+ assert . equal ( nextNode , icons [ 1 ] ) ;
413+ } ) ;
414+ test ( 'from icon to field' , function ( ) {
415+ this . blocks . statementInput1 . setCommentText ( 'test' ) ;
416+ this . blocks . statementInput1 . setWarningText ( 'test' ) ;
417+ const icons = this . blocks . statementInput1 . getIcons ( ) ;
418+ const nextNode = this . navigator . getNextSibling ( icons [ 1 ] ) ;
419+ assert . equal (
420+ nextNode ,
421+ this . blocks . statementInput1 . inputList [ 0 ] . fieldRow [ 0 ] ,
422+ ) ;
423+ } ) ;
424+ test ( 'from icon to null' , function ( ) {
425+ this . blocks . dummyInput . setCommentText ( 'test' ) ;
426+ const icons = this . blocks . dummyInput . getIcons ( ) ;
427+ const nextNode = this . navigator . getNextSibling ( icons [ 0 ] ) ;
428+ assert . isNull ( nextNode ) ;
429+ } ) ;
407430 } ) ;
408431
409432 suite ( 'Previous' , function ( ) {
@@ -496,6 +519,28 @@ suite('Navigation', function () {
496519 this . blocks . hiddenInput . inputList [ 0 ] . fieldRow [ 0 ] ,
497520 ) ;
498521 } ) ;
522+ test ( 'from icon to icon' , function ( ) {
523+ this . blocks . statementInput1 . setCommentText ( 'test' ) ;
524+ this . blocks . statementInput1 . setWarningText ( 'test' ) ;
525+ const icons = this . blocks . statementInput1 . getIcons ( ) ;
526+ const prevNode = this . navigator . getPreviousSibling ( icons [ 1 ] ) ;
527+ assert . equal ( prevNode , icons [ 0 ] ) ;
528+ } ) ;
529+ test ( 'from field to icon' , function ( ) {
530+ this . blocks . statementInput1 . setCommentText ( 'test' ) ;
531+ this . blocks . statementInput1 . setWarningText ( 'test' ) ;
532+ const icons = this . blocks . statementInput1 . getIcons ( ) ;
533+ const prevNode = this . navigator . getPreviousSibling (
534+ this . blocks . statementInput1 . inputList [ 0 ] . fieldRow [ 0 ] ,
535+ ) ;
536+ assert . equal ( prevNode , icons [ 1 ] ) ;
537+ } ) ;
538+ test ( 'from icon to null' , function ( ) {
539+ this . blocks . dummyInput . setCommentText ( 'test' ) ;
540+ const icons = this . blocks . dummyInput . getIcons ( ) ;
541+ const prevNode = this . navigator . getPreviousSibling ( icons [ 0 ] ) ;
542+ assert . isNull ( prevNode ) ;
543+ } ) ;
499544 } ) ;
500545
501546 suite ( 'In' , function ( ) {
@@ -564,6 +609,18 @@ suite('Navigation', function () {
564609 const inNode = this . navigator . getFirstChild ( this . emptyWorkspace ) ;
565610 assert . isNull ( inNode ) ;
566611 } ) ;
612+ test ( 'from block to icon' , function ( ) {
613+ this . blocks . dummyInput . setCommentText ( 'test' ) ;
614+ const icons = this . blocks . dummyInput . getIcons ( ) ;
615+ const inNode = this . navigator . getFirstChild ( this . blocks . dummyInput ) ;
616+ assert . equal ( inNode , icons [ 0 ] ) ;
617+ } ) ;
618+ test ( 'from icon to null' , function ( ) {
619+ this . blocks . dummyInput . setCommentText ( 'test' ) ;
620+ const icons = this . blocks . dummyInput . getIcons ( ) ;
621+ const inNode = this . navigator . getFirstChild ( icons [ 0 ] ) ;
622+ assert . isNull ( inNode ) ;
623+ } ) ;
567624 } ) ;
568625
569626 suite ( 'Out' , function ( ) {
@@ -661,6 +718,12 @@ suite('Navigation', function () {
661718 const outNode = this . navigator . getParent ( this . blocks . outputNextBlock ) ;
662719 assert . equal ( outNode , inputConnection ) ;
663720 } ) ;
721+ test ( 'from icon to block' , function ( ) {
722+ this . blocks . dummyInput . setCommentText ( 'test' ) ;
723+ const icons = this . blocks . dummyInput . getIcons ( ) ;
724+ const outNode = this . navigator . getParent ( icons [ 0 ] ) ;
725+ assert . equal ( outNode , this . blocks . dummyInput ) ;
726+ } ) ;
664727 } ) ;
665728 } ) ;
666729} ) ;
0 commit comments