test: tighten gateway health assertions

This commit is contained in:
Peter Steinberger
2026-05-11 13:07:10 +01:00
parent 2dcc05a9eb
commit 4bfdb6ef30
2 changed files with 9 additions and 12 deletions

View File

@@ -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(() => {});

View File

@@ -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"]);