-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathrpc_schedule.e2e.test.ts
More file actions
32 lines (28 loc) · 1.35 KB
/
rpc_schedule.e2e.test.ts
File metadata and controls
32 lines (28 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
import { describe, expect, it } from "vitest";
import { approveAll } from "../../src/index.js";
import { createSdkTestContext } from "./harness/sdkTestContext.js";
describe("Session schedule RPC", async () => {
const { copilotClient: client } = await createSdkTestContext();
it("should list no schedules for fresh session", async () => {
const session = await client.createSession({ onPermissionRequest: approveAll });
try {
const result = await session.rpc.schedule.list();
expect(result.entries).toEqual([]);
} finally {
await session.disconnect();
}
});
it("should return undefined entry when stopping unknown schedule", async () => {
const session = await client.createSession({ onPermissionRequest: approveAll });
try {
const result = await session.rpc.schedule.stop({ id: Number.MAX_SAFE_INTEGER });
expect(result.entry).toBeUndefined();
expect((await session.rpc.schedule.list()).entries).toEqual([]);
} finally {
await session.disconnect();
}
});
});