Skip to content

Commit 71b20bf

Browse files
committed
fix(files): update upload test — js is now a supported extension
1 parent 0cd5e46 commit 71b20bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/sim/app/api/files/upload/route.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,10 @@ describe('File Upload Security Tests', () => {
458458
expect(response.status).toBe(200)
459459
})
460460

461-
it('should reject JavaScript files', async () => {
461+
it('should reject unsupported file types', async () => {
462462
const formData = new FormData()
463-
const maliciousJs = 'alert("XSS")'
464-
const file = new File([maliciousJs], 'malicious.js', { type: 'application/javascript' })
463+
const content = 'binary data'
464+
const file = new File([content], 'archive.exe', { type: 'application/octet-stream' })
465465
formData.append('file', file)
466466
formData.append('context', 'workspace')
467467
formData.append('workspaceId', 'test-workspace-id')
@@ -475,7 +475,7 @@ describe('File Upload Security Tests', () => {
475475

476476
expect(response.status).toBe(400)
477477
const data = await response.json()
478-
expect(data.message).toContain("File type 'js' is not allowed")
478+
expect(data.message).toContain("File type 'exe' is not allowed")
479479
})
480480

481481
it('should reject files without extensions', async () => {

0 commit comments

Comments
 (0)