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

@@ -101,6 +101,25 @@ struct ViewControllerTests {
}
}
@Test
func resetPasswordViews() async throws {
try await withSnapshotTesting(record: record) {
try await withDependencies {
$0.dateFormatter = .mock
$0.database.users = .mock
$0.viewController = .liveValue
} operation: {
@Dependency(\.viewController) var viewController
var htmlString = try await viewController.render(.resetPassword(.index(id: UUID(0))))
assertSnapshot(of: htmlString, as: .html)
htmlString = try await viewController.render(.resetPassword(.submit(id: UUID(0), request: .mock)))
assertSnapshot(of: htmlString, as: .html)
}
}
}
@Test
func userViews() async throws {
try await withSnapshotTesting(record: record) {
@@ -408,3 +427,9 @@ extension PurchaseOrder.Create {
)
}
}
extension User.ResetPassword {
static var mock: Self {
.init(password: "super-secret", confirmPassword: "super-secret")
}
}