diff --git a/core/flyout_base.ts b/core/flyout_base.ts index e9797df4f..259c830fd 100644 --- a/core/flyout_base.ts +++ b/core/flyout_base.ts @@ -1214,6 +1214,8 @@ export abstract class Flyout extends DeleteArea implements IFlyout { // Clone the block. const json = blocks.save(oldBlock) as blocks.State; + // TODO: Add a saveIds parameter to `save`. + json['id'] = undefined; // Normallly this resizes leading to weird jumps. Save it for terminateDrag. targetWorkspace.setResizesEnabled(false); const block = blocks.append(json, targetWorkspace) as BlockSvg; diff --git a/tests/browser/test/mutator_test.js b/tests/browser/test/mutator_test.js index 2d5e6adfe..39fbd3f44 100644 --- a/tests/browser/test/mutator_test.js +++ b/tests/browser/test/mutator_test.js @@ -61,13 +61,6 @@ async function testMutator(browser, delta) { }; }); - // The flyout block and the workspace block have the same id, so to get - // around that I pass in the selector to the connect function. - const dragBlockSelector = await browser.$( - '#blocklyDiv > div > svg.blocklySvg > g > g.blocklyBubbleCanvas > g > ' + - 'g:nth-child(2) > svg:nth-child(1) > g > g.blocklyBlockCanvas > ' + - 'g.blocklyDraggable', - ); // For some reason this needs a lot more time. await browser.pause(2000); await connect( @@ -77,7 +70,6 @@ async function testMutator(browser, delta) { await getBlockElementById(browser, ifQuarkId), 'NEXT', mutatorBlockId, - dragBlockSelector, ); await browser.pause(PAUSE_TIME); diff --git a/tests/browser/test/test_setup.js b/tests/browser/test/test_setup.js index fbe53b6f1..9f562226e 100644 --- a/tests/browser/test/test_setup.js +++ b/tests/browser/test/test_setup.js @@ -305,7 +305,6 @@ async function connect( targetBlock, targetConnection, mutatorBlockId, - dragBlockSelector, ) { let draggedLocation; let targetLocation; @@ -340,11 +339,7 @@ async function connect( x: targetLocation.x - draggedLocation.x, y: targetLocation.y - draggedLocation.y, }; - if (mutatorBlockId) { - await dragBlockSelector.dragAndDrop(delta); - } else { await draggedBlock.dragAndDrop(delta); - } } /**