You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The tests ensure calling preventDefault twice work when called in different threads
* And a followup call to display does not display the notification
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/notifications/src/test/java/com/onesignal/notifications/internal/generation/NotificationGenerationProcessorTests.kt
+63-9Lines changed: 63 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,9 @@ import io.mockk.every
21
21
importio.mockk.just
22
22
importio.mockk.mockk
23
23
importio.mockk.runs
24
+
importkotlinx.coroutines.GlobalScope
24
25
importkotlinx.coroutines.delay
26
+
importkotlinx.coroutines.launch
25
27
importkotlinx.coroutines.withTimeout
26
28
importorg.json.JSONObject
27
29
importorg.robolectric.annotation.Config
@@ -66,15 +68,16 @@ private class Mocks {
66
68
mockNotificationRepository
67
69
}
68
70
69
-
val notificationGenerationProcessor =NotificationGenerationProcessor(
70
-
applicationService,
71
-
notificationDisplayer,
72
-
MockHelper.configModelStore(),
73
-
notificationRepository,
74
-
mockk(),
75
-
notificationLifecycleService,
76
-
MockHelper.time(1111),
77
-
)
71
+
val notificationGenerationProcessor =
72
+
NotificationGenerationProcessor(
73
+
applicationService,
74
+
notificationDisplayer,
75
+
MockHelper.configModelStore(),
76
+
notificationRepository,
77
+
mockk(),
78
+
notificationLifecycleService,
79
+
MockHelper.time(1111),
80
+
)
78
81
79
82
val notificationPayload:JSONObject=
80
83
JSONObject()
@@ -269,4 +272,55 @@ class NotificationGenerationProcessorTests : FunSpec({
0 commit comments