Skip to content

Commit

Permalink
Remove unneeded interactive reordering test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
TimOliver authored and facebook-github-bot committed Oct 5, 2023
1 parent 46e0372 commit 97570b4
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions Tests/IGListAdapterTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -2144,41 +2144,6 @@ - (void)test_whenItemsAreInteractivelyReorderedAcrossSections_thatIndexesRevertT
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];
Expand Down

0 comments on commit 97570b4

Please sign in to comment.