Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanPodymov committed Dec 20, 2023
1 parent c89bf2e commit 68cffef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Sources/CommonAppleKit/CAListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

open class CAListView<Cell: CAListViewCell<CellRootView>, CellRootView, CellDataType: Any>: CACollectionView, CACollectionViewDataSource, CACollectionViewDelegate {
open class CAListView<Cell: CAListViewCell<CellRootView>, CellRootView, CellDataType>: CACollectionView, CACollectionViewDataSource, CACollectionViewDelegate {
private let cellId: String
private weak var cellDelegate: CAListViewCellDelegate?

Expand Down
4 changes: 2 additions & 2 deletions Sources/CommonAppleKit/CAScrollableListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation

#if canImport(AppKit)
open class CAScrollableListView<Cell: CAListViewCell<CellRootView>, CellRootView, CellDataType: Any>: CAScrollView {
open class CAScrollableListView<Cell: CAListViewCell<CellRootView>, CellRootView, CellDataType>: CAScrollView {
public var content: [CellDataType] = [] {
didSet {
(documentView as? CAListView<Cell, CellRootView, CellDataType>)?.content = content
Expand All @@ -27,5 +27,5 @@ open class CAScrollableListView<Cell: CAListViewCell<CellRootView>, CellRootView
}
}
#elseif canImport(UIKit)
public typealias CAScrollableListView<Cell: CAListViewCell<CellRootView>, CellRootView, CellDataType: Any> = CAListView<Cell, CellRootView, CellDataType>
public typealias CAScrollableListView<Cell: CAListViewCell<CellRootView>, CellRootView, CellDataType> = CAListView<Cell, CellRootView, CellDataType>
#endif
6 changes: 3 additions & 3 deletions Tests/CommonAppleKitTests/CommonAppleKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ final class CommonAppleKitTests: XCTestCase {
}

func testListView() {
let listView = CAListView<CellA, CellARootView>(frame: .init(x: 0, y: 0, width: 300, height: 500), itemSize: .init(width: 200, height: 100), cellId: "id", cellDelegate: self)
let listView = CAListView<CellA, CellARootView, String>(frame: .init(x: 0, y: 0, width: 300, height: 500), itemSize: .init(width: 200, height: 100), cellId: "id", cellDelegate: self)
listView.content = ["one", "two"]
}

func testScrollableListView() {
let listView = CAScrollableListView<CellA, CellARootView>(frame: .zero, itemSize: .init(width: 200, height: 100))
listView.content = []
let listView = CAScrollableListView<CellA, CellARootView, Int>(frame: .zero, itemSize: .init(width: 200, height: 100))
listView.content = [1, 2]
}
}

Expand Down

0 comments on commit 68cffef

Please sign in to comment.