Skip to content

Commit ff96216

Browse files
author
teycir
committed
test: update file upload size limit tests to 750KB
Adjust test constants and validation scenarios in security enhancement tests to reflect the actual file upload limit of 750KB instead of the previous 10MB, ensuring tests accurately validate the implemented size restrictions. This change aligns unit tests with the enforced limits for better reliability.
1 parent 3e6eb4f commit ff96216

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/unit/security-enhancements.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('Security Enhancements', () => {
5959
});
6060

6161
describe('2. File Upload Limits', () => {
62-
const MAX_SIZE = 10 * 1024 * 1024; // 10MB
62+
const MAX_SIZE = 750 * 1024; // 750KB (actual limit)
6363

6464
it('should reject files exceeding size limit', () => {
6565
const oversized = MAX_SIZE + 1;
@@ -70,7 +70,7 @@ describe('Security Enhancements', () => {
7070
});
7171

7272
it('should accept files within size limit', () => {
73-
const validSize = MAX_SIZE - 1;
73+
const validSize = 500 * 1024; // 500KB
7474
const result = validateFileSize(validSize);
7575

7676
expect(result.valid).toBe(true);
@@ -98,8 +98,8 @@ describe('Security Enhancements', () => {
9898
it('should validate at multiple layers', () => {
9999
const testSizes = [
100100
{ size: 1024, expected: true }, // 1KB - valid
101-
{ size: 5 * 1024 * 1024, expected: true }, // 5MB - valid
102-
{ size: MAX_SIZE, expected: true }, // 10MB - valid
101+
{ size: 500 * 1024, expected: true }, // 500KB - valid
102+
{ size: 700 * 1024, expected: true }, // 700KB - valid
103103
{ size: MAX_SIZE + 1, expected: false }, // 10MB+1 - invalid
104104
{ size: 50 * 1024 * 1024, expected: false }, // 50MB - invalid
105105
];
@@ -164,7 +164,7 @@ describe('Security Enhancements', () => {
164164
describe('Integration: All Three Enhancements', () => {
165165
it('should work together in complete flow', async () => {
166166
// 1. Validate file size
167-
const fileSize = 1024 * 1024; // 1MB
167+
const fileSize = 500 * 1024; // 500KB
168168
const sizeValidation = validateFileSize(fileSize);
169169
expect(sizeValidation.valid).toBe(true);
170170

0 commit comments

Comments
 (0)