From cf1db53da5f8e547bf2ea16182d4ac4e873f077d Mon Sep 17 00:00:00 2001 From: Zhisheng Huang Date: Thu, 12 Dec 2019 11:10:22 -0800 Subject: [PATCH] Fix some disabled unit tests Summary: The window frame needs to be big enough so that the cells are rendered fine with the bounds. Reviewed By: candance Differential Revision: D18949587 fbshipit-source-id: 1374bc3bab6892aafea5bbab9e8af3399e966344 --- Tests/IGListSingleNibItemControllerTests.m | 5 +++-- Tests/IGListSingleSectionControllerTests.m | 5 +++-- Tests/IGListSingleStoryboardItemControllerTests.m | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Tests/IGListSingleNibItemControllerTests.m b/Tests/IGListSingleNibItemControllerTests.m index 38974eb1..35a08d38 100644 --- a/Tests/IGListSingleNibItemControllerTests.m +++ b/Tests/IGListSingleNibItemControllerTests.m @@ -18,6 +18,7 @@ - (void)setUp { self.dataSource = [IGTestSingleNibItemDataSource new]; + self.frame = CGRectMake(0, 0, 100, 1000); [super setUp]; } @@ -33,7 +34,7 @@ XCTAssertEqual([self.collectionView numberOfItemsInSection:2], 1); } -- (void)DISABLED_test_whenDisplayingCollectionView_thatCellsAreConfigured { +- (void)test_whenDisplayingCollectionView_thatCellsAreConfigured { [self setupWithObjects:@[ genTestObject(@1, @"Foo"), genTestObject(@2, @"Bar"), @@ -47,7 +48,7 @@ XCTAssertEqualObjects(cell3.label.text, @"Baz"); } -- (void)DISABLED_test_whenDisplayingCollectionView_thatCellsAreSized { +- (void)test_whenDisplayingCollectionView_thatCellsAreSized { [self setupWithObjects:@[ genTestObject(@1, @"Foo"), genTestObject(@2, @"Bar"), diff --git a/Tests/IGListSingleSectionControllerTests.m b/Tests/IGListSingleSectionControllerTests.m index 68db8ce0..4b65dbfc 100644 --- a/Tests/IGListSingleSectionControllerTests.m +++ b/Tests/IGListSingleSectionControllerTests.m @@ -22,6 +22,7 @@ - (void)setUp { self.dataSource = [IGTestSingleItemDataSource new]; + self.frame = CGRectMake(0, 0, 100, 1000); [super setUp]; } @@ -37,7 +38,7 @@ XCTAssertEqual([self.collectionView numberOfItemsInSection:2], 1); } -- (void)DISABLED_test_whenDisplayingCollectionView_thatCellsAreConfigured { +- (void)test_whenDisplayingCollectionView_thatCellsAreConfigured { [self setupWithObjects:@[ genTestObject(@1, @"Foo"), genTestObject(@2, @"Bar"), @@ -51,7 +52,7 @@ XCTAssertEqualObjects(cell3.label.text, @"Baz"); } -- (void)DISABLED_test_whenDisplayingCollectionView_thatCellsAreSized { +- (void)test_whenDisplayingCollectionView_thatCellsAreSized { [self setupWithObjects:@[ genTestObject(@1, @"Foo"), genTestObject(@2, @"Bar"), diff --git a/Tests/IGListSingleStoryboardItemControllerTests.m b/Tests/IGListSingleStoryboardItemControllerTests.m index f1b4e27e..a630e578 100644 --- a/Tests/IGListSingleStoryboardItemControllerTests.m +++ b/Tests/IGListSingleStoryboardItemControllerTests.m @@ -29,7 +29,7 @@ - (void)setUp { [super setUp]; - self.window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; + self.window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 100, 1000)]; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"IGTestStoryboard" bundle:[NSBundle bundleForClass:self.class]]; self.viewController = [storyboard instantiateViewControllerWithIdentifier:@"testVC"]; [self.window addSubview:self.viewController.view]; @@ -67,7 +67,7 @@ XCTAssertEqual([self.collectionView numberOfItemsInSection:2], 1); } -- (void)DISABLED_test_whenDisplayingCollectionView_thatCellsAreConfigured { +- (void)test_whenDisplayingCollectionView_thatCellsAreConfigured { [self setupWithObjects:@[ genTestObject(@1, @"Foo"), genTestObject(@2, @"Bar"), @@ -81,7 +81,7 @@ XCTAssertEqualObjects(cell3.label.text, @"Baz"); } -- (void)DISABLED_test_whenDisplayingCollectionView_thatCellsAreSized { +- (void)test_whenDisplayingCollectionView_thatCellsAreSized { [self setupWithObjects:@[ genTestObject(@1, @"Foo"), genTestObject(@2, @"Bar"),