Skip to content

Commit babd4e6

Browse files
committed
fix(test): provide notification icon provider mocks
1 parent f52213f commit babd4e6

4 files changed

Lines changed: 24 additions & 49 deletions

File tree

feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/PushIconTestNotification.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import net.thunderbird.feature.notification.api.ui.icon.NotificationIcon
88

99
class PushIconTestNotification(
1010
pushIcon: Int,
11+
override val accountUuid: String? = null,
1112
) : AppNotification(), SystemNotification {
1213
override val title: String = "Push Icon Test"
1314
override val contentText: String = "Verifying NotificationIconResourceProvider"

gradle/libs.versions.toml

Lines changed: 14 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -14,79 +14,56 @@
1414
androidBilling = "7.1.1"
1515
androidDesugar = "2.1.5"
1616
androidMaterial = "1.12.0"
17-
<<<<<<< HEAD
1817
# AGP and tools should be updated together.
1918
# Also, make sure AGP version is compatible with both AS and IntelliJ IDEA.
2019
androidGradlePlugin = "8.12.3"
2120
androidTools = "31.11.1"
22-
=======
23-
# AGP and tools should be updated together
24-
androidGradlePlugin = "8.10.1"
25-
androidTools = "31.10.1"
26-
>>>>>>> 46746d706b (Revert unecessary changes to fix #8932)
2721
androidxActivity = "1.10.1"
2822
androidxAnnotation = "1.9.1"
2923
androidxAppCompat = "1.7.1"
3024
androidxAutofill = "1.3.0"
3125
androidxBiometric = "1.1.0"
3226
androidxCamera = "1.4.2"
3327
# https://developer.android.com/jetpack/compose/bom/bom-mapping
34-
androidxComposeBom = "2025.06.00"
28+
androidxComposeBom = "2025.07.00"
3529
androidxConstraintLayout = "2.2.1"
3630
androidxCoordinatorLayout = "1.3.0"
3731
androidxCore = "1.16.0"
3832
androidxCoreSplashscreen = "1.0.1"
33+
androidxDatastore = "1.1.7"
3934
androidxFragment = "1.8.8"
4035
androidxGlance = "1.1.1"
4136
androidxGlanceMaterial3 = "1.1.1"
42-
androidxLifecycle = "2.9.1"
37+
androidxLifecycle = "2.9.2"
4338
androidxLocalBroadcastManager = "1.1.0"
44-
androidxNavigation = "2.9.0"
39+
androidxNavigation = "2.9.3"
4540
androidxRecyclerView = "1.4.0"
4641
androidxPreference = "1.2.1"
4742
androidxSwiperefreshlayout = "1.1.0"
48-
androidxTestCore = "1.6.1"
49-
androidxTestEspresso = "3.6.1"
50-
androidxTestExt = "1.2.1"
51-
androidxTestRules = "1.6.1"
52-
androidxTestRunner = "1.6.2"
43+
androidxTestCore = "1.7.0"
44+
androidxTestEspresso = "3.7.0"
45+
androidxTestExt = "1.3.0"
46+
androidxTestRules = "1.7.0"
47+
androidxTestRunner = "1.7.0"
5348
androidxWebkit = "1.14.0"
54-
<<<<<<< HEAD
5549
androidxWork = "2.10.3"
5650
apacheHttpclient5 = "5.5.1"
57-
=======
58-
androidxWork = "2.10.1"
59-
apacheHttpclient5 = "5.4.4"
60-
>>>>>>> 46746d706b (Revert unecessary changes to fix #8932)
6151
appAuth = "0.11.1"
6252
assertk = "0.28.1"
6353
circleImageView = "3.1.0"
6454
ckchangelog = "2.0.0-beta02"
6555
clikt = "5.0.3"
66-
<<<<<<< HEAD
6756
commonsIo = "2.20.0"
6857
dependencyCheckPlugin = "0.53.0"
69-
=======
70-
commonsIo = "2.19.0"
71-
dependencyCheckPlugin = "0.52.0"
72-
>>>>>>> 46746d706b (Revert unecessary changes to fix #8932)
7358
dependencyGuardPlugin = "0.5.0"
7459
detektPlugin = "1.23.8"
7560
detektPluginCompose = "0.4.27"
7661
fastAdapter = "5.7.0"
77-
<<<<<<< HEAD
7862
forkhandlesBom = "2.23.0.0"
7963
glide = "4.16.0"
8064
gradle = "9.1.0"
8165
icu4j = "77.1"
8266
javaDiffUtils = "4.16"
83-
=======
84-
forkhandlesBom = "2.22.3.0"
85-
glide = "4.16.0"
86-
gradle = "8.14.2"
87-
icu4j = "72.1"
88-
javaDiffUtils = "4.12"
89-
>>>>>>> 46746d706b (Revert unecessary changes to fix #8932)
9067
jcipAnnotations = "1.0"
9168
jetbrainsAnnotations = "26.0.2-1"
9269
jetbrainsCompose = "1.9.0"
@@ -106,13 +83,12 @@ kotlinGradleBom = "2.2.0"
10683
kotlinKsp = "2.3.0"
10784
kotlinxCoroutines = "1.10.2"
10885
kotlinxCollectionsImmutable = "0.4.0"
109-
kotlinxDateTime = "0.7.0"
110-
kotlinxIoCore = "0.7.0"
111-
kotlinxSerialization = "1.8.1"
86+
kotlinxDateTime = "0.7.1"
87+
kotlinxIoCore = "0.8.0"
88+
kotlinxSerialization = "1.9.0"
11289
ktlint = "1.5.0"
11390
ktor = "3.3.1"
11491
kxml2 = "1.0"
115-
<<<<<<< HEAD
11692
landscapist = "2.6.1"
11793
leakcanary = "2.14"
11894
logbackClassic = "1.5.20"
@@ -121,22 +97,11 @@ minidns = "1.1.1"
12197
mockito = "5.20.0"
12298
mockitoKotlin = "6.1.0"
12399
mokkery = "2.10.2"
124-
=======
125-
landscapist = "2.5.0"
126-
leakcanary = "2.13"
127-
logbackClassic = "1.5.18"
128-
mime4j = "0.8.12"
129-
minidns = "1.0.5"
130-
mockito = "5.18.0"
131-
mockitoKotlin = "6.0.0"
132-
mokkery = "2.10.0"
133-
>>>>>>> 46746d706b (Revert unecessary changes to fix #8932)
134100
moshi = "1.15.2"
135101
mozillaAndroidComponents = "144.0.2"
136102
okhttp = "5.2.1"
137103
okio = "3.16.2"
138104
preferencesFix = "1.1.0"
139-
<<<<<<< HEAD
140105
robolectric = "4.16"
141106
safeContentResolver = "1.0.0"
142107
searchPreference = "2.7.3"
@@ -202,6 +167,8 @@ androidx-coordinatorlayout = { module = "androidx.coordinatorlayout:coordinatorl
202167
androidx-core = { module = "androidx.core:core", version.ref = "androidxCore" }
203168
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidxCore" }
204169
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidxCoreSplashscreen" }
170+
androidx-datastore = { module = "androidx.datastore:datastore", version.ref = "androidxDatastore" }
171+
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "androidxDatastore" }
205172
androidx-fragment = { module = "androidx.fragment:fragment", version.ref = "androidxFragment" }
206173
androidx-fragment-compose = { module = "androidx.fragment:fragment-compose", version.ref = "androidxFragment" }
207174
androidx-fragment-testing = { module = "androidx.fragment:fragment-testing", version.ref = "androidxFragment" }
@@ -227,7 +194,6 @@ androidx-preference = { module = "androidx.preference:preference", version.ref =
227194
androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidxRecyclerView" }
228195
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "androidxSwiperefreshlayout" }
229196
androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTestCore" }
230-
androidx-test-core-ktx = { module = "androidx.test:core-ktx", version.ref = "androidxTestCore" }
231197
androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidxTestEspresso" }
232198
androidx-test-ext-junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "androidxTestExt" }
233199
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTestRules" }
@@ -318,7 +284,6 @@ uri = { module = "com.eygraber:uri-kmp", version.ref = "uri" }
318284
xmlpull = { module = "com.github.cketti:xmlpull-extracted-from-android", version.ref = "xmlpull" }
319285
zxing = { module = "com.google.zxing:core", version.ref = "zxing" }
320286

321-
322287
[bundles]
323288
shared-kmp-common = [
324289
"koin-core",

legacy/core/src/test/java/com/fsck/k9/TestApp.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.fsck.k9
22

33
import android.app.Application
44
import androidx.work.WorkManager
5+
import app.k9mail.core.android.common.provider.NotificationIconResourceProvider
56
import app.k9mail.feature.telemetry.telemetryModule
67
import app.k9mail.legacy.di.DI
78
import com.fsck.k9.backend.BackendManager
@@ -10,6 +11,7 @@ import com.fsck.k9.crypto.EncryptionExtractor
1011
import com.fsck.k9.notification.NotificationActionCreator
1112
import com.fsck.k9.notification.NotificationResourceProvider
1213
import com.fsck.k9.notification.NotificationStrategy
14+
import com.fsck.k9.notification.TestNotificationIconResourceProvider
1315
import com.fsck.k9.storage.storageModule
1416
import net.thunderbird.core.android.account.AccountDefaultsProvider
1517
import net.thunderbird.core.android.account.LegacyAccountManager
@@ -93,4 +95,5 @@ val testModule = module {
9395
}
9496
single<OutboxFolderManager> { FakeOutboxFolderManager() }
9597
single<LegacyAccountManager> { mock() }
98+
single<NotificationIconResourceProvider> { TestNotificationIconResourceProvider() }
9699
}

legacy/storage/src/test/java/com/fsck/k9/storage/TestApp.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.fsck.k9.storage
22

33
import android.app.Application
4+
import app.k9mail.core.android.common.provider.NotificationIconResourceProvider
45
import app.k9mail.feature.telemetry.telemetryModule
56
import app.k9mail.legacy.di.DI
67
import com.fsck.k9.AppConfig
@@ -83,4 +84,9 @@ val testModule = module {
8384
)
8485
}
8586
single<LegacyAccountManager> { mock() }
87+
single<NotificationIconResourceProvider> {
88+
object : NotificationIconResourceProvider {
89+
override val pushNotificationIcon: Int = 0
90+
}
91+
}
8692
}

0 commit comments

Comments
 (0)