test: add mac coverage helpers

This commit is contained in:
Peter Steinberger
2025-12-24 19:29:44 +01:00
parent f44014ff00
commit 204bd7d2c4
11 changed files with 632 additions and 71 deletions

View File

@@ -204,3 +204,25 @@ final class MenuContextCardInjector: NSObject, NSMenuDelegate {
self.lastKnownMenuWidth = max(300, targetWidth)
}
}
#if DEBUG
extension MenuContextCardInjector {
func _testSetCache(rows: [SessionRow], errorText: String?, updatedAt: Date?) {
self.cachedRows = rows
self.cacheErrorText = errorText
self.cacheUpdatedAt = updatedAt
}
func _testFindInsertIndex(in menu: NSMenu) -> Int? {
self.findInsertIndex(in: menu)
}
func _testInitialCardWidth(for menu: NSMenu) -> CGFloat {
self.initialCardWidth(for: menu)
}
func _testCachedView() -> AnyView {
self.cachedView()
}
}
#endif