fix(remote-desktop): probe the saved host guacd endpoint (#1481)

* fix(remote-desktop): probe the saved host guacd endpoint

* test(css): exercise the configured PostCSS plugin chain

* test(identity): preserve full Ed25519 public keys in fixtures
This commit is contained in:
ZacharyZcR authored and GitHub committed 2026-09-27 00:11:09 -05:00
1 parent c98003f90e
commit 3b9a1bacf0
5 files changed
+194 -5

No files matched your search

@@ -172,3 +172,46 @@ it("looks up the session on the backend that issued its token", async () => {
});
expect(authApiMock.get).not.toHaveBeenCalled();
});
describe("saved host status routing", () => {
it("maps the local host ID before probing the remote backend", async () => {
isElectronMock.mockReturnValue(true);
resolveRemoteHostIdMock.mockResolvedValue(41);
await getGuacdStatus("remote", {
hostId: 9,
protocol: "rdp",
syncId: "sync-9",
});
expect(resolveRemoteHostIdMock).toHaveBeenCalledWith("sync-9");
expect(remoteApiMock.get).toHaveBeenCalledWith(
"/status?hostId=41&protocol=rdp",
);
expect(authApiMock.get).not.toHaveBeenCalled();
});
it("keeps local IDs for local connections", async () => {
isElectronMock.mockReturnValue(true);
await getGuacdStatus("local", {
hostId: 9,
protocol: "vnc",
syncId: "sync-9",
});
expect(authApiMock.get).toHaveBeenCalledWith(
"/status?hostId=9&protocol=vnc",
);
expect(resolveRemoteHostIdMock).not.toHaveBeenCalled();
});
it("does not probe an unrelated remote ID when a synced host is missing", async () => {
isElectronMock.mockReturnValue(true);
resolveRemoteHostIdMock.mockResolvedValue(null);
await expect(
getGuacdStatus("remote", {
hostId: 9,
protocol: "rdp",
syncId: "missing",
}),
).rejects.toThrow("does not exist");
expect(remoteApiMock.get).not.toHaveBeenCalled();
});
});