feat: ability to clear flyout blocks when language changes

This commit is contained in:
Andy O'Neill 2022-12-12 16:54:32 -05:00
parent f930aa61a9
commit 2581446907
3 changed files with 28 additions and 0 deletions

View file

@ -1055,3 +1055,16 @@ test('toJSON encodes Infinity/NaN as 0, not null', t => {
t.end();
});
test('clearFlyoutBlocks removes all of the flyout blocks', t => {
const vm = new VirtualMachine();
const flyoutBlocks = vm.runtime.flyoutBlocks;
flyoutBlocks.createBlock(adapter(events.mockVariableBlock)[0]);
t.equal(Object.keys(flyoutBlocks._blocks).length, 1);
vm.clearFlyoutBlocks();
t.equal(Object.keys(flyoutBlocks._blocks).length, 0);
t.end();
});