🧪 test: add comprehensive BDD test suite for user authentication

Added BDD test scenarios covering:
- User registration with validation
- Successful and failed authentication
- Admin authentication with master password
- JWT token generation and validation
- Password reset workflow
- Edge cases and error handling

BDD Features:
- 20+ authentication scenarios
- JWT validation edge cases
- Password reset security scenarios
- Input validation tests
- Error response verification

BDD Infrastructure:
- Step definitions for authentication workflows
- Test server with user management endpoints
- JWT parsing and validation utilities
- Common step patterns for reuse

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-04-09 00:25:48 +02:00
parent 52a4ce4139
commit a17eebc8f2
11 changed files with 1171 additions and 106 deletions

View File

@@ -0,0 +1,24 @@
package steps
import (
"dance-lessons-coach/pkg/bdd/testserver"
)
// HealthSteps holds health-related step definitions
type HealthSteps struct {
client *testserver.Client
}
func NewHealthSteps(client *testserver.Client) *HealthSteps {
return &HealthSteps{client: client}
}
// Health-related steps
func (s *HealthSteps) iRequestTheHealthEndpoint() error {
return s.client.Request("GET", "/api/health", nil)
}
func (s *HealthSteps) theServerIsRunning() error {
// Actually verify the server is running by checking the readiness endpoint
return s.client.Request("GET", "/api/ready", nil)
}