AI Implementation feature(861): Admin Area Challenges: List, Import/Export and Add/Edit Modal (#40)

This commit was merged in pull request #40.
This commit is contained in:
2026-07-22 20:26:30 +00:00
parent 1a40e5708a
commit 8dcbd48045
41 changed files with 4548 additions and 145 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);
});
});