diff --git a/tests/runner-e2e/chat-catalog-domains/external-company-secret-question.test.ts b/tests/runner-e2e/chat-catalog-domains/external-company-secret-question.test.ts index d2752608a65..9aceae4d36c 100644 --- a/tests/runner-e2e/chat-catalog-domains/external-company-secret-question.test.ts +++ b/tests/runner-e2e/chat-catalog-domains/external-company-secret-question.test.ts @@ -29,7 +29,7 @@ it("actual company act admits its safe question before private human entry",asyn await expect(companySecretExternalCases[0]!.act!(ctx,{currentPersonId:"person"})).rejects.toThrow("NEXT_REAL_HUMAN_PHASE");expect(reached).toBe(true); }); it("accepts Done and completed-setup Yes without repeating the already-bound consumer",()=>{ - for(const label of ["Done","Yes","Done, ready to continue","Done for deployment"]){const row=question();row.payload.questionSet!.questions[0]!.options![0]!.label=label;expect(companySecretQuestionHandoff(row,binding)).toMatchObject({optionId:"yes"});} + for(const label of ["Done","Yes","Done, ready to continue","Done for deployment","Done for DEPLOYMENT_API_KEY","Done for the Deployment API key"]){const row=question();row.payload.questionSet!.questions[0]!.options![0]!.label=label;expect(companySecretQuestionHandoff(row,binding)).toMatchObject({optionId:"yes"});} }); it("rejects prospective Yes and negative or other-owner completion choices",()=>{ const prospective=question();prospective.payload.questionSet!.questions[0]!.prompt="Would you like me to configure this?";prospective.payload.questionSet!.questions[0]!.options![0]!.label="Yes";expect(companySecretQuestionHandoff(prospective,binding)).toBeUndefined(); @@ -37,7 +37,7 @@ it("rejects prospective Yes and negative or other-owner completion choices",()=> }); it("keeps an explicit Morgan acknowledgement and rejects other named completion recipients",()=>{ - for(const [recipient,accepted] of [["Morgan",true],["CEO",false],["Jordan",false]] as const){ + for(const [recipient,accepted] of [["Morgan",true],["CEO",false],["Jordan",false],["CEO’s DEPLOYMENT_API_KEY",false]] as const){ const row=question();row.payload.questionSet!.questions[0]!.options![0]!.label=`Done for ${recipient}`; expect(!!companySecretQuestionHandoff(row,binding)).toBe(accepted); } diff --git a/tests/runner-e2e/chat-catalog-domains/external-company-secret.ts b/tests/runner-e2e/chat-catalog-domains/external-company-secret.ts index 4f43dede879..ce16018f172 100644 --- a/tests/runner-e2e/chat-catalog-domains/external-company-secret.ts +++ b/tests/runner-e2e/chat-catalog-domains/external-company-secret.ts @@ -49,7 +49,8 @@ export function companySecretQuestionHandoff(value:unknown,b:SecretQuestionBindi const completedPrompt=/\b(?:have you|did you)\b[^?]*\b(?:saved|added|entered|bound|configured|completed|finished)\b/i.test(q.prompt); const choices=q.options!.filter(o=>{ const answer=`${o.label} ${o.description??""}`; - const recipients=[...answer.matchAll(/\b(?:[Ff]or|[Tt]o)\s+(?:the\s+)?(?:[Aa]gent\s+([A-Za-z][A-Za-z0-9_-]*)|([A-Z][A-Za-z0-9_-]*)|([Cc][Ee][Oo]))\b/g)]; + const recipientText=answer.replace(/\b(?:DEPLOYMENT_API_KEY|Deployment API key)\b/g,"credential"); + const recipients=[...recipientText.matchAll(/\b(?:[Ff]or|[Tt]o)\s+(?:the\s+)?(?:[Aa]gent\s+([A-Za-z][A-Za-z0-9_-]*)|([A-Z][A-Za-z0-9_-]*)|([Cc][Ee][Oo]))\b/g)]; return (/\b(?:saved|added|entered|done)\b/i.test(answer)||(completedPrompt&&/^yes[.!\s]*$/i.test(answer.trim()))) &&recipients.every(match=>/^Morgan$/i.test(match[1]??match[2]??match[3]??"")) &&!/\b(?:not|never|cannot|can't|didn.t|haven.t|hasn.t|yet|need|later|will|would|Riley|another|their)\b|someone else/i.test(answer);