fix: enable BrowserWindow.id access post-destruction (#38241)

fix: enable BrowserWindow id access post-destruction
This commit is contained in:
Shelley Vohr 2023-05-16 09:29:00 +02:00 committed by GitHub
parent 042663e190
commit 9bd9d312f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -126,6 +126,13 @@ describe('BrowserWindow module', () => {
w.webContents.on('destroyed', () => w.close());
});
it('should allow access to id after destruction', async () => {
const closed = once(w, 'closed');
w.destroy();
await closed;
expect(w.id).to.be.a('number');
});
it('should emit unload handler', async () => {
await w.loadFile(path.join(fixtures, 'api', 'unload.html'));
const closed = once(w, 'closed');