web: notify failed and waiting runs from the browser Notification API (L5)
This commit is contained in:
@@ -293,6 +293,30 @@ test("a run action throws when the reply has no run detail", async () => {
|
||||
await assert.rejects(() => repo.cancelRun(7), ProtocolError);
|
||||
});
|
||||
|
||||
test("subscribeRuns sends exactly the blank any-workspace watch and no run_ids", async () => {
|
||||
const { repo, ws } = connected();
|
||||
ws.reply = (frame) => ({ id: frame.id, type: "subscribe" });
|
||||
|
||||
await repo.subscribeRuns();
|
||||
assert.deepEqual(lastFrame(ws), { type: "subscribe", workspace: "" });
|
||||
});
|
||||
|
||||
test("unsubscribeRuns sends exactly {type:'unsubscribe'}", async () => {
|
||||
const { repo, ws } = connected();
|
||||
ws.reply = (frame) => ({ id: frame.id, type: "unsubscribe" });
|
||||
|
||||
await repo.unsubscribeRuns();
|
||||
assert.deepEqual(lastFrame(ws), { type: "unsubscribe" });
|
||||
});
|
||||
|
||||
test("subscribeRuns is not sent while the page is not connected", async () => {
|
||||
FakeWebSocket.instances = [];
|
||||
const client = new PipelinesClient({ WebSocketImpl: FakeWebSocket });
|
||||
const repo = new PipelinesRepository(client);
|
||||
await assert.rejects(() => repo.subscribeRuns(), { name: "NotConnectedError" });
|
||||
assert.equal(FakeWebSocket.instances.length, 0);
|
||||
});
|
||||
|
||||
// ---- The composer's own commands (C8/C9) ----------------------------------
|
||||
|
||||
test("chatPrompt trims the text, sends the operation and native message ids, and omits files when empty", async () => {
|
||||
|
||||
Reference in New Issue
Block a user