feat: Admin Area Challenges: List, Import/Export and Add/Edit Modal

This commit is contained in:
OpenVelo Agent
2026-07-22 20:26:27 +00:00
parent 6c18603a7d
commit 216795b5db
33 changed files with 4256 additions and 105 deletions
+2 -3
View File
@@ -213,14 +213,13 @@ describe('Uploads endpoint integration', () => {
expect(icons.some((f) => f === 'big.bin')).toBe(false);
});
it('stores files under per-route subdirectories', async () => {
it('does not expose a direct /uploads/challenge-file route anymore (challenge files are staged)', async () => {
const { agent, csrf } = await primeCsrf();
const res = await agent
.post('/api/v1/uploads/challenge-file')
.set('Authorization', `Bearer ${adminToken}`)
.set('X-CSRF-Token', csrf)
.attach('file', Buffer.from('attachment'), 'readme.txt');
expect(res.status).toBe(201);
expect(res.body.publicUrl).toMatch(/^\/uploads\/challenges\//);
expect([404, 405]).toContain(res.status);
});
});