test(FN-2531): expand headless remote access test coverage

- Add serve command assertions for headless remote-access provider and lifecycle route behavior
- Add auth middleware integration coverage for hybrid login-url and remote-login token scenarios
- Add dedicated remote-access routes tests to verify route parity in headless mode
- Update dashboard route and server tests to validate remote auth and access flow expectations
This commit is contained in:
Fusion
2026-04-26 07:51:54 -07:00
committed by gsxdsm
parent a16a6a32d5
commit eba4022417
5 changed files with 313 additions and 5 deletions

View File

@@ -728,6 +728,22 @@ describe("runServe", () => {
await triggerSignal("SIGINT");
});
it("preserves remote-capable headless wiring when daemon auth is enabled", async () => {
const { createServer } = await import("@fusion/dashboard");
await runServe(0, { daemon: true });
expect(createServer).toHaveBeenCalledTimes(1);
const serverOptions = createServer.mock.calls[0][1];
expect(serverOptions).toMatchObject({ headless: true, daemon: { token: expect.any(String) } });
expect(serverOptions.daemon.token.length).toBeGreaterThan(0);
expect(serverOptions.engine).toBeDefined();
expect(typeof serverOptions.engine.startRemoteTunnel).toBe("function");
expect(typeof serverOptions.engine.stopRemoteTunnel).toBe("function");
await triggerSignal("SIGINT");
});
it("sets enginePaused when started with paused=true", async () => {
await runServe(0, { paused: true });