@@ -285,18 +285,21 @@ final class ProductStore_FilterProductsTests: XCTestCase {
285285 remote. whenLoadingAllProducts ( siteID: sampleSiteID, thenReturn: . success( [ Product . fake ( ) ] ) )
286286
287287 // When
288- let synchronizeAction = ProductAction . synchronizeProducts ( siteID: sampleSiteID,
289- pageNumber: defaultPageNumber,
290- pageSize: defaultPageSize,
291- stockStatus: filteredStockStatus,
292- productStatus: filteredProductStatus,
293- productType: filteredProductType,
294- productCategory: filteredProductCategory,
295- sortOrder: filteredProductSortOrder,
296- productIDs: [ 1 , 2 ] ,
297- excludedProductIDs: [ 30 , 45 ] ,
298- onCompletion: { _ in } )
299- productStore. onAction ( synchronizeAction)
288+ waitFor { promise in
289+ productStore. onAction ( ProductAction . synchronizeProducts ( siteID: self . sampleSiteID,
290+ pageNumber: self . defaultPageNumber,
291+ pageSize: self . defaultPageSize,
292+ stockStatus: filteredStockStatus,
293+ productStatus: filteredProductStatus,
294+ productType: filteredProductType,
295+ productCategory: filteredProductCategory,
296+ sortOrder: filteredProductSortOrder,
297+ productIDs: [ 1 , 2 ] ,
298+ excludedProductIDs: [ 30 , 45 ] ,
299+ onCompletion: { _ in
300+ promise ( ( ) )
301+ } ) )
302+ }
300303
301304 // Then
302305 XCTAssertTrue ( remote. synchronizeProductsTriggered)
0 commit comments