Files
paseo/packages/app/e2e/browser/settings-host-selection.spec.ts
T
Mohamed Boudra 631ed0408d fix(app): preserve host selection across settings navigation (#7893)
Own the selected host for the Settings visit so screen replacements and Back do not reset an explicit picker choice. Apply named-host entry intents once while preserving workspace defaults for new visits.
2026-10-26 11:30:54 +07:00

64 lines
2.3 KiB
TypeScript

import { test } from "../support/fixtures";
import { openSettings } from "../support/helpers/app";
import { getE2EDaemonPort, wsRoutePatternForPort } from "../support/helpers/daemon-port";
import { startIsolatedHostDaemon } from "../support/helpers/isolated-host-daemon";
import {
addDirectHostFromSettings,
clickSettingsBackToWorkspace,
openSettingsHostSection,
openSettingsSection,
selectSettingsHost,
} from "../support/helpers/settings";
import { getServerId } from "../support/helpers/server-id";
import { seedWorkspace } from "../support/helpers/seed-client";
import { switchWorkspaceViaSidebar } from "../support/helpers/workspace-ui";
test.describe("Settings host selection", () => {
test.describe.configure({ timeout: 180_000 });
test("entering Settings from a remote workspace selects that remote host", async ({ page }) => {
const remoteDaemon = await startIsolatedHostDaemon("settings-host-selection-remote");
const remoteWorkspace = await seedWorkspace({
port: remoteDaemon.port,
repoPrefix: "settings-host-selection-remote-workspace-",
title: "Remote workspace",
});
try {
// The default local profile remains in the registry, but its daemon is offline.
await page.routeWebSocket(wsRoutePatternForPort(getE2EDaemonPort()), async (ws) => {
await ws.close({ code: 1008, reason: "The local daemon is disconnected." });
});
await page.goto("/");
await openSettings(page);
await addDirectHostFromSettings(page, {
host: "127.0.0.1",
port: remoteDaemon.port,
});
await clickSettingsBackToWorkspace(page);
await switchWorkspaceViaSidebar({
page,
serverId: remoteDaemon.serverId,
workspaceId: remoteWorkspace.workspaceId,
});
await openSettings(page);
await openSettingsHostSection(page, remoteDaemon.serverId, "connections");
await selectSettingsHost(page, getServerId());
await openSettingsSection(page, "appearance");
await openSettingsHostSection(page, getServerId(), "connections");
await clickSettingsBackToWorkspace(page);
await openSettings(page);
await openSettingsHostSection(page, remoteDaemon.serverId, "connections");
} finally {
await remoteWorkspace.cleanup().catch(() => undefined);
await remoteDaemon.close().catch(() => undefined);
}
});
});