Skip to content

Commit dbc0559

Browse files
committed
fix: Fix strict connection checker tests
1 parent 7bc7480 commit dbc0559

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

plugins/strict-connection-checker/test/checker_test.mocha.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ suite('StrictConnectionChecker', function () {
3232
isShadow: function () {
3333
return isShadow;
3434
},
35+
id: '123',
3536
};
3637
}
3738
suite('Safety checks', function () {
@@ -52,7 +53,10 @@ suite('StrictConnectionChecker', function () {
5253
}
5354

5455
test('Target Null', function () {
55-
const connection = new Blockly.Connection({}, Blockly.INPUT_VALUE);
56+
const connection = new Blockly.Connection(
57+
{id: '123'},
58+
Blockly.INPUT_VALUE,
59+
);
5660
assertReasonHelper(
5761
this.checker,
5862
connection,
@@ -61,7 +65,7 @@ suite('StrictConnectionChecker', function () {
6165
);
6266
});
6367
test('Target Self', function () {
64-
const block = {workspace: 1};
68+
const block = {workspace: 1, id: '123'};
6569
const connection1 = new Blockly.Connection(block, Blockly.INPUT_VALUE);
6670
const connection2 = new Blockly.Connection(block, Blockly.OUTPUT_VALUE);
6771

@@ -74,11 +78,11 @@ suite('StrictConnectionChecker', function () {
7478
});
7579
test('Different Workspaces', function () {
7680
const connection1 = new Blockly.Connection(
77-
{workspace: 1},
81+
{workspace: 1, id: '123'},
7882
Blockly.INPUT_VALUE,
7983
);
8084
const connection2 = new Blockly.Connection(
81-
{workspace: 2},
85+
{workspace: 2, id: '123'},
8286
Blockly.OUTPUT_VALUE,
8387
);
8488

@@ -294,8 +298,11 @@ suite('StrictConnectionChecker', function () {
294298
});
295299
suite('Check Types', function () {
296300
setup(function () {
297-
this.con1 = new Blockly.Connection({}, Blockly.PREVIOUS_STATEMENT);
298-
this.con2 = new Blockly.Connection({}, Blockly.NEXT_STATEMENT);
301+
this.con1 = new Blockly.Connection(
302+
{id: '123'},
303+
Blockly.PREVIOUS_STATEMENT,
304+
);
305+
this.con2 = new Blockly.Connection({id: '123'}, Blockly.NEXT_STATEMENT);
299306
});
300307
/**
301308
* Assert that the type checks pass for the given connections in either

0 commit comments

Comments
 (0)