Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahroz16 committed Feb 12, 2025
1 parent 21364bc commit 7b4ecc7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import io.customer.datapipelines.testutils.utils.screenEvents
import io.customer.datapipelines.testutils.utils.trackEvents
import io.customer.sdk.core.di.SDKComponent
import io.customer.sdk.data.model.CustomAttributes
import io.customer.sdk.data.model.Settings
import io.customer.sdk.data.store.DeviceStore
import io.customer.sdk.data.store.GlobalPreferenceStore
import io.customer.sdk.util.EventNames
Expand Down Expand Up @@ -593,6 +594,11 @@ class DataPipelinesInteractionTests : JUnitTest() {
deviceRegisterEvent.context.deviceToken shouldBeEqualTo givenToken
}

@Test
fun device_givenSDKInitialized_expectSettingsToBeStored() {
assertCalledOnce { globalPreferenceStore.saveSettings(Settings(writeKey = analytics.configuration.writeKey, apiHost = analytics.configuration.apiHost)) }
}

@Test
fun device_givenRegisterTokenWhenNoProfileIdentified_expectStoreAndRegisterDeviceForAnonymousProfile() {
val givenToken = String.random
Expand Down

0 comments on commit 7b4ecc7

Please sign in to comment.