Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanPodymov committed Dec 13, 2023
1 parent 0dde595 commit 1f1d204
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Sources/CommonAppleKit/CAListViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ open class CAListViewCell<RootView: CAView>: CACollectionViewCell {

#if canImport(AppKit)
open override func loadView() {
view = createRootView()
rootView = view
let rootView = createRootView()
view = rootView
self.rootView = rootView
}
#elseif canImport(UIKit)
open var representedObject: Any?
Expand Down
8 changes: 5 additions & 3 deletions Tests/CommonAppleKitTests/CommonAppleKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ private final class ControllerA: CAViewController { }

private final class ControllerB: CAViewController { }

private final class CellA: CAListViewCell { }
private final class CellA: CAListViewCell<CellARootView> { }

private final class CellARootView: CAView { }

private final class ViewA: CAView {
override init(frame: CARect) {
Expand Down Expand Up @@ -82,12 +84,12 @@ final class CommonAppleKitTests: XCTestCase {
}

func testListView() {
let listView = CAListView<CellA>(frame: .zero, itemSize: .init(width: 200, height: 100), cellId: "id")
let listView = CAListView<CellA, CellARootView>(frame: .zero, itemSize: .init(width: 200, height: 100), cellId: "id")
listView.content = []
}

func testScrollableListView() {
let listView = CAScrollableListView<CellA>(frame: .zero, itemSize: .init(width: 200, height: 100), cellId: "id")
let listView = CAScrollableListView<CellA, CellARootView>(frame: .zero, itemSize: .init(width: 200, height: 100), cellId: "id")
listView.content = []
}
}
Expand Down

0 comments on commit 1f1d204

Please sign in to comment.