Skip to content

Commit 943d2b9

Browse files
committed
test: custom live preview file nav integ tests
1 parent ea5521d commit 943d2b9

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/spec/LiveDevelopmentCustomServer-test.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,17 @@ define(function (require, exports, module) {
459459
await _waitForIframeURL('http://localhost:43768/sub.html');
460460
}, 30000);
461461

462+
it("should custom server base url be loaded by default for non-previewable files", async function () {
463+
await _setupDocusaurusProject("sub/");
464+
465+
await awaitsForDone(SpecRunnerUtils.openProjectFiles(["blank.css"]),
466+
"open blank.css");
467+
await _waitForIframeURL('http://localhost:43768/');
468+
await awaitsForDone(SpecRunnerUtils.openProjectFiles(["sub/sub.html"]),
469+
"open sub/sub.html");
470+
await _waitForIframeURL('http://localhost:43768/sub.html');
471+
}, 30000);
472+
462473
it("should custom server always load non docasaurus markdowns with intgrated live preview", async function () {
463474
const testTempDir = await SpecRunnerUtils.getTempTestDirectory(
464475
"/spec/LiveDevelopment-MultiBrowser-test-files", true);
@@ -607,6 +618,25 @@ define(function (require, exports, module) {
607618
}
608619
}, 30000);
609620

621+
it("should custom server load base url for non-previewable files", async function () {
622+
const testTempDir = await SpecRunnerUtils.getTempTestDirectory(
623+
"/spec/LiveDevelopment-MultiBrowser-test-files", true);
624+
await SpecRunnerUtils.loadProjectInTestWindow(testTempDir);
625+
await awaits(1000); // this is here so that the preferences json is properly created and loaded
626+
PreferencesManager.set(PREFERENCE_PROJECT_SERVER_ENABLED, true, PreferencesManager.PROJECT_SCOPE);
627+
PreferencesManager.set(PREFERENCE_PROJECT_SERVER_URL, "http://localhost:43768", PreferencesManager.PROJECT_SCOPE);
628+
PreferencesManager.set(PREFERENCE_PROJECT_SERVER_PATH, "", PreferencesManager.PROJECT_SCOPE);
629+
PreferencesManager.set(PREFERENCE_PROJECT_PREVIEW_FRAMEWORK, "Custom", PreferencesManager.PROJECT_SCOPE);
630+
PreferencesManager.set(PREFERENCE_PROJECT_SERVER_HOT_RELOAD_SUPPORTED, false, PreferencesManager.PROJECT_SCOPE);
631+
await awaitsForDone(SpecRunnerUtils.openProjectFiles(["blank.css"]),
632+
"open blank.css");
633+
await _waitForIframeURL('http://localhost:43768/');
634+
await awaitsForDone(SpecRunnerUtils.openProjectFiles(["simple1.html"]),
635+
"open simple1.html");
636+
await _waitForIframeURL('http://localhost:43768/simple1.html');
637+
await endPreviewSession();
638+
}, 30000);
639+
610640
it("should custom server honor custom server root subPath", async function () {
611641
const subPaths = ["/sub", "/sub/", "sub/"];
612642
for(let subPath of subPaths){

0 commit comments

Comments
 (0)