Skip to content

Commit

Permalink
update the test
Browse files Browse the repository at this point in the history
  • Loading branch information
hadia committed May 7, 2021
1 parent 2cde23b commit 72ca831
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
10 changes: 0 additions & 10 deletions app/src/test/java/com/kickstarter/KSRobolectrictTestCase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ abstract class KSRobolectricTestCase : TestCase() {
return experimentsClientType
}

// private fun lakeTrackingClient(mockCurrentConfig: MockCurrentConfig, experimentsClientType: MockExperimentsClientType): MockTrackingClient {
// lakeTest = TestSubscriber()
// val lakeTrackingClient = MockTrackingClient(
// MockCurrentUser(),
// mockCurrentConfig, TrackingClientType.Type.LAKE, experimentsClientType
// )
// lakeTrackingClient.eventNames.subscribe(lakeTest)
// return lakeTrackingClient
// }

private fun segmentTrackingClient(mockCurrentConfig: MockCurrentConfig, experimentsClientType: MockExperimentsClientType): MockTrackingClient {
segmentTrack = TestSubscriber()
segmentIdentify = TestSubscriber()
Expand Down
12 changes: 8 additions & 4 deletions app/src/test/java/com/kickstarter/libs/PushNotificationsTest.kt
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
package com.kickstarter.libs

import android.app.Application
import androidx.test.core.app.ApplicationProvider
import android.content.Context
import com.kickstarter.KSRobolectricTestCase
import com.kickstarter.mock.factories.MessageThreadEnvelopeFactory
import com.kickstarter.mock.factories.PushNotificationEnvelopeFactory
import com.kickstarter.ui.IntentKey
import org.junit.Test

class PushNotificationsTest : KSRobolectricTestCase() {
private val application: Application = ApplicationProvider.getApplicationContext()
lateinit var context: Context

override fun setUp() {
super.setUp()
context = application()
}

@Test
fun messageThreadIntent() {
val envelope = PushNotificationEnvelopeFactory.envelope()
val messageThread = MessageThreadEnvelopeFactory.messageThreadEnvelope().messageThread()
val pushNotifications = PushNotifications(application, environment().apiClient())
val pushNotifications = PushNotifications(context, environment().apiClient())

messageThread?.let {
pushNotifications.messageThreadIntent(envelope, messageThread)
Expand Down

0 comments on commit 72ca831

Please sign in to comment.