瀏覽代碼

Fix acceptDialog utility

Steven Silvester 8 年之前
父節點
當前提交
b5d2b89981
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      test/src/utils.ts

+ 3 - 0
test/src/utils.ts

@@ -100,6 +100,9 @@ export
 function acceptDialog(host: HTMLElement = document.body): Promise<void> {
   return waitForDialog(host).then(() => {
     let node = host.getElementsByClassName('jp-Dialog-okButton')[0];
+    if (!node) {
+      node = host.getElementsByClassName('jp-Dialog-warningButton')[0];
+    }
     if (node) {
       (node as HTMLElement).click();
     }