Skip to content

Commit

Permalink
feat(capture-sdk): Fix camera screen analytics events
Browse files Browse the repository at this point in the history
PP-439
  • Loading branch information
ndubkov-distcotech committed Jun 12, 2024
1 parent 3b88a8b commit fa40082
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ public void onExtractionsAvailable(
private CameraInterface mCameraController;
private ImageMultiPageDocument mMultiPageDocument;
private PaymentQRCodeReader mPaymentQRCodeReader;
private UserAnalyticsEventTracker mUserAnalyticsEventTracker;

@VisibleForTesting
UserAnalyticsEventTracker mUserAnalyticsEventTracker;


private ConstraintLayout mLayoutRoot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import androidx.constraintlayout.widget.ConstraintLayout
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.nhaarman.mockitokotlin2.*
import io.mockk.every
import io.mockk.mockk
Expand All @@ -19,6 +21,7 @@ import net.gini.android.capture.internal.util.CancelListener
import net.gini.android.capture.tracking.CameraScreenEvent
import net.gini.android.capture.tracking.Event
import net.gini.android.capture.tracking.EventTracker
import net.gini.android.capture.tracking.useranalytics.UserAnalyticsEventTracker
import org.junit.Test
import org.junit.runner.RunWith

Expand Down Expand Up @@ -96,8 +99,13 @@ class CameraFragmentImplTest {
val noPermissionLayoutMock = mock<ConstraintLayout> {
on { visibility } doReturn View.INVISIBLE
}
val analyticsTrackerMock = mock<UserAnalyticsEventTracker> {
on { trackEvent(any()) }.then {}
on { trackEvent(any(), any()) }.then {}
}

fragmentImpl.mLayoutNoPermission = noPermissionLayoutMock
fragmentImpl.mUserAnalyticsEventTracker = analyticsTrackerMock

// When
fragmentImpl.startHelpActivity()
Expand Down

0 comments on commit fa40082

Please sign in to comment.