Skip to content

Commit

Permalink
removed needless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrehan27 committed Oct 2, 2023
1 parent 161b9c2 commit ac17ffc
Showing 1 changed file with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.customer.messagingpush

import android.app.PendingIntent
import android.os.Bundle
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.google.firebase.messaging.RemoteMessage
Expand All @@ -15,7 +14,6 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.kotlin.mock
import org.robolectric.Shadows
import org.robolectric.annotation.Config

@RunWith(AndroidJUnit4::class)
internal class CustomerIOPushNotificationHandlerTest : BaseTest() {
Expand All @@ -39,32 +37,6 @@ internal class CustomerIOPushNotificationHandlerTest : BaseTest() {
)
}

@Test
@Config(sdk = [android.os.Build.VERSION_CODES.LOLLIPOP])
fun createIntentForNotificationClick_preAndroidM_shouldNotSetImmutableFlag() {
val actualPendingIntent = pushNotificationHandler.createIntentForNotificationClick(
context,
Int.random(1000, 9999),
pushNotificationPayload
)

val expectedIntentFlags = PendingIntent.FLAG_UPDATE_CURRENT
Shadows.shadowOf(actualPendingIntent).flags shouldBeEqualTo expectedIntentFlags
}

@Test
@Config(sdk = [android.os.Build.VERSION_CODES.TIRAMISU])
fun createIntentForNotificationClick_androidMOrHigher_shouldSetImmutableFlag() {
val actualPendingIntent = pushNotificationHandler.createIntentForNotificationClick(
context,
Int.random(1000, 9999),
pushNotificationPayload
)

val expectedIntentFlags = PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
Shadows.shadowOf(actualPendingIntent).flags shouldBeEqualTo expectedIntentFlags
}

@Test
fun createIntentForNotificationClick_validPayload_shouldStartDeepLinkedActivity() {
val actualPendingIntent = pushNotificationHandler.createIntentForNotificationClick(
Expand Down

0 comments on commit ac17ffc

Please sign in to comment.