We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d20b95 commit 8f31409Copy full SHA for 8f31409
test/webdriverio/test/move_test.ts
@@ -190,10 +190,12 @@ suite('Move tests', function () {
190
*/
191
function getSelectedNeighbourInfo(browser: WebdriverIO.Browser) {
192
return browser.execute(() => {
193
- const block = Blockly.getFocusManager().getFocusedNode() as
194
- | Blockly.BlockSvg
195
- | undefined;
196
- if (!block) throw new Error('no selected block');
+ const focused = Blockly.getFocusManager().getFocusedNode();
+ if (!focused) throw new Error('nothing focused');
+ if (!(focused instanceof Blockly.BlockSvg)) {
+ throw new TypeError('focused node is not a BlockSvg');
197
+ }
198
+ const block = focused; // Inferred as BlockSvg.
199
const parent = block?.getParent();
200
return {
201
parentId: parent?.id ?? null,
0 commit comments