Skip to content

Commit

Permalink
Merge ddf9fff into ebb6965
Browse files Browse the repository at this point in the history
  • Loading branch information
adinauer authored Sep 19, 2024
2 parents ebb6965 + ddf9fff commit 13e7183
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import io.sentry.TransactionOptions
import io.sentry.android.core.SentryAndroidOptions
import io.sentry.protocol.SentryId
import io.sentry.protocol.TransactionNameSource
import org.mockito.ArgumentCaptor
import org.mockito.kotlin.any
import org.mockito.kotlin.check
import org.mockito.kotlin.clearInvocations
Expand All @@ -49,6 +50,7 @@ class SentryGestureListenerTracingTest {
val scopes = mock<IScopes>()
val event = mock<MotionEvent>()
val scope = mock<IScope>()
val transactionOptionsArgumentCaptor: ArgumentCaptor<TransactionOptions> = ArgumentCaptor.forClass(TransactionOptions::class.java)
lateinit var target: View
lateinit var transaction: SentryTracer

Expand Down Expand Up @@ -85,8 +87,7 @@ class SentryGestureListenerTracingTest {
whenever(target.context).thenReturn(context)

whenever(activity.window).thenReturn(window)

whenever(scopes.startTransaction(any(), any<TransactionOptions>()))
whenever(scopes.startTransaction(any(), transactionOptionsArgumentCaptor.capture()))
.thenReturn(this.transaction)
doAnswer { (it.arguments[0] as ScopeCallback).run(scope) }.whenever(scopes).configureScope(any())

Expand Down Expand Up @@ -349,15 +350,14 @@ class SentryGestureListenerTracingTest {
)
}

// TODO [POTEL] rewrite
// @Test
// fun `captures transaction and sets trace origin`() {
// val sut = fixture.getSut<View>()
//
// sut.onSingleTapUp(fixture.event)
//
// assertEquals("auto.ui.gesture_listener.old_view_system", fixture.transaction.spanContext.origin)
// }
@Test
fun `captures transaction and sets trace origin`() {
val sut = fixture.getSut<View>()

sut.onSingleTapUp(fixture.event)

assertEquals("auto.ui.gesture_listener.old_view_system", fixture.transactionOptionsArgumentCaptor.value.origin)
}

@Test
fun `preserves existing transaction status`() {
Expand Down

0 comments on commit 13e7183

Please sign in to comment.