Skip to content

Commit

Permalink
fix: formatting and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Jan 6, 2025
1 parent 4a1a7c0 commit da82f62
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ fun extractTestKeysPropertiesToJson(testKeys: TestKeys): Map<String, Map<String,
"upload" to summary.upload,
"download" to summary.download,
).filter { it.value != null }
}
},
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import ooniprobe.composeapp.generated.resources.TestResults_Overview_InstantMess
import ooniprobe.composeapp.generated.resources.TestResults_Overview_InstantMessaging_Blocked
import ooniprobe.composeapp.generated.resources.TestResults_Overview_Websites_Blocked
import ooniprobe.composeapp.generated.resources.TestResults_Overview_Websites_Tested
import ooniprobe.composeapp.generated.resources.TestResults_Summary_Performance_Hero_Download
import ooniprobe.composeapp.generated.resources.TestResults_Summary_Performance_Hero_Upload
import ooniprobe.composeapp.generated.resources.TestResults_UnknownASN
import ooniprobe.composeapp.generated.resources.ic_cloud_off
import ooniprobe.composeapp.generated.resources.ic_download
Expand Down Expand Up @@ -309,7 +307,7 @@ private fun PerformanceMetric(
icon: DrawableResource,
text: String?,
color: Color = LocalContentColor.current,
) {
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(bottom = 2.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ import kotlin.test.assertNotNull

class MeasurementRepositoryTest {
private lateinit var subject: MeasurementRepository
private val json = Dependencies.buildJson()

@BeforeTest
fun before() {
subject =
MeasurementRepository(
database = Dependencies.buildDatabase(::createTestDatabaseDriver),
backgroundContext = Dispatchers.Default,
json = json,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ import kotlin.test.assertNotNull
class ResultRepositoryTest {
private lateinit var subject: ResultRepository
private lateinit var measurementRepository: MeasurementRepository
private val json = Dependencies.buildJson()

@BeforeTest
fun before() {
val database = Dependencies.buildDatabase(::createTestDatabaseDriver)
subject = ResultRepository(database, Dispatchers.Default)
measurementRepository = MeasurementRepository(database, Dispatchers.Default)
measurementRepository = MeasurementRepository(database = database, backgroundContext = Dispatchers.Default, json = json)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,6 @@ class ResultsScreenTest {
),
allMeasurementsUploaded = true,
anyMeasurementUploadFailed = false,
testKeys = emptyList(),
)
}

0 comments on commit da82f62

Please sign in to comment.