refactor: enforce password min-length via domain Password value object
Some checks failed
CI / Check / Test (push) Failing after 49s

This commit is contained in:
2026-06-10 03:15:43 +02:00
parent d8cff33679
commit c4d6b68ef9
4 changed files with 59 additions and 10 deletions

View File

@@ -46,3 +46,19 @@ async fn test_register_duplicate_email_fails() {
let result = register::execute(&ctx, cmd("bob@example.com")).await;
assert!(result.is_err(), "duplicate email should fail");
}
#[tokio::test]
async fn test_register_short_password_fails() {
let ctx = TestContextBuilder::new().build();
let result = register::execute(
&ctx,
RegisterCommand {
email: "x@y.com".to_string(),
username: "testuser".to_string(),
password: "short".to_string(),
role: UserRole::Standard,
},
)
.await;
assert!(result.is_err());
}