Skip to content

Commit a216b18

Browse files
authored
Merge pull request #1 from CombineCommunity/master
Update
2 parents 7572103 + e44ee15 commit a216b18

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Tests/CombineDataSourcesTests/CollectionView/CollectionViewItemsControllerTests.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,20 @@ final class CollectionViewItemsControllerTests: XCTestCase {
4242
// Configure the controller
4343
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout())
4444
collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "Cell")
45-
45+
collectionView.register(UICollectionReusableView.self, forSupplementaryViewOfKind: "supplementary-kind", withReuseIdentifier: "supplementaryview")
46+
47+
ctr.configureSupplementaryView = { _, collection, kind, index, section -> UICollectionReusableView in
48+
return collection.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "supplementaryview", for: index)
49+
}
50+
4651
ctr.collectionView = collectionView
4752
ctr.updateCollection(dataSet2)
4853

4954
XCTAssertNil(lastModel)
5055
let cell = ctr.collectionView(collectionView, cellForItemAt: IndexPath(row: 0, section: 0))
56+
let supplementaryView = ctr.collectionView(collectionView, viewForSupplementaryElementOfKind: "supplementary-kind", at: IndexPath(row: 0, section: 0))
5157
XCTAssertNotNil(cell)
58+
XCTAssertNotNil(supplementaryView)
5259
XCTAssertEqual("test model", lastModel?.text)
5360
}
5461
}

0 commit comments

Comments
 (0)