mirror of
https://github.com/google/blockly.git
synced 2026-04-26 07:00:23 +02:00
fix: add group when cutting workspace comments (#9680)
* fix: add group when cutting workspace comments * Update shortcut_items.ts * added check for group to the cut workspace comment unit test
This commit is contained in:
@@ -217,7 +217,9 @@ export function registerCut() {
|
||||
if (focused instanceof BlockSvg) {
|
||||
focused.checkAndDelete();
|
||||
} else if (isIDeletable(focused)) {
|
||||
eventUtils.setGroup(true);
|
||||
focused.dispose();
|
||||
eventUtils.setGroup(false);
|
||||
}
|
||||
return !!copyData;
|
||||
},
|
||||
|
||||
@@ -295,6 +295,11 @@ suite('Keyboard Shortcut Items', function () {
|
||||
this.disposeSpy = sinon.spy(this.comment, 'dispose');
|
||||
|
||||
this.injectionDiv.dispatchEvent(keyEvent);
|
||||
|
||||
const deleteEvents = this.workspace
|
||||
.getUndoStack()
|
||||
.filter((e) => e.type === 'comment_delete');
|
||||
assert(deleteEvents[0].group !== ''); // Group string is not empty
|
||||
sinon.assert.calledOnce(this.copySpy);
|
||||
sinon.assert.calledOnce(this.disposeSpy);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user