mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-05 22:48:21 +00:00
Add coverage for minium invalidated section in IGListCollectionViewLayout
Summary: Added a test to properly cover the `if (lastValidSection >= 0 && lastValidSection < sectionCount)` check in the `_calculateLayoutIfNeeded` pass inside `IGListCollectionViewLayout`. Reviewed By: fabiomassimo Differential Revision: D50000785 fbshipit-source-id: fe6b99f9592a1ae08299c599dadb03d7b8a958dc
This commit is contained in:
parent
a18565b8b2
commit
1c73ecb4e7
1 changed files with 24 additions and 0 deletions
|
|
@ -1248,6 +1248,30 @@ static const CGRect kTestFrame = (CGRect){{0, 0}, {100, 100}};
|
|||
IGAssertEqualFrame([self cellForSection:0 item:2].frame, 40, 0, 20, 20);
|
||||
}
|
||||
|
||||
- (void)test_whenMarkingASectionAsUpdated_thatLayoutUpdates {
|
||||
[self setUpWithStickyHeaders:NO topInset:0];
|
||||
[self prepareWithData:@[
|
||||
[[IGLayoutTestSection alloc] initWithInsets:UIEdgeInsetsZero
|
||||
lineSpacing:0
|
||||
interitemSpacing:0
|
||||
headerHeight:0
|
||||
footerHeight:0
|
||||
items:@[
|
||||
[[IGLayoutTestItem alloc] initWithSize:CGSizeMake(10, 10)],
|
||||
[[IGLayoutTestItem alloc] initWithSize:CGSizeMake(10, 10)],
|
||||
]],
|
||||
]];
|
||||
|
||||
IGAssertEqualFrame([self cellForSection:0 item:0].frame, 0, 0, 10, 10);
|
||||
IGAssertEqualFrame([self cellForSection:0 item:1].frame, 10, 0, 10, 10);
|
||||
|
||||
[self.layout didModifySection:1];
|
||||
[self.layout prepareLayout];
|
||||
|
||||
IGAssertEqualFrame([self cellForSection:0 item:0].frame, 0, 0, 10, 10);
|
||||
IGAssertEqualFrame([self cellForSection:0 item:1].frame, 10, 0, 10, 10);
|
||||
}
|
||||
|
||||
#pragma mark - Internal debugging
|
||||
|
||||
- (void)test_withDelegateNameDebugger_thatReturnedNamesAreValid {
|
||||
|
|
|
|||
Loading…
Reference in a new issue