fix(FN-2525): harden remote access auth and tunnel regression coverage

- Add regression tests across CLI, core, dashboard, and engine for remote access auth, settings parity, and serve/TUI callback wiring
- Expand dashboard route and modal coverage for remote settings/auth flows including node environment behaviors
- Redact provider-switch failure details in tunnel process manager to avoid leaking sensitive provider diagnostics
- Update route registration and engine lifecycle tests to lock in remote-access behavior under real execution paths
This commit is contained in:
Fusion
2026-04-26 06:35:46 -07:00
committed by gsxdsm
parent 559e908865
commit f09346a9da
13 changed files with 815 additions and 19 deletions

View File

@@ -471,6 +471,44 @@ describe("Settings view", () => {
unmount();
});
it("wires P/U remote actions to persistent token refresh and URL handoff state", async () => {
const controller = newController();
controller.setSystemInfo(makeSystemInfo());
const regeneratePersistentToken = vi.fn(async () => ({
maskedToken: "tok_****",
tokenType: "persistent" as const,
expiresAt: null,
}));
const getRemoteUrl = vi.fn(async () => ({
url: "https://remote.example.com/remote-login?rt=masked",
tokenType: "persistent" as const,
expiresAt: null,
}));
controller.setInteractiveData(makeInteractiveData({
remote: {
regeneratePersistentToken,
getRemoteUrl,
},
}));
controller.setMode("interactive");
controller.setInteractiveView("settings");
const { lastFrame, stdin, unmount } = render(renderDashboardAppNode(controller));
stdin.write("\t");
await new Promise((r) => setTimeout(r, 20));
stdin.write("P");
await waitForFrameContains(lastFrame, "Persistent token: tok_****");
expect(regeneratePersistentToken).toHaveBeenCalledTimes(1);
stdin.write("U");
await waitForFrameContains(lastFrame, "Auth URL: https://remote.example.com/remote-login?rt=masked");
expect(getRemoteUrl).toHaveBeenCalledWith("persistent", undefined);
unmount();
});
it("keeps global shortcuts inactive during TTL input", async () => {
const controller = newController();
controller.setSystemInfo(makeSystemInfo());