feat: Admin Area Challenges: List, Import/Export and Add/Edit Modal
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user