Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(control-api): assert isRegistryAuthActive is actually called in the derived-auth test

Jose Ramirezd0baee5ea83d
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index 324f6cab5..791694f26 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.387",
+ "version": "0.1.388",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.387",
+ "version": "0.1.388",
"dependencies": {
"@clerum/image-policy": "file:../packages/image-policy",
"@clerum/llm-providers": "file:../packages/llm-providers",
diff --git a/control-api/package.json b/control-api/package.json
index 9c429ab9a..937d5657a 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.387",
+ "version": "0.1.388",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/test/registryClient.test.ts b/control-api/test/registryClient.test.ts
index 86cdcccf4..ca3ef29fe 100644
--- a/control-api/test/registryClient.test.ts
+++ b/control-api/test/registryClient.test.ts
@@ -167,6 +167,13 @@ describe('registryClient — mintToken derived auth (no envOverride)', () => {
connDb.resolveMachineCreds.mockResolvedValue(null)
connDb.isRegistryAuthActive.mockResolvedValue(false)
await expect(mintToken()).resolves.toBe('') // NO ENV_OVERRIDE — see above
+ // Without this, the assertion above is vacuous: the old env-var-based
+ // implementation also resolves authEnabled=false here (config.registryAuthEnabled
+ // is frozen false at module load in this test env) WITHOUT ever calling
+ // isRegistryAuthActive — so the return-value alone can't tell the derived
+ // path apart from the old, un-refactored one. This call-count assertion fails
+ // under both a full revert and a "hardcoded/ignored accessor" mutation.
+ expect(connDb.isRegistryAuthActive).toHaveBeenCalledTimes(1)
})
it('throws when auth is active but credentials are unavailable', async () => {