From 8c60c8e033f270a135664f9f1d1cf9ca66e353b2 Mon Sep 17 00:00:00 2001 From: abose Date: Fri, 5 Jan 2024 12:59:05 +0530 Subject: [PATCH] fix: live preview integ test fails after secure domain seperation --- .../default/Phoenix-live-preview/StaticServer.js | 2 +- test/spec/LiveDevelopmentMultiBrowser-test.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/extensions/default/Phoenix-live-preview/StaticServer.js b/src/extensions/default/Phoenix-live-preview/StaticServer.js index 0ab02940ea..bf2e0fb77f 100644 --- a/src/extensions/default/Phoenix-live-preview/StaticServer.js +++ b/src/extensions/default/Phoenix-live-preview/StaticServer.js @@ -389,7 +389,7 @@ define(function (require, exports, module) { function getContent(path, url) { if(!_staticServerInstance){ - return; + return Promise.reject("Static serve not started!"); } if(!url.startsWith(_staticServerInstance._baseUrl)) { return Promise.reject("Not serving content as url belongs to another phcode instance: " + url); diff --git a/test/spec/LiveDevelopmentMultiBrowser-test.js b/test/spec/LiveDevelopmentMultiBrowser-test.js index ff85989930..b6d0183454 100644 --- a/test/spec/LiveDevelopmentMultiBrowser-test.js +++ b/test/spec/LiveDevelopmentMultiBrowser-test.js @@ -479,8 +479,7 @@ define(function (require, exports, module) { await awaits(500); iFrame = testWindow.document.getElementById("panel-live-preview-frame"); let srcURL = new URL(iFrame.src); - expect(srcURL.pathname.endsWith("pageLoader.html")).toBeTrue(); - expect(srcURL.searchParams.get("URL").endsWith("sub/icon_chevron.png")).toBeTrue(); + expect(srcURL.pathname.endsWith("sub/icon_chevron.png")).toBeTrue(); // now switch back to old file await _editFileAndVerifyLivePreview("simple1.html", {line: 11, ch: 45}, 'hello world ', @@ -511,7 +510,7 @@ define(function (require, exports, module) { await endPreviewSession(); }, 30000); - it("should pin live previews ping html file", async function () { + it("should pin live previews pin html file", async function () { await awaitsForDone(SpecRunnerUtils.openProjectFiles(["simple1.html"]), "SpecRunnerUtils.openProjectFiles simple1.html"); @@ -534,8 +533,7 @@ define(function (require, exports, module) { await awaits(1000); let outerIFrame = testWindow.document.getElementById("panel-live-preview-frame"); let srcURL = new URL(outerIFrame.src); - expect(srcURL.pathname.endsWith("pageLoader.html")).toBeTrue(); - expect(srcURL.searchParams.get("URL").endsWith("sub/icon_chevron.png")).toBeTrue(); + expect(srcURL.pathname.endsWith("sub/icon_chevron.png")).toBeTrue(); await endPreviewSession(); }, 30000);