@@ -367,6 +367,31 @@ suite('Connection checker', function() {
367367 'Should connect two compatible stack blocks' ) ;
368368 } ) ;
369369
370+ test ( 'Connect to unmovable shadow block' , function ( ) {
371+ // Remove original test blocks.
372+ this . workspace . clear ( ) ;
373+
374+ // Add the same test blocks, but this time block B is a shadow block.
375+ Blockly . Xml . domToWorkspace ( Blockly . utils . xml . textToDom ( `<xml xmlns="https://developers.google.com/blockly/xml">
376+ <block type="text_print" id="A" x="-76" y="-112">
377+ <next>
378+ <shadow type="text_print" id="B" movable="false">
379+ </shadow>
380+ </next>
381+ </block>
382+ <block type="text_print" id="C" x="47" y="-118"/>
383+ </xml>` ) , this . workspace ) ;
384+ [ this . blockA , this . blockB , this . blockC ] = this . workspace . getAllBlocks ( true ) ;
385+
386+ // Try to connect blockC into the input connection of blockA, replacing blockB.
387+ // This is allowed because shadow blocks can always be replaced, even though
388+ // they are unmovable.
389+ chai . assert . isTrue (
390+ this . checker . doDragChecks (
391+ this . blockC . previousConnection , this . blockA . nextConnection , 9000 ) ,
392+ 'Should connect in place of a shadow block' ) ;
393+ } ) ;
394+
370395 test ( 'Do not splice into unmovable stack' , function ( ) {
371396 // Try to connect blockC above blockB. It shouldn't work because B is not movable
372397 // and is already connected to A's nextConnection.
0 commit comments