From b8afa2cb10efb0a6e998bef8c473ccae9524dead Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 23:23:17 +0100 Subject: [PATCH] test: tighten auth runtime integration assertions --- src/secrets/runtime.auth.integration.test.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/secrets/runtime.auth.integration.test.ts b/src/secrets/runtime.auth.integration.test.ts index e17defc6e89..7265c8ae41a 100644 --- a/src/secrets/runtime.auth.integration.test.ts +++ b/src/secrets/runtime.auth.integration.test.ts @@ -163,14 +163,18 @@ describe("secrets runtime snapshot auth integration", () => { }); activateSecretsRuntimeSnapshot(refreshed); - expect( - getActiveSecretsRuntimeSnapshot()?.authStores.find( - (entry) => entry.agentDir === opsAgentDir, - )?.store.profiles["anthropic:ops"], - ).toMatchObject({ - type: "api_key", - key: "sk-ops-runtime", - keyRef: { source: "env", provider: "default", id: "ANTHROPIC_API_KEY" }, + const profile = getActiveSecretsRuntimeSnapshot()?.authStores.find( + (entry) => entry.agentDir === opsAgentDir, + )?.store.profiles["anthropic:ops"]; + expect(profile?.type).toBe("api_key"); + if (profile?.type !== "api_key") { + throw new Error("Expected anthropic ops API key profile"); + } + expect(profile.key).toBe("sk-ops-runtime"); + expect(profile.keyRef).toEqual({ + source: "env", + provider: "default", + id: "ANTHROPIC_API_KEY", }); }); });