@@ -1299,4 +1299,63 @@ - (void)DISABLED_testThatAutomaticallyManagedSubnodesGetPreloadCallBeforeDisplay
12991299
13001300}
13011301
1302+ - (void )testAllPendingStatePropertiesTransferredToView {
1303+ // Create node without loading view
1304+ UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc ] init ];
1305+ ASCollectionNode *node = [[ASCollectionNode alloc ] initWithFrame: CGRectZero
1306+ collectionViewLayout: layout];
1307+
1308+ XCTAssertFalse (node.isNodeLoaded , @" View should not be loaded before setting properties" );
1309+
1310+ // Set pending state properties before view loads
1311+ node.leadingScreensForBatching = 3.6 ;
1312+ node.inverted = YES ;
1313+ node.allowsMultipleSelection = YES ;
1314+ node.alwaysBounceVertical = YES ;
1315+ node.alwaysBounceHorizontal = YES ;
1316+ node.pagingEnabled = YES ;
1317+ node.showsVerticalScrollIndicator = NO ;
1318+ node.showsHorizontalScrollIndicator = NO ;
1319+ UIEdgeInsets testInsets = UIEdgeInsetsMake (10 , 20 , 30 , 40 );
1320+ node.contentInset = testInsets;
1321+ CGPoint testOffset = CGPointMake (50 , 60 );
1322+ node.contentOffset = testOffset;
1323+ ASCollectionViewTestDelegate *delegate = [[ASCollectionViewTestDelegate alloc ] initWithNumberOfSections: 10 numberOfItemsInSection: 10 ];
1324+ node.delegate = delegate;
1325+ ASCollectionViewTestDelegate *dataSource = [[ASCollectionViewTestDelegate alloc ] initWithNumberOfSections: 20 numberOfItemsInSection: 20 ];
1326+ node.dataSource = dataSource;
1327+
1328+
1329+ // Load the view (triggers pending state transfer)
1330+ ASCollectionView *view = node.view ;
1331+
1332+ XCTAssertTrue (node.isNodeLoaded , @" View should be loaded after accessing node.view" );
1333+
1334+ // Verify properties were transferred correctly
1335+ XCTAssertEqual (view.leadingScreensForBatching , 3.6 ,
1336+ @" leadingScreensForBatching should transfer from pending state" );
1337+ XCTAssertEqual (view.inverted , YES ,
1338+ @" inverted should transfer from pending state" );
1339+ XCTAssertEqual (view.allowsMultipleSelection , YES ,
1340+ @" allowsMultipleSelection should transfer from pending state" );
1341+ XCTAssertEqual (view.alwaysBounceVertical , YES ,
1342+ @" alwaysBounceVertical should transfer from pending state" );
1343+ XCTAssertEqual (view.alwaysBounceHorizontal , YES ,
1344+ @" alwaysBounceHorizontal should transfer from pending state" );
1345+ XCTAssertTrue (UIEdgeInsetsEqualToEdgeInsets (view.contentInset , testInsets),
1346+ @" contentInset should transfer from pending state" );
1347+ XCTAssertTrue (CGPointEqualToPoint (view.contentOffset , testOffset),
1348+ @" contentOffset should transfer from pending state" );
1349+ XCTAssertEqual (view.showsVerticalScrollIndicator , NO ,
1350+ @" showsVerticalScrollIndicator should transfer from pending state" );
1351+ XCTAssertEqual (view.showsHorizontalScrollIndicator , NO ,
1352+ @" showsHorizontalScrollIndicator should transfer from pending state" );
1353+ XCTAssertEqual (view.pagingEnabled , YES ,
1354+ @" pagingEnabled should transfer from pending state" );
1355+ XCTAssertEqual (view.asyncDelegate , delegate,
1356+ @" delegate should transfer from pending state" );
1357+ XCTAssertEqual (view.asyncDataSource , dataSource,
1358+ @" dataSource should transfer from pending state" );
1359+ }
1360+
13021361@end
0 commit comments