Verify provider failure preserves drafts and improve user feedback

This commit is contained in:
2026-09-06 10:14:29 +03:00
parent a1d70b9dcf
commit 0fd46c4867
7 changed files with 32 additions and 3 deletions
+6
View File
@@ -43,3 +43,9 @@ test('a stalled AI request times out instead of locking the assistant indefinite
await assert.rejects(requestOfferAssistant({url:'/api/ai/belge-sor',body,readToken:()=>'first',timeoutMs:5,
fetcher:async(url,{signal})=>new Promise((resolve,reject)=>signal.addEventListener('abort',()=>reject(new DOMException('Aborted','AbortError')),{once:true}))}),/zaman aşımı/);
});
test('service unavailability gives ordinary users actionable feedback, not server setup instructions',async()=>{
await assert.rejects(requestOfferAssistant({url:'/api/ai/belge-sor',body,readToken:()=>'first',
fetcher:async()=>Response.json({success:false,error:'Internal provider setup details'},{status:503})}),error=>{
assert.match(error.message,/Çalışmanız korundu/);assert.doesNotMatch(error.message,/Internal provider/);return true;
});
});