Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package io.sentry.react.replay

import com.facebook.react.module.annotations.ReactModule
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.mockito.MockitoAnnotations

@RunWith(JUnit4::class)
class RNSentryReplayMaskManagerTest {
private val expectedName = RNSentryReplayMaskManagerImpl.REACT_CLASS

private lateinit var manager: RNSentryReplayMaskManager

@Before
fun setUp() {
MockitoAnnotations.openMocks(this)
manager = RNSentryReplayMaskManager()
}

@Test
fun `getName returns correct react class name`() {
assertEquals(expectedName, manager.getName())
}

@Test
fun `module annotation name matches getName result`() {
val annotation = manager.javaClass.getAnnotation(ReactModule::class.java)
assertNotNull("ReactModule annotation should be present", annotation)
assertEquals(
"Annotation name should match getName() result",
expectedName,
annotation?.name,
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package io.sentry.react.replay

import com.facebook.react.module.annotations.ReactModule
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.mockito.MockitoAnnotations

@RunWith(JUnit4::class)
class RNSentryReplayUnmaskManagerTest {
private val expectedName = RNSentryReplayUnmaskManagerImpl.REACT_CLASS

private lateinit var manager: RNSentryReplayUnmaskManager

@Before
fun setUp() {
MockitoAnnotations.openMocks(this)
manager = RNSentryReplayUnmaskManager()
}

@Test
fun `getName returns correct react class name`() {
assertEquals(expectedName, manager.getName())
}

@Test
fun `module annotation name matches getName result`() {
val annotation = manager.javaClass.getAnnotation(ReactModule::class.java)
assertNotNull("ReactModule annotation should be present", annotation)
assertEquals(
"Annotation name should match getName() result",
expectedName,
annotation?.name,
)
}
}
Loading