mirror of
https://github.com/google/blockly.git
synced 2025-12-16 06:10:12 +01:00
fix: Fire a VarTypeChange event when changing a variable's type. (#9236)
This commit is contained in:
@@ -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,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user