mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-10 04:46:07 -08:00
feat(plugins): add JavaScript plugin system with overlay panel (#303)
This commit is contained in:
1 parent
90fc7cf940
commit
a9a4c4f083
110 files changed
+5897
-344
No files matched your search
@@ -158,6 +158,32 @@ test('primeModalWindow leaves Linux modal creation lazy', () => {
|
||||
assert.equal(h.createCalls, 0);
|
||||
});
|
||||
|
||||
test('a cancelled queued plugin panel cannot replace its successor when the window loads', () => {
|
||||
const modal = new FakeOverlayWindow({ ...LOADING_BLANK_WINDOW, documentLoaded: false });
|
||||
const h = createHarness({ modal });
|
||||
const first = new AbortController();
|
||||
h.runtime.sendToActiveOverlayWindow(
|
||||
'plugin-panel:open',
|
||||
{ panelId: 1 },
|
||||
{
|
||||
restoreOnModalClose: 'plugin-panel',
|
||||
preferModalWindow: true,
|
||||
signal: first.signal,
|
||||
},
|
||||
);
|
||||
first.abort();
|
||||
h.runtime.sendToActiveOverlayWindow(
|
||||
'plugin-panel:open',
|
||||
{ panelId: 2 },
|
||||
{
|
||||
restoreOnModalClose: 'plugin-panel',
|
||||
preferModalWindow: true,
|
||||
},
|
||||
);
|
||||
modal.finishLoad();
|
||||
assert.deepEqual(modal.sent, [['plugin-panel:open', { panelId: 2 }]]);
|
||||
});
|
||||
|
||||
test('sendToActiveOverlayWindow does not retain restore state when modal creation fails', () => {
|
||||
const h = createHarness({ createModal: () => null });
|
||||
|
||||
|
||||
Reference in new issue
Block a user