mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-24 16:21:04 +00:00
test: tighten gateway health assertions
This commit is contained in:
@@ -136,9 +136,7 @@ describe("gateway cli backend connect", () => {
|
||||
const health = await client.request("health", undefined, {
|
||||
timeoutMs: 1_000,
|
||||
});
|
||||
expect(health).toMatchObject({
|
||||
ok: true,
|
||||
});
|
||||
expect(health.ok).toBe(true);
|
||||
expect(server.requests).toEqual(["connect", "health"]);
|
||||
} finally {
|
||||
await client?.stopAndWait({ timeoutMs: 1_000 }).catch(() => {});
|
||||
|
||||
@@ -250,15 +250,14 @@ describe("gateway silent scope-upgrade reconnect", () => {
|
||||
});
|
||||
|
||||
try {
|
||||
await expect(
|
||||
callGateway({
|
||||
url: `ws://127.0.0.1:${started.port}`,
|
||||
token: "secret",
|
||||
method: "health",
|
||||
scopes: ["operator.admin"],
|
||||
timeoutMs: 2_000,
|
||||
}),
|
||||
).resolves.toMatchObject({ ok: true });
|
||||
const health = await callGateway({
|
||||
url: `ws://127.0.0.1:${started.port}`,
|
||||
token: "secret",
|
||||
method: "health",
|
||||
scopes: ["operator.admin"],
|
||||
timeoutMs: 2_000,
|
||||
});
|
||||
expect(health.ok).toBe(true);
|
||||
|
||||
const paired = await getPairedDevice(identity.deviceId);
|
||||
expect(paired?.approvedScopes).toEqual(["operator.read"]);
|
||||
|
||||
Reference in New Issue
Block a user