mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:00:42 +00:00
test: repair current main checks
This commit is contained in:
@@ -28,24 +28,29 @@ describe("OpenClawApp Talk controls", () => {
|
|||||||
|
|
||||||
it("retries Talk immediately when the previous session is already in error state", async () => {
|
it("retries Talk immediately when the previous session is already in error state", async () => {
|
||||||
const { OpenClawApp } = await import("./app.ts");
|
const { OpenClawApp } = await import("./app.ts");
|
||||||
const staleStop = vi.fn();
|
const app = Object.create(OpenClawApp.prototype) as {
|
||||||
const app: {
|
|
||||||
client: unknown;
|
client: unknown;
|
||||||
connected: boolean;
|
connected: boolean;
|
||||||
lastError: string | null;
|
lastError: string | null;
|
||||||
realtimeTalkActive: boolean;
|
realtimeTalkActive: boolean;
|
||||||
|
realtimeTalkDetail: string | null;
|
||||||
realtimeTalkStatus: string;
|
realtimeTalkStatus: string;
|
||||||
realtimeTalkSession: { stop(): void } | null;
|
realtimeTalkSession: { stop(): void } | null;
|
||||||
|
realtimeTalkTranscript: string | null;
|
||||||
sessionKey: string;
|
sessionKey: string;
|
||||||
} = {
|
|
||||||
client: { request: vi.fn() },
|
|
||||||
connected: true,
|
|
||||||
lastError: null,
|
|
||||||
realtimeTalkActive: true,
|
|
||||||
realtimeTalkStatus: "error",
|
|
||||||
realtimeTalkSession: { stop: staleStop },
|
|
||||||
sessionKey: "main",
|
|
||||||
};
|
};
|
||||||
|
const staleStop = vi.fn();
|
||||||
|
Object.defineProperties(app, {
|
||||||
|
client: { value: { request: vi.fn() }, writable: true },
|
||||||
|
connected: { value: true, writable: true },
|
||||||
|
lastError: { value: null, writable: true },
|
||||||
|
realtimeTalkActive: { value: true, writable: true },
|
||||||
|
realtimeTalkDetail: { value: null, writable: true },
|
||||||
|
realtimeTalkSession: { value: { stop: staleStop }, writable: true },
|
||||||
|
realtimeTalkStatus: { value: "error", writable: true },
|
||||||
|
realtimeTalkTranscript: { value: null, writable: true },
|
||||||
|
sessionKey: { value: "main", writable: true },
|
||||||
|
});
|
||||||
|
|
||||||
await OpenClawApp.prototype.toggleRealtimeTalk.call(app as never);
|
await OpenClawApp.prototype.toggleRealtimeTalk.call(app as never);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user