Verify provider failure preserves drafts and improve user feedback
This commit is contained in:
@@ -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;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user