File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -864,23 +864,31 @@ class IndexTests: OnlineTestCase {
864864 expectation. fulfill ( )
865865 } else {
866866 // Delete by query.
867- let query = Query ( )
867+ let query = Query ( query : " " )
868868 query. numericFilters = [ " dummy < 1500 " ]
869869 self . index. deleteBy ( query, completionHandler: { ( content, error) -> Void in
870870 if error != nil {
871871 XCTFail ( error!. localizedDescription)
872872 expectation. fulfill ( )
873873 } else {
874- // Check that the deleted objects no longer exist.
875- self . index. browse ( query: query, completionHandler: { ( content, error) in
874+ self . index. waitTask ( withID: content![ " taskID " ] as! Int , completionHandler: { ( content, error) -> Void in
876875 if error != nil {
877876 XCTFail ( error!. localizedDescription)
877+ expectation. fulfill ( )
878878 } else {
879- XCTAssertEqual ( ( content![ " hits " ] as? [ Any ] ) ? . count, 0 )
880- XCTAssertNil ( content![ " cursor " ] )
879+ // Check that the deleted objects no longer exist.
880+ self . index. browse ( query: query, completionHandler: { ( content, error) in
881+ if error != nil {
882+ XCTFail ( error!. localizedDescription)
883+ } else {
884+ XCTAssertEqual ( ( content![ " hits " ] as? [ Any ] ) ? . count, 0 )
885+ XCTAssertNil ( content![ " cursor " ] )
886+ }
887+ expectation. fulfill ( )
888+ } )
881889 }
882- expectation. fulfill ( )
883890 } )
891+
884892 }
885893 } )
886894 }
You can’t perform that action at this time.
0 commit comments