Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit c0950e0

Browse files
author
Adlai Holler
authored
Fix test failure caused by collection views lingering (#2935)
1 parent 79f3aa5 commit c0950e0

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

AsyncDisplayKitTests/ASCollectionViewTests.mm

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,18 @@ @interface ASCollectionViewTests : XCTestCase
174174

175175
@implementation ASCollectionViewTests
176176

177+
- (void)tearDown
178+
{
179+
// We can't prevent the system from retaining windows, but we can at least clear them out to avoid
180+
// pollution between test cases.
181+
for (UIWindow *window in [UIApplication sharedApplication].windows) {
182+
for (UIView *subview in window.subviews) {
183+
[subview removeFromSuperview];
184+
}
185+
}
186+
[super tearDown];
187+
}
188+
177189
- (void)testDataSourceImplementsNecessaryMethods
178190
{
179191
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
@@ -901,7 +913,7 @@ - (void)testThatBatchFetchHappensForEmptyCollection
901913
[self waitForExpectationsWithTimeout:3 handler:nil];
902914
}
903915

904-
- (void)DISABLED_testThatWeBatchFetchUntilContentRequirementIsMet_Animated
916+
- (void)testThatWeBatchFetchUntilContentRequirementIsMet_Animated
905917
{
906918
[self _primitiveBatchFetchingFillTestAnimated:YES visible:YES controller:nil];
907919
}

0 commit comments

Comments
 (0)