Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix unit tests
  • Loading branch information
Theodore Li committed Apr 6, 2026
commit 51735fccdf51142bdc51eba08685ed410c08dce9
10 changes: 7 additions & 3 deletions apps/sim/app/api/auth/reset-password/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('Reset Password API Route', () => {

it('should handle missing token', async () => {
const req = createMockRequest('POST', {
newPassword: 'newSecurePassword123',
newPassword: 'newSecurePassword123!',
})

const response = await POST(req)
Expand Down Expand Up @@ -97,7 +97,7 @@ describe('Reset Password API Route', () => {
it('should handle empty token', async () => {
const req = createMockRequest('POST', {
token: '',
newPassword: 'newSecurePassword123',
newPassword: 'newSecurePassword123!',
})

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

expect(response.status).toBe(400)
expect(data.message).toBe('Password must be at least 8 characters long')
expect(data.message).toContain('Password must be at least 8 characters long')
expect(data.message).toContain('Password must contain at least one uppercase letter')
expect(data.message).toContain('Password must contain at least one lowercase letter')
expect(data.message).toContain('Password must contain at least one number')
expect(data.message).toContain('Password must contain at least one special character')

expect(mockResetPassword).not.toHaveBeenCalled()
})
Expand Down
Loading