Skip to content

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

TypeScript

test(control-ui): cover the rotation PUT-rejection branch in UpdateConnectorCredentials

Alfredo Lopez2b7a2ead8dff
diff --git a/control-ui/components/__tests__/UpdateConnectorCredentials.test.tsx b/control-ui/components/__tests__/UpdateConnectorCredentials.test.tsx
index 2a2ada16a..c9f3f56f7 100644
--- a/control-ui/components/__tests__/UpdateConnectorCredentials.test.tsx
+++ b/control-ui/components/__tests__/UpdateConnectorCredentials.test.tsx
@@ -199,6 +199,29 @@ describe('UpdateConnectorCredentials — client-side validation', () => {
})
})
+describe('UpdateConnectorCredentials — PUT rejection', () => {
+ it('surfaces the backend error and never reports success when the rotation PUT is rejected', async () => {
+ // The primary #223 journey must fail LOUD, not silent: when control-api
+ // rejects the rotation PUT — e.g. the c01394e invalid Secret-key 400, or any
+ // other 4xx/5xx — the UI has to show the failure and must never flip to a
+ // false "Credentials rotated." A rejected PUT also means no rollout to poll.
+ mockUpdateMcpSecret.mockRejectedValue(
+ new Error('400 Bad Request - data key "..bad" is not a valid Secret key')
+ )
+
+ await renderPanel(ENV_SECRET)
+ await submitRotation({ 'api-key': 'sk-super-secret' })
+
+ expect(screen.getByText(/Rotation failed/i)).toBeInTheDocument()
+ expect(screen.getByText(/not a valid Secret key/i)).toBeInTheDocument()
+ expect(screen.queryByText(/Credentials rotated/i)).not.toBeInTheDocument()
+ // The PUT was actually attempted (not blocked client-side), and the failure
+ // short-circuits before any DeploymentReady poll.
+ expect(mockUpdateMcpSecret).toHaveBeenCalledTimes(1)
+ expect(mockGetMcpServer).not.toHaveBeenCalled()
+ })
+})
+
// ─── Polling / DeploymentReady correlation — the CRD contract (Fase 3 §6) ───
describe('UpdateConnectorCredentials — rollout polling', () => {
it('reports success once a FRESH DeploymentReady=True is observed after the PUT', async () => {
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index bbf998248..cb1cb2da1 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.364",
+ "version": "0.1.365",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.364",
+ "version": "0.1.365",
"dependencies": {
"@clerum/llm-providers": "file:../packages/llm-providers",
"@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",
diff --git a/control-ui/package.json b/control-ui/package.json
index 62dfdb3d4..2fad2fb38 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.364",
+ "version": "0.1.365",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",