fix: verify test user emails to allow login
Some checks failed
Basil CI/CD Pipeline / Code Linting (push) Successful in 1m2s
Basil CI/CD Pipeline / Web Tests (push) Failing after 1m11s
Basil CI/CD Pipeline / Shared Package Tests (push) Successful in 56s
Basil CI/CD Pipeline / Build & Push Docker Images (push) Has been skipped
Basil CI/CD Pipeline / Trigger Deployment (push) Has been skipped
Basil CI/CD Pipeline / API Tests (push) Failing after 1m23s
Basil CI/CD Pipeline / Security Scanning (push) Successful in 1m8s
Basil CI/CD Pipeline / Build All Packages (push) Has been skipped
Basil CI/CD Pipeline / E2E Tests (push) Has been skipped

- Add emailVerified: true after registration in tests
- Login requires email verification (passport.ts line 48)
- Without this, passport returns 401 with "Please verify your email"
- Applies to both main test user and Authorization test user

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-15 03:24:33 +00:00
parent 98d6127631
commit cc23033f11

View File

@@ -30,6 +30,15 @@ describe('Meal Plans Routes - Real Integration Tests', () => {
throw new Error(`Registration failed: ${JSON.stringify(userResponse.body)}`);
}
// Verify email (required for login to succeed)
await prisma.user.update({
where: { id: testUserId },
data: {
emailVerified: true,
emailVerifiedAt: new Date(),
},
});
// Login to get auth token
const loginResponse = await request(app)
.post('/api/auth/login')
@@ -534,6 +543,15 @@ describe('Meal Plans Routes - Real Integration Tests', () => {
throw new Error(`Registration failed for other user: ${JSON.stringify(userResponse.body)}`);
}
// Verify email (required for login to succeed)
await prisma.user.update({
where: { id: otherUserId },
data: {
emailVerified: true,
emailVerifiedAt: new Date(),
},
});
// Login to get auth token
const loginResponse = await request(app)
.post('/api/auth/login')