Handle custom httpd port

We only supported fetching the default httpd port (8080).
This commit removes navigation to `radicle.local` which represents
`0.0.0.0:8080`, and prepares the app for defining custom port.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez
2023-06-14 16:17:21 +02:00
parent 4fcb7373a3
commit 52cece4680
11 changed files with 186 additions and 36 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ test("global hotkeys", async ({ page }) => {
await expect(page.getByPlaceholder(searchPlaceholder)).toHaveValue(
"searchquery?",
);
await expect(page.getByText("⏎")).toBeVisible();
await expect(page.getByText("⏎")).toBeHidden();
await expect(page.getByPlaceholder(searchPlaceholder)).not.toBeFocused();
}
});
+29
View File
@@ -0,0 +1,29 @@
import { test, expect } from "@tests/support/fixtures.js";
test("change httpd port", async ({ page, peerManager }) => {
const peer = await peerManager.startPeer({ name: "httpd" });
await peer.startHttpd(8070);
await peer.startNode();
await page.goto("/");
await page.getByRole("button", { name: "radicle.local" }).click();
await page.locator('input[name="port"]').fill("8070");
await page.locator('input[name="port"]').press("Enter");
const { stdout } = await peer.rad([
"web",
"--frontend",
"http://localhost:3000",
"--backend",
"http://127.0.0.1:8070",
]);
const match = stdout.trim().match(/(http:\/\/localhost:3000\/.*)$/);
if (!match) {
throw Error("Not able to parse auth url");
}
await page.goto(match[0]);
await expect(page.getByText("Authenticated")).toBeVisible();
await expect(page).toHaveURL("/seeds/127.0.0.1:8070");
});