docs: expand dialog window to BaseWindow (#43338)

docs: expand dialog window to BaseWindow

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2024-08-19 10:44:49 +02:00 committed by GitHub
parent 8c1be5ade2
commit 417348130c
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', () => {