Skip to content

Commit

Permalink
Fix failing cell sizing test with IGListCollectionViewLayout
Browse files Browse the repository at this point in the history
Summary:
This test started failing in Xcode 15. It looks like now, the default behaviour of `UICollectionView` is to not perform cell sizing until the next layout pass. As such, the sizing of the cells were invalid until `layoutIfNeeded` is first called.

Adding this line to the test brings it back to all of the expected values.

Differential Revision: D49906272

fbshipit-source-id: cc05cb2e105521b2576b2b2013d06e6285f4e8a4
  • Loading branch information
TimOliver authored and facebook-github-bot committed Oct 6, 2023
1 parent 51a3cb1 commit 749a65b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Tests/IGListBindingSectionControllerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ - (void)test_whenUpdatingManully_withInvalidateLayoutForUpdates_thatCellSizeUpda

XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
[self.adapter performUpdatesAnimated:YES completion:^(BOOL finished) {
[self.collectionView layoutIfNeeded];

IGTestCell *updatedCell00 = [self cellAtSection:0 item:0];
IGTestCell *updatedCell01 = [self cellAtSection:0 item:1];
IGTestCell *nochangedCell10 = [self cellAtSection:1 item:0];
Expand Down

0 comments on commit 749a65b

Please sign in to comment.