Use mock log files for the BugReportScreenViewModelTests. (#4257)

The array could be empty if a previous test deleted the logs.
This commit is contained in:
Doug
2025-06-26 12:36:13 +01:00
committed by GitHub
parent 4b05a6194c
commit 373fa205ba
2 changed files with 14 additions and 4 deletions
@@ -14,7 +14,7 @@ class BugReportScreenViewModel: BugReportScreenViewModelType, BugReportScreenVie
private let bugReportService: BugReportServiceProtocol
private let clientProxy: ClientProxyProtocol?
private let logFiles = Tracing.logFiles
private let logFiles: [URL]
private let actionsSubject: PassthroughSubject<BugReportScreenViewModelAction, Never> = .init()
// periphery:ignore - when set to nil this is automatically cancelled
@@ -26,10 +26,12 @@ class BugReportScreenViewModel: BugReportScreenViewModelType, BugReportScreenVie
init(bugReportService: BugReportServiceProtocol,
clientProxy: ClientProxyProtocol?,
logFiles: [URL] = Tracing.logFiles,
screenshot: UIImage?,
isModallyPresented: Bool) {
self.bugReportService = bugReportService
self.clientProxy = clientProxy
self.logFiles = logFiles
let canSendLogFiles = Self.validate(logFiles)
let bindings = BugReportScreenViewStateBindings(reportText: "", sendingLogsEnabled: canSendLogFiles, canContact: false)