From 97570b41d7874d73a6c5d81df430591a1fe91f61 Mon Sep 17 00:00:00 2001 From: Tim Oliver Date: Wed, 4 Oct 2023 22:29:15 -0700 Subject: [PATCH] Remove unneeded interactive reordering test Summary: This was another test I originally added to test moving items belonging to sections containing only 1 item as this triggers the codepath to move the whole section. It turns out this test isn't needed since the codepath is being properly tested in other tests. Differential Revision: D49900555 fbshipit-source-id: f2586a22ef0f529fcfa10c4ef7d6d065a9a89f7d --- Tests/IGListAdapterTests.m | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/Tests/IGListAdapterTests.m b/Tests/IGListAdapterTests.m index ee8eecd8..a08253d0 100644 --- a/Tests/IGListAdapterTests.m +++ b/Tests/IGListAdapterTests.m @@ -2144,41 +2144,6 @@ XCTAssertEqual(section1Objects[2], section1.sectionObject.objects[2]); } -- (void)test_whenSingleItemsAreInteractivelyReorderedAcrossSections_thatIndexesRevertToOriginalState { - IGListTestAdapterReorderingDataSource *dataSource = [IGListTestAdapterReorderingDataSource new]; - dataSource.objects = @[@0, @1]; - self.adapter.dataSource = dataSource; - self.adapter.moveDelegate = dataSource; - - NSArray *section0Objects = @[@0]; - NSArray *section1Objects = @[@3]; - - IGTestReorderableSection *section0 = (IGTestReorderableSection *)[self.adapter sectionControllerForSection:0]; - section0.sectionObject = [IGTestReorderableSectionObject sectionWithObjects:section0Objects]; - IGTestReorderableSection *section1 = (IGTestReorderableSection *)[self.adapter sectionControllerForSection:1]; - section1.sectionObject = [IGTestReorderableSectionObject sectionWithObjects:section1Objects]; - section1.isReorderable = YES; - - [self.adapter performUpdatesAnimated:NO completion:nil]; - - NSIndexPath *fromIndexPath, *toIndexPath; - - // move an item from section 1 to section 0 and check that they are reverted - fromIndexPath = [NSIndexPath indexPathForItem:0 inSection:1]; - toIndexPath = [NSIndexPath indexPathForItem:0 inSection:0]; - - [self.collectionView performBatchUpdates:^{ - [self.collectionView moveItemAtIndexPath:fromIndexPath toIndexPath:toIndexPath]; - - [self.collectionView.dataSource collectionView:self.collectionView - moveItemAtIndexPath:fromIndexPath - toIndexPath:toIndexPath]; - } completion:nil]; - - XCTAssertEqual(section0Objects[0], section0.sectionObject.objects[0]); - XCTAssertEqual(section1Objects[0], section1.sectionObject.objects[0]); -} - - (void)test_whenSingleItemInSectionIsInteractivelyReorderedThorughLastSpot_indexesUpdateCorrectly { IGListTestAdapterReorderingDataSource *dataSource = [IGListTestAdapterReorderingDataSource new]; dataSource.objects = @[@0, @1, @2];