From 612fb80137f50a3acaf42e12bcaab79fb1cfc691 Mon Sep 17 00:00:00 2001 From: Antoine Roy-Gobeil Date: Tue, 19 May 2020 18:49:14 -0400 Subject: [PATCH] test that dash-preview handles pages with iframes --- test/unit/plotly-dash-preview_test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/unit/plotly-dash-preview_test.js b/test/unit/plotly-dash-preview_test.js index 66b90deb..a35609e9 100644 --- a/test/unit/plotly-dash-preview_test.js +++ b/test/unit/plotly-dash-preview_test.js @@ -203,5 +203,23 @@ tap.test('render:', t => { }) }) + t.test('should handle pages with iframes', t => { + // https://github.com/electron/electron/issues/20634 + const win = createMockWindow() + sinon.stub(remote, 'createBrowserWindow').returns(win) + win.webContents.executeJavaScript.resolves(true) + + fn({ + url: 'https://stackoverflow.com/questions/909018/avoiding-initial-memory-heap-size-error', + timeOut: 1 + }, {}, (errorCode, result) => { + t.ok(win.webContents.printToPDF.calledOnce) + t.ok(win.close.calledOnce) + t.equal(errorCode, 525, 'code') + t.equal(result.msg, 'dash preview generation failed', 'error msg') + t.end() + }) + }) + t.end() })