test(e2e): stabilize suite

This commit is contained in:
Peter Steinberger
2026-02-14 20:54:31 +01:00
parent 2a3da21333
commit c06a962bb6
15 changed files with 238 additions and 84 deletions

View File

@@ -117,6 +117,18 @@ describe("gateway server auth/connect", () => {
ws.close();
});
test("ignores requested scopes when device identity is omitted", async () => {
const ws = await openWs(port);
const res = await connectReq(ws, { device: null });
expect(res.ok).toBe(true);
const health = await rpcReq(ws, "health");
expect(health.ok).toBe(false);
expect(health.error?.message).toContain("missing scope");
ws.close();
});
test("does not grant admin when scopes are omitted", async () => {
const ws = await openWs(port);
const token =
@@ -144,18 +156,6 @@ describe("gateway server auth/connect", () => {
signedAtMs,
token: token ?? null,
});
test("ignores requested scopes when device identity is omitted", async () => {
const ws = await openWs(port);
const res = await connectReq(ws, { device: null });
expect(res.ok).toBe(true);
const health = await rpcReq(ws, "health");
expect(health.ok).toBe(false);
expect(health.error?.message).toContain("missing scope");
ws.close();
});
const device = {
id: identity.deviceId,
publicKey: publicKeyRawBase64UrlFromPem(identity.publicKeyPem),