Files
horus-3d/tests/unit/gatewayRestartPolicy.test.ts
T
Luke The Dev 4fa4f13558 First Release of Claw3D (#11)
Co-authored-by: iamlukethedev <iamlukethedev@users.noreply.github.com>
2026-03-19 23:14:04 -05:00

20 lines
819 B
TypeScript

import { describe, expect, it } from "vitest";
import { observeGatewayRestart } from "@/features/agents/operations/gatewayRestartPolicy";
describe("observeGatewayRestart", () => {
it("marks_saw_disconnect_on_non_connected_status_and_completes_on_reconnect", () => {
const start = { sawDisconnect: false };
const connected = observeGatewayRestart(start, "connected");
expect(connected).toEqual({ next: { sawDisconnect: false }, restartComplete: false });
const connecting = observeGatewayRestart(connected.next, "connecting");
expect(connecting).toEqual({ next: { sawDisconnect: true }, restartComplete: false });
const reconnected = observeGatewayRestart(connecting.next, "connected");
expect(reconnected).toEqual({ next: { sawDisconnect: true }, restartComplete: true });
});
});