fix: Fixes failing tests for purchase order creation in view routes.

This commit is contained in:
2025-01-27 13:38:25 -05:00
parent 5da433b815
commit 027c7037a6
2 changed files with 13 additions and 2 deletions

View File

@@ -213,7 +213,8 @@ extension ViewController {
for: route,
isHtmxRequest: true,
logger: .init(label: "tests"),
authenticate: { _ in }
authenticate: { _ in },
currentUser: { .mock }
)
return html.renderFormatted()
}
@@ -428,6 +429,17 @@ extension PurchaseOrder.Create {
}
}
extension PurchaseOrder.CreateIntermediate {
static var mock: Self {
.init(
materials: "bar",
customer: "Testy McTestface",
createdForID: UUID(0),
vendorBranchID: UUID(0)
)
}
}
extension User.ResetPassword {
static var mock: Self {
.init(password: "super-secret", confirmPassword: "super-secret")

View File

@@ -23,7 +23,6 @@ struct PurchaseOrderViewRouteTests {
materials: "some",
customer: "Testy",
truckStock: false,
createdByID: id,
createdForID: id,
vendorBranchID: id
))))