fix: Fixes failing tests for purchase order creation in view routes.
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -23,7 +23,6 @@ struct PurchaseOrderViewRouteTests {
|
||||
materials: "some",
|
||||
customer: "Testy",
|
||||
truckStock: false,
|
||||
createdByID: id,
|
||||
createdForID: id,
|
||||
vendorBranchID: id
|
||||
))))
|
||||
|
||||
Reference in New Issue
Block a user