Skip to content

Commit 51735fc

Browse files
author
Theodore Li
committed
Fix unit tests
1 parent 3ce7320 commit 51735fc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

apps/sim/app/api/auth/reset-password/route.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe('Reset Password API Route', () => {
6868

6969
it('should handle missing token', async () => {
7070
const req = createMockRequest('POST', {
71-
newPassword: 'newSecurePassword123',
71+
newPassword: 'newSecurePassword123!',
7272
})
7373

7474
const response = await POST(req)
@@ -97,7 +97,7 @@ describe('Reset Password API Route', () => {
9797
it('should handle empty token', async () => {
9898
const req = createMockRequest('POST', {
9999
token: '',
100-
newPassword: 'newSecurePassword123',
100+
newPassword: 'newSecurePassword123!',
101101
})
102102

103103
const response = await POST(req)
@@ -119,7 +119,11 @@ describe('Reset Password API Route', () => {
119119
const data = await response.json()
120120

121121
expect(response.status).toBe(400)
122-
expect(data.message).toBe('Password must be at least 8 characters long')
122+
expect(data.message).toContain('Password must be at least 8 characters long')
123+
expect(data.message).toContain('Password must contain at least one uppercase letter')
124+
expect(data.message).toContain('Password must contain at least one lowercase letter')
125+
expect(data.message).toContain('Password must contain at least one number')
126+
expect(data.message).toContain('Password must contain at least one special character')
123127

124128
expect(mockResetPassword).not.toHaveBeenCalled()
125129
})

0 commit comments

Comments
 (0)