migration

This commit is contained in:
Daniel Arantes Loverde
2026-08-11 13:22:02 -03:00
parent c4d6998595
commit 7702836fe7
231 changed files with 4329 additions and 1958 deletions

View File

@@ -0,0 +1,35 @@
import Testing
@testable import PediFoods
@Test("orderTracking destination routes to the Profile tab with a pending auto-intent order context")
@MainActor
func routeEffectForOrderTracking() {
let view = ContentView()
let effect = view.routeEffect(for: .orderTracking(orderId: "order-1", shortId: "PF-1"))
#expect(effect == .navigateToOrder(
OrderRouteContext(orderId: "order-1", shortId: "PF-1", paymentMethod: nil, total: nil, intent: .auto),
tab: .profile
))
}
@Test("orderTracking destination carries a nil shortId through unchanged")
@MainActor
func routeEffectForOrderTrackingWithoutShortId() {
let view = ContentView()
let effect = view.routeEffect(for: .orderTracking(orderId: "order-2", shortId: nil))
#expect(effect == .navigateToOrder(
OrderRouteContext(orderId: "order-2", shortId: nil, paymentMethod: nil, total: nil, intent: .auto),
tab: .profile
))
}
@Test("screen destination has no routing effect yet (unhandled deep-link screen)")
@MainActor
func routeEffectForScreenDestinationIsNone() {
let view = ContentView()
let effect = view.routeEffect(for: .screen(name: "promo", params: ["code": "SAVE10"]))
#expect(effect == .none)
}