fix: Fire a VarTypeChange event when changing a variable's type. (#9236)

This commit is contained in:
Aaron Dodson
2025-07-14 09:53:17 -07:00
committed by GitHub
parent 52634e4dec
commit 9f66f0c596
2 changed files with 31 additions and 0 deletions

View File

@@ -505,5 +505,26 @@ suite('Variable Map', function () {
});
});
});
suite('variable type change events', function () {
test('are fired when a variable has its type changed', function () {
const variable = this.variableMap.createVariable(
'name1',
'type1',
'id1',
);
this.variableMap.changeVariableType(variable, 'type2');
assertEventFired(
this.eventSpy,
Blockly.Events.VarTypeChange,
{
oldType: 'type1',
newType: 'type2',
varId: 'id1',
},
this.workspace.id,
);
});
});
});
});