File tree Expand file tree Collapse file tree 2 files changed +78
-0
lines changed
packages/core/RNSentryAndroidTester/app/src/test/java/io/sentry/react/replay Expand file tree Collapse file tree 2 files changed +78
-0
lines changed Original file line number Diff line number Diff line change 1+ package io.sentry.react.replay
2+
3+ import com.facebook.react.module.annotations.ReactModule
4+ import org.junit.Assert.assertEquals
5+ import org.junit.Assert.assertNotNull
6+ import org.junit.Before
7+ import org.junit.Test
8+ import org.junit.runner.RunWith
9+ import org.junit.runners.JUnit4
10+ import org.mockito.MockitoAnnotations
11+
12+ @RunWith(JUnit4 ::class )
13+ class RNSentryReplayMaskManagerTest {
14+ private val expectedName = RNSentryReplayMaskManagerImpl .REACT_CLASS
15+
16+ private lateinit var manager: RNSentryReplayMaskManager
17+
18+ @Before
19+ fun setUp () {
20+ MockitoAnnotations .openMocks(this )
21+ manager = RNSentryReplayMaskManager ()
22+ }
23+
24+ @Test
25+ fun `getName returns correct react class name` () {
26+ assertEquals(expectedName, manager.getName())
27+ }
28+
29+ @Test
30+ fun `module annotation name matches getName result` () {
31+ val annotation = manager.javaClass.getAnnotation(ReactModule ::class .java)
32+ assertNotNull(" ReactModule annotation should be present" , annotation)
33+ assertEquals(
34+ " Annotation name should match getName() result" ,
35+ expectedName,
36+ annotation?.name,
37+ )
38+ }
39+ }
Original file line number Diff line number Diff line change 1+ package io.sentry.react.replay
2+
3+ import com.facebook.react.module.annotations.ReactModule
4+ import org.junit.Assert.assertEquals
5+ import org.junit.Assert.assertNotNull
6+ import org.junit.Before
7+ import org.junit.Test
8+ import org.junit.runner.RunWith
9+ import org.junit.runners.JUnit4
10+ import org.mockito.MockitoAnnotations
11+
12+ @RunWith(JUnit4 ::class )
13+ class RNSentryReplayUnmaskManagerTest {
14+ private val expectedName = RNSentryReplayUnmaskManagerImpl .REACT_CLASS
15+
16+ private lateinit var manager: RNSentryReplayUnmaskManager
17+
18+ @Before
19+ fun setUp () {
20+ MockitoAnnotations .openMocks(this )
21+ manager = RNSentryReplayUnmaskManager ()
22+ }
23+
24+ @Test
25+ fun `getName returns correct react class name` () {
26+ assertEquals(expectedName, manager.getName())
27+ }
28+
29+ @Test
30+ fun `module annotation name matches getName result` () {
31+ val annotation = manager.javaClass.getAnnotation(ReactModule ::class .java)
32+ assertNotNull(" ReactModule annotation should be present" , annotation)
33+ assertEquals(
34+ " Annotation name should match getName() result" ,
35+ expectedName,
36+ annotation?.name,
37+ )
38+ }
39+ }
You can’t perform that action at this time.
0 commit comments