fix: preserve plugin dialogs and isolate event delivery
This commit is contained in:
1 parent
36486a0850
commit
fe0c014e60
3 files changed
+15
-6
No files matched your search
@@ -330,10 +330,12 @@ test('closing a page retries cleanup of a late task after rate limiting', async
|
||||
assert.equal(attempts, 2)
|
||||
})
|
||||
|
||||
test('pruning removes a view and dialogs when their conditions stop matching', () => {
|
||||
test('pruning removes an unavailable page but keeps open dialogs until their VM disappears', () => {
|
||||
const page = { pluginId: 'demo', viewId: 'vm', location: 'vm.tab', vm: 'vm-1' }
|
||||
const dialog = { ...page, viewId: 'dialog', location: 'dialog' }
|
||||
let state = openPluginView(emptyPluginViewState, page)
|
||||
state = openPluginView(state, dialog)
|
||||
assert.deepEqual(prunePluginViews(state, new Set(['demo/vm', 'demo/dialog']), () => true, () => false), emptyPluginViewState)
|
||||
const views = new Set(['demo/vm', 'demo/dialog'])
|
||||
assert.deepEqual(prunePluginViews(state, views, () => true, () => false), { ...emptyPluginViewState, dialogs: [dialog] })
|
||||
assert.deepEqual(prunePluginViews(state, views, () => false), emptyPluginViewState)
|
||||
})
|
||||
Reference in new issue
Block a user