-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix double-load issue with ASCollectionNode #372
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// ASCollectionViewTests.m | ||
// ASCollectionViewTests.mm | ||
// Texture | ||
// | ||
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
|
@@ -259,7 +259,8 @@ - (void)testSelection | |
[window setRootViewController:testController]; | ||
[window makeKeyAndVisible]; | ||
|
||
[testController.collectionView reloadDataImmediately]; | ||
[testController.collectionNode reloadData]; | ||
[testController.collectionNode waitUntilAllUpdatesAreCommitted]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No because it's deprecated. |
||
[testController.collectionView layoutIfNeeded]; | ||
|
||
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:0 inSection:0]; | ||
|
@@ -390,12 +391,13 @@ - (void)testThatCollectionNodeConformsToExpectedProtocols | |
ASCollectionViewTestController *testController = [[ASCollectionViewTestController alloc] initWithNibName:nil bundle:nil];\ | ||
__unused ASCollectionViewTestDelegate *del = testController.asyncDelegate;\ | ||
__unused ASCollectionView *cv = testController.collectionView;\ | ||
__unused ASCollectionNode *cn = testController.collectionNode;\ | ||
ASCollectionNode *cn = testController.collectionNode;\ | ||
UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];\ | ||
[window makeKeyAndVisible]; \ | ||
window.rootViewController = testController;\ | ||
\ | ||
[testController.collectionView reloadDataImmediately];\ | ||
[cn reloadData];\ | ||
[cn waitUntilAllUpdatesAreCommitted]; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No because it's deprecated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it 👍 |
||
[testController.collectionView layoutIfNeeded]; | ||
|
||
- (void)testThatSubmittingAValidInsertDoesNotThrowAnException | ||
|
@@ -620,7 +622,7 @@ - (void)testThatDisappearingSupplementariesWithLayerBackedNodesDontFailAssert | |
for (NSInteger i = 0; i < 2; i++) { | ||
// NOTE: waitUntilAllUpdatesAreCommitted or reloadDataImmediately is not sufficient here!! | ||
XCTestExpectation *done = [self expectationWithDescription:[NSString stringWithFormat:@"Reload #%td complete", i]]; | ||
[cv reloadDataWithCompletion:^{ | ||
[cn reloadDataWithCompletion:^{ | ||
[done fulfill]; | ||
}]; | ||
[self waitForExpectationsWithTimeout:1 handler:nil]; | ||
|
@@ -752,7 +754,8 @@ - (void)testThatSectionContextsAreCorrectAfterReloadData | |
updateValidationTestPrologue | ||
|
||
del.sectionGeneration++; | ||
[cv reloadDataImmediately]; | ||
[cn reloadData]; | ||
[cn waitUntilAllUpdatesAreCommitted]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No because it's deprecated. |
||
|
||
NSInteger sectionCount = del->_itemCounts.size(); | ||
for (NSInteger section = 0; section < sectionCount; section++) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation copied from
ASCollectionView
.