We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8e3772 commit 95d377bCopy full SHA for 95d377b
1 file changed
src/WaitForHelper.ts
@@ -126,15 +126,11 @@ export class WaitForHelper {
126
127
async waitForEventsAfterAction(
128
action: () => Promise<unknown>,
129
- options?: {timeout?: number; dialog?: 'accept' | 'dismiss'},
+ options?: {timeout?: number; handleDialog?: boolean},
130
): Promise<void> {
131
- if (options?.dialog) {
132
- const dialogHandler = (dialog: Dialog) => {
133
- if (options.dialog === 'dismiss') {
134
- void dialog.dismiss();
135
- } else {
136
- void dialog.accept();
137
- }
+ if (options?.handleDialog) {
+ const dialogHandler = (dialog: Pick<Dialog, 'accept'>) => {
+ void dialog.accept();
138
};
139
this.#page.on('dialog', dialogHandler);
140
this.#abortController.signal.addEventListener('abort', () => {
0 commit comments