Skip to content

Commit 8b4c0c2

Browse files
committed
Fix string mismatch in unknown product error handling
Updated the unknown product name from "Unknown Product" to "One or more products" to match the string value used in the error message view's comparison logic. This ensures the generic error message ("A product in the cart is no longer available.") displays correctly instead of incorrectly using the format string with "Unknown Product" as the product name. Also updated test expectations to match the new string value.
1 parent d19ab02 commit 8b4c0c2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Modules/Sources/Yosemite/Tools/POS/POSOrderService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private extension POSOrderService {
258258
)
259259
static let unknownProductName = NSLocalizedString(
260260
"pointOfSale.orderController.unknownProduct",
261-
value: "Unknown Product",
261+
value: "One or more products",
262262
comment: "Fallback name for a product that couldn't be identified in error handling."
263263
)
264264
}

Modules/Tests/YosemiteTests/Tools/POS/POSOrderServiceTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ struct POSOrderServiceTests {
362362
#expect(missingItems.count == 1)
363363
#expect(missingItems.first?.productID == 0) // Generic error
364364
#expect(missingItems.first?.variationID == 0)
365-
#expect(missingItems.first?.name == "Unknown Product")
365+
#expect(missingItems.first?.name == "One or more products")
366366
return true
367367
}
368368
return false
@@ -502,7 +502,7 @@ struct POSOrderServiceTests {
502502
#expect(missingItems.count == 1)
503503
#expect(missingItems.first?.productID == 0)
504504
#expect(missingItems.first?.variationID == 999)
505-
#expect(missingItems.first?.name == "Unknown Product")
505+
#expect(missingItems.first?.name == "One or more products")
506506
return true
507507
}
508508
return false

0 commit comments

Comments
 (0)