mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 11:45:19 +00:00
Revert "Resolve merge conflicts:"
This reverts commit3384cce51d, reversing changes made to69d18aae3c.
This commit is contained in:
@@ -6,7 +6,6 @@ import androidx.test.core.app.ApplicationProvider
|
||||
import com.bitchat.android.ui.NotificationManager
|
||||
import com.bitchat.android.util.NotificationIntervalManager
|
||||
import org.junit.Before
|
||||
import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mockito
|
||||
@@ -24,7 +23,10 @@ class NotificationManagerTest {
|
||||
private val context: Context = ApplicationProvider.getApplicationContext()
|
||||
private val notificationIntervalManager = NotificationIntervalManager()
|
||||
lateinit var notificationManager: NotificationManager
|
||||
private val notificationManagerCompat: NotificationManagerCompat = Mockito.mock(NotificationManagerCompat::class.java)
|
||||
|
||||
@Spy
|
||||
val notificationManagerCompat: NotificationManagerCompat =
|
||||
Mockito.spy(NotificationManagerCompat.from(context))
|
||||
|
||||
@Before
|
||||
fun setup() {
|
||||
@@ -36,7 +38,6 @@ class NotificationManagerTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Ignore // Temporarily disabled due to Mockito final class issues
|
||||
@Test
|
||||
fun `when there are no active peers, do not send active peer notification`() {
|
||||
notificationManager.setAppBackgroundState(true)
|
||||
@@ -44,7 +45,6 @@ class NotificationManagerTest {
|
||||
verify(notificationManagerCompat, never()).notify(any(), any())
|
||||
}
|
||||
|
||||
@Ignore // Temporarily disabled due to Mockito final class issues
|
||||
@Test
|
||||
fun `when app is in foreground, do not send active peer notification`() {
|
||||
notificationManager.setAppBackgroundState(false)
|
||||
@@ -52,7 +52,6 @@ class NotificationManagerTest {
|
||||
verify(notificationManagerCompat, never()).notify(any(), any())
|
||||
}
|
||||
|
||||
@Ignore // Temporarily disabled due to Mockito final class issues
|
||||
@Test
|
||||
fun `when there is an active peer, send notification`() {
|
||||
notificationManager.setAppBackgroundState(true)
|
||||
@@ -60,7 +59,6 @@ class NotificationManagerTest {
|
||||
verify(notificationManagerCompat, times(1)).notify(any(), any())
|
||||
}
|
||||
|
||||
@Ignore // Temporarily disabled due to Mockito final class issues
|
||||
@Test
|
||||
fun `when there is an active peer but less than 5 minutes have passed since last notification, do not send notification`() {
|
||||
notificationManager.setAppBackgroundState(true)
|
||||
@@ -69,7 +67,6 @@ class NotificationManagerTest {
|
||||
verify(notificationManagerCompat, times(1)).notify(any(), any())
|
||||
}
|
||||
|
||||
@Ignore // Temporarily disabled due to Mockito final class issues
|
||||
@Test
|
||||
fun `when there is an active peer and more than 5 minutes have passed since last notification, send notification`() {
|
||||
notificationManager.setAppBackgroundState(true)
|
||||
@@ -79,7 +76,6 @@ class NotificationManagerTest {
|
||||
verify(notificationManagerCompat, times(2)).notify(any(), any())
|
||||
}
|
||||
|
||||
@Ignore // Temporarily disabled due to Mockito final class issues
|
||||
@Test
|
||||
fun `when there is a recently seen peer but no new active peers, no notification is sent`() {
|
||||
notificationManager.setAppBackgroundState(true)
|
||||
@@ -88,7 +84,6 @@ class NotificationManagerTest {
|
||||
verify(notificationManagerCompat, times(0)).notify(any(), any())
|
||||
}
|
||||
|
||||
@Ignore // Temporarily disabled due to Mockito final class issues
|
||||
@Test
|
||||
fun `when an active peer is a recently seen peer, do not send notification`() {
|
||||
notificationManager.setAppBackgroundState(true)
|
||||
@@ -97,7 +92,6 @@ class NotificationManagerTest {
|
||||
verify(notificationManagerCompat, times(0)).notify(any(), any())
|
||||
}
|
||||
|
||||
@Ignore // Temporarily disabled due to Mockito final class issues
|
||||
@Test
|
||||
fun `when an active peer is a new peer, send notification`() {
|
||||
notificationManager.setAppBackgroundState(true)
|
||||
@@ -106,7 +100,6 @@ class NotificationManagerTest {
|
||||
verify(notificationManagerCompat, times(1)).notify(any(), any())
|
||||
}
|
||||
|
||||
@Ignore // Temporarily disabled due to Mockito final class issues
|
||||
@Test
|
||||
fun `when an active peer is a new peer and there are already multiple recently seen peers, send notification`() {
|
||||
notificationManager.setAppBackgroundState(true)
|
||||
|
||||
Reference in New Issue
Block a user