Skip to content

Commit cbae2b9

Browse files
authored
test: Avoid flakes by explicitly aligning blocks (#10245)
1 parent 0dabe62 commit cbae2b9

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

packages/blockly/tests/mocha/render_management_test.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,20 @@ suite('Render Management', function () {
131131
setup(function () {
132132
this.workspace = Blockly.inject('blocklyDiv', {});
133133

134-
// Create and init two identical overlapping blocks so that the first
135-
// render will need to bump one.
136134
this.block = this.workspace.newBlock('controls_if');
137135
this.block.initSvg();
138136

139137
const block2 = this.workspace.newBlock('controls_if');
140138
block2.initSvg();
139+
Blockly.renderManagement.triggerQueuedRenders();
140+
141+
// Align the blocks' next and previous connections without connecting them
142+
// so that they'll need to bump one another.
143+
this.block.moveBy(
144+
block2.nextConnection.x - this.block.previousConnection.x,
145+
block2.nextConnection.y - this.block.previousConnection.y,
146+
['test'],
147+
);
141148
});
142149

143150
test('does not record undo event when the render was queued with recordUndo disabled', function () {

0 commit comments

Comments
 (0)