test(support-chat): rate limit spacing in stage integration script

This commit is contained in:
devops committed 2026-10-14 18:05:21 +00:00
1 parent 9aebe0ec43
commit 3b9a9fab7c
1 file changed
+2 -1
+2 -1
View File
@@ -21,10 +21,11 @@ async function check(name, body, expected, token, test=()=>true){
for(const field of ['userId','history','context','sessionId'])await check('reject '+field,{message:'سلام',[field]:ids[1]},400);
await Promise.all(ids.map((id,i)=>check('wallet isolation '+i,{message:'کیف پول',scope:'wallet'},201,jwt.sign({sub:id}),d=>d.answer.includes(i?'222':'111')&&!d.answer.includes(i?'111':'222'))));
await check('guest public real model',{message:'مکمل سگ کنینا'},201,null,d=>typeof d.answer==='string'&&!/provider|hermes|api.key/i.test(d.answer));
await check('finglish dog query allowed',{message:'Sagam qaza nemikhore chizi darin?'},201,null,d=>typeof d.answer==='string'&&d.answer.length>10);
await new Promise(resolve=>setTimeout(resolve,61000));
await check('finglish dog query allowed',{message:'Sagam qaza nemikhore chizi darin?'},201,null,d=>typeof d.answer==='string'&&d.answer.length>10);
await check('football answered off-topic politely',{message:'فوتبال سگ نتیجه چی شد؟'},201,null,d=>d.answer.includes('حیوانات خانگی')||d.answer.includes('کنینا'));
await check('URL denied',{message:'مکمل سگ https://example.com'},201,null,d=>d.answer.includes('پیوند')||d.answer.includes('فقط درباره'));
console.log('LIVE_STAGE_CHECKS_PASSED',count);
}finally{await p.user.deleteMany({where:{id:{in:ids}}});await p.$disconnect();}
})().catch(()=>{console.error('LIVE_STAGE_CHECK_FAILED (details suppressed)');process.exit(1)});