@@ -1385,12 +1385,13 @@ - (void)testContainerViewSizeForReusedRootComponentsAreSameAsCollectionViewSize
13851385 XCTAssertTrue (CGSizeEqualToSize (self.component .currentContainerViewSize , self.collectionView .bounds .size ));
13861386}
13871387
1388- - (void )testContainerViewSizeForChildComponentsAreParerentComponentsViewSize
1388+ - (void )testContainerViewSizeForChildComponentsAreParentComponentsViewSize
13891389{
13901390 NSString * const componentNamespace = @" childComponentSelection" ;
13911391 NSString * const componentName = @" component" ;
13921392 NSString * const childComponentName = @" componentB" ;
13931393 HUBComponentMock * const component = [HUBComponentMock new ];
1394+ component.preferredViewSize = CGSizeMake (200 , 200 );
13941395 HUBComponentMock * const childComponent = [HUBComponentMock new ];
13951396
13961397 HUBComponentFactoryMock * const componentFactory = [[HUBComponentFactoryMock alloc ] initWithComponents: @{
@@ -1417,17 +1418,16 @@ - (void)testContainerViewSizeForChildComponentsAreParerentComponentsViewSize
14171418 NSIndexPath * const indexPath = [NSIndexPath indexPathForItem: 0 inSection: 0 ];
14181419 [self .collectionView.dataSource collectionView: self .collectionView cellForItemAtIndexPath: indexPath];
14191420
1420- const CGRect expectedParentFrame = CGRectMake (0 , 0 , 88 , 88 );
1421- component.view .frame = expectedParentFrame;
1422-
14231421 id <HUBComponentChildDelegate> const childDelegate = component.childDelegate ;
14241422
14251423 id <HUBComponentModel> const childComponentModelA = [component.model childAtIndex: 0 ];
14261424 XCTAssertNotNil (childComponentModelA);
14271425
14281426 [childDelegate component: component childComponentForModel: childComponentModelA];
14291427
1430- XCTAssertTrue (CGSizeEqualToSize (childComponent.currentContainerViewSize , expectedParentFrame.size ));
1428+ CGSize const expectedContainerViewSize = [self .collectionView.collectionViewLayout layoutAttributesForItemAtIndexPath: indexPath].frame .size ;
1429+ XCTAssertTrue (CGSizeEqualToSize (expectedContainerViewSize, CGSizeMake (200 , 200 )));
1430+ XCTAssertTrue (CGSizeEqualToSize (childComponent.currentContainerViewSize , expectedContainerViewSize));
14311431}
14321432
14331433- (void )testCollectionViewNotAddedOnTopOfInitialOverlayComponent
0 commit comments