From 46e0372aab2d9b5a3f0d50eb5b0d03d33ea56387 Mon Sep 17 00:00:00 2001 From: Tim Oliver Date: Wed, 4 Oct 2023 22:29:15 -0700 Subject: [PATCH] Fix double item deletion test that started failing in Xcode 15 Summary: I'm going through the IGListKit test suite with Xcode 15 and updating the tests that subsequently started failing with the new changes made to `UICollectionView` under the hood. This was a test I originally added to help add to the code coverage, but it looks like my expectations about how it actually should work were incorrect, and it's now getting flagged by the new `UICollectionView` logic. I stepped through all the state with breakpoints and worked out how this is supposed to work. Differential Revision: D49898019 fbshipit-source-id: fad21d14f0ae3a0ffbee8dde502114971f35fa1c --- Tests/IGListAdapterE2ETests.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/IGListAdapterE2ETests.m b/Tests/IGListAdapterE2ETests.m index 40a93d8b..7a6562d4 100644 --- a/Tests/IGListAdapterE2ETests.m +++ b/Tests/IGListAdapterE2ETests.m @@ -1404,12 +1404,12 @@ XCTestExpectation *expectation = genExpectation; [sectionController.collectionContext performBatchAnimated:YES updates:^(id batchContext) { - object.value = @2; + object.value = @3; [batchContext deleteInSectionController:sectionController atIndexes:[NSIndexSet indexSetWithIndex:0]]; [batchContext deleteInSectionController:sectionController atIndexes:[NSIndexSet indexSetWithIndex:0]]; } completion:^(BOOL finished2) { XCTAssertEqual([self.collectionView numberOfSections], 1); - XCTAssertEqual([self.collectionView numberOfItemsInSection:0], 2); + XCTAssertEqual([self.collectionView numberOfItemsInSection:0], 3); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:30 handler:nil];