mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
fix: stop Cockpit work before asynchronous UI teardown
This commit is contained in:
1 parent
947fc79182
commit
152d3e2352
11 files changed
+150
-15
No files matched your search
@@ -19,7 +19,7 @@ function fixture() {
|
||||
this.children = [];
|
||||
this.parentNode = null;
|
||||
this.scrollTop = 0;
|
||||
this.classList = { toggle() {} };
|
||||
this.classList = { toggle() {}, remove() {} };
|
||||
}
|
||||
append(node) {
|
||||
node.remove();
|
||||
@@ -181,3 +181,22 @@ test('disposal restores groups and revokes mode listeners and queued focus work'
|
||||
f.restore();
|
||||
}
|
||||
});
|
||||
|
||||
test('a stopped portal waits for cleanup without running queued focus work', () => {
|
||||
const f = fixture();
|
||||
try {
|
||||
const owner = f.create();
|
||||
owner.setActive(true);
|
||||
const queued = [...f.frames.values()];
|
||||
owner.stop();
|
||||
queued.forEach((callback) => callback());
|
||||
owner.setActive(false);
|
||||
assert.equal(f.group.parentNode, f.slot);
|
||||
assert.equal(f.frames.size, 0);
|
||||
assert.equal(f.focusCalls, 0);
|
||||
owner.destroy();
|
||||
assert.deepEqual(f.standard.children, [f.group, f.sibling]);
|
||||
} finally {
|
||||
f.restore();
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user