fix: don't set delegate for QLPreviewPanel (#37577)

fix: don't set delegate for QLPreviewPanel

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Spiegel <jeremy.spiegel@frontapp.com>
This commit is contained in:
trop[bot]
2023-03-16 13:48:26 +01:00
committed by GitHub
parent cb3a169caa
commit 9b338b91ec
2 changed files with 16 additions and 2 deletions

View File

@@ -5239,6 +5239,22 @@ describe('BrowserWindow module', () => {
w.closeFilePreview();
}).to.not.throw();
});
it('should not call BrowserWindow show event', async () => {
const w = new BrowserWindow({ show: false });
const shown = emittedOnce(w, 'show');
w.show();
await shown;
let showCalled = false;
w.on('show', () => {
showCalled = true;
});
w.previewFile(__filename);
await delay(500);
expect(showCalled).to.equal(false, 'should not have called show twice');
});
});
// TODO (jkleinsc) renable these tests on mas arm64