docs: expand dialog window to BaseWindow (#43334)

docs: expand dialog window to BaseWindow
This commit is contained in:
Shelley Vohr 2024-08-16 16:49:10 +02:00 committed by GitHub
parent b497700e36
commit d7689bb9b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 44 additions and 29 deletions

View file

@ -1,5 +1,5 @@
import { expect } from 'chai';
import { dialog, BrowserWindow } from 'electron/main';
import { dialog, BaseWindow, BrowserWindow } from 'electron/main';
import { closeAllWindows } from './lib/window-helpers';
import { ifit } from './lib/spec-helpers';
import { setTimeout } from 'node:timers/promises';
@ -16,6 +16,11 @@ describe('dialog module', () => {
const w = new BrowserWindow();
dialog.showOpenDialog(w, { title: 'i am title' });
}).to.not.throw();
expect(() => {
const w = new BaseWindow();
dialog.showOpenDialog(w, { title: 'i am title' });
}).to.not.throw();
});
it('throws errors when the options are invalid', () => {
@ -52,6 +57,11 @@ describe('dialog module', () => {
const w = new BrowserWindow();
dialog.showSaveDialog(w, { title: 'i am title' });
}).to.not.throw();
expect(() => {
const w = new BaseWindow();
dialog.showSaveDialog(w, { title: 'i am title' });
}).to.not.throw();
});
it('throws errors when the options are invalid', () => {
@ -93,6 +103,11 @@ describe('dialog module', () => {
const w = new BrowserWindow();
dialog.showMessageBox(w, { message: 'i am message' });
}).to.not.throw();
expect(() => {
const w = new BaseWindow();
dialog.showMessageBox(w, { message: 'i am message' });
}).to.not.throw();
});
it('throws errors when the options are invalid', () => {