feat: Adds reset password views and view routes.

This commit is contained in:
2025-01-27 09:01:23 -05:00
parent 8a79ab0b02
commit f3ffdbf41b
10 changed files with 155 additions and 9 deletions

View File

@@ -65,6 +65,27 @@ struct UserApiRouteTests {
#expect(route == .user(.index))
}
@Test
func resetPassword() throws {
let id = UUID(0)
let json = """
{
\"password\": \"super-secret\",
\"confirmPassword\": \"super-secret\"
}
"""
var request = URLRequestData(
method: "PATCH",
path: "/api/v1/users/\(id)/reset-password",
body: .init(json.utf8)
)
let route = try router.parse(&request)
#expect(route == .user(.resetPassword(
id: id,
request: .init(password: "super-secret", confirmPassword: "super-secret")
)))
}
@Test
func update() throws {
let id = UUID(0)