test: add submission integrity integration tests - #34
Conversation
Stevenjoelrs
left a comment
There was a problem hiding this comment.
Tests 2 y 3 tienen await new Promise(r => setTimeout(r, 10_100)) para esperar que pase la ventana de rate limiting (10s) esta bien pero alarga los tests a ~15-30s.
Si en el futuro se cambia RATE_LIMIT_MS, estos tests se rompen silenciosamente. Consideraría exportar la constante o mockearla
|
|
||
| }, 30000); | ||
|
|
||
| }); |
There was a problem hiding this comment.
se cierra prematuramente el describe, los últimos 3 tests quedaron huérfanos, funciona pero la estructura está mal
| }), | ||
| headers: { | ||
| "Content-Type": "application/json", | ||
| "x-forwarded-for": team.id, |
There was a problem hiding this comment.
en las lineas 153, 243, 441 esta puesto "x-forwarded-for": team.id. El endpoint de submissions no usa la IP para nada (el rate limit es por userId)
|
|
||
|
|
||
|
|
||
| it("flag incorrecta: creates failed submission without score", async () => { |
There was a problem hiding this comment.
"flag incorrecta" tas mezclando español/inglés xd
Added integration tests for submission score integrity.
Covered cases:
Prevent double scoring for the same flag
Multi-flag scoring per team
Concurrent submissions
Incorrect flag submissions without score creation
Serialization conflict handling (P2034)