feat: Adds reset password views and view routes.
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user