feat!: allow blocks to receive their own delete events (#6337)

* feat!: allow blocks to receive their own delete events

* fix: move block tests back into main directory

* chore: add a test for disposing of callers

* chore: add test for delete being received

* chore: add comment about why we have to run the clock twice

* chore: fix whitespace

* chore: fix whitespace

* chore: fix imports in tests

* chore: bump mocha timeout

* chore: bump timeout again?

* chore: eliminate the possibility that tests are actually timing out

* chore: change timeout back

* chore: remove tests that might be the problematic ones

* chore: attempt enabling delete event test

* chore: enable lists tests

* chore: try ternary test as well

* chore: actually add block test files

* chore: enable remaining tests
This commit is contained in:
Beka Westberg
2022-08-16 22:49:40 +00:00
committed by GitHub
parent 8689ab2ad5
commit e9920a54e0
7 changed files with 174 additions and 95 deletions

View File

@@ -980,7 +980,7 @@ const PROCEDURE_CALL_COMMON = {
Xml.domToWorkspace(xml, this.workspace);
Events.setGroup(false);
}
} else if (event.type === Events.BLOCK_DELETE) {
} else if (event.type === Events.BLOCK_DELETE && event.blockId != this.id) {
// Look for the case where a procedure definition has been deleted,
// leaving this block (a procedure call) orphaned. In this case, delete
// the orphan.