fix(test): pass accountRepository to DiagnosticsCollector in ProblemReportsScreenTest

Rebase collision with the accountRepository param added to DiagnosticsCollector's
constructor broke :app:compileDebugAndroidTestKotlin. Mirrors the #245
CrashReporterInstallTest fix: mock AccountRepository.observeAccounts() to an empty flow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 20:47:16 -05:00
co-authored by Claude Opus 4.8
parent 049c11f5f0
commit f98425667d
@@ -10,6 +10,9 @@ import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.flow.flowOf
import org.junit.After
import org.junit.Before
import org.junit.Rule
@@ -17,6 +20,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.libremail.R
import org.libremail.data.settings.SettingsRepository
import org.libremail.domain.repository.AccountRepository
import org.libremail.reporting.AppVersionProvider
import org.libremail.reporting.DebugReport
import org.libremail.reporting.DiagnosticsCollector
@@ -75,6 +79,7 @@ class ProblemReportsScreenTest {
val collector = DiagnosticsCollector(
AppVersionProvider(context),
SettingsRepository(context),
mockk<AccountRepository> { every { observeAccounts() } returns flowOf(emptyList()) },
RingLogBuffer(),
)
val viewModel = ProblemReportsViewModel(store, collector)