test(auth): align device scope expectations (#53151)

This commit is contained in:
Altay
2026-03-23 23:56:02 +03:00
committed by GitHub
parent c1131ba7e0
commit a53715e9d0
2 changed files with 6 additions and 2 deletions

View File

@@ -294,7 +294,11 @@ describe("device pairing tokens", () => {
const paired = await getPairedDevice("device-1", baseDir);
expect(paired?.scopes).toEqual(["operator.admin"]);
expect(paired?.approvedScopes).toEqual(["operator.admin"]);
expect(paired?.tokens?.operator?.scopes).toEqual(["operator.admin"]);
expect(paired?.tokens?.operator?.scopes).toEqual([
"operator.admin",
"operator.read",
"operator.write",
]);
});
test("rejects scope escalation when rotating a token and leaves state unchanged", async () => {

View File

@@ -186,7 +186,7 @@ describe("device-auth-store", () => {
expect(entry).toEqual({
token: "new-token",
role: "operator",
scopes: ["operator.write"],
scopes: ["operator.read", "operator.write"],
updatedAtMs: 2222,
});
expect(readStore()).toEqual({