Skip to content

Commit 3c494a2

Browse files
committed
Fix a test case by returning success on ProductAction.searchProducts.
1 parent cf12627 commit 3c494a2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

WooCommerce/WooCommerceTests/ViewRelated/Search/Product/ProductSearchUICommandTests.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,14 @@ final class ProductSearchUICommandTests: XCTestCase {
156156

157157
func test_productListSearched_is_tracked_when_synchronizing_models() throws {
158158
// Given
159-
let command = ProductSearchUICommand(siteID: sampleSiteID, analytics: analytics, isSearchProductsBySKUEnabled: true)
159+
let stores = MockStoresManager(sessionManager: .testingInstance)
160+
let command = ProductSearchUICommand(siteID: sampleSiteID, stores: stores, analytics: analytics, isSearchProductsBySKUEnabled: true)
161+
stores.whenReceivingAction(ofType: ProductAction.self) { action in
162+
guard case let .searchProducts(_, _, _, _, _, _, _, _, _, _, onCompletion) = action else {
163+
return XCTFail("Unexpected action: \(action)")
164+
}
165+
onCompletion(.success(()))
166+
}
160167

161168
// When
162169
waitFor { promise in

0 commit comments

Comments
 (0)