mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-18 00:57:02 +05:30
test: add screenshot test for LobstersBottomNav
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
This commit is contained in:
parent
f5bc2ebb59
commit
ce7abc7afb
3 changed files with 32 additions and 0 deletions
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
|
@ -0,0 +1,32 @@
|
||||||
|
package dev.msfjarvis.lobsters.ui.navigation
|
||||||
|
|
||||||
|
import androidx.compose.ui.graphics.asAndroidBitmap
|
||||||
|
import androidx.compose.ui.test.captureToImage
|
||||||
|
import androidx.compose.ui.test.junit4.createComposeRule
|
||||||
|
import androidx.compose.ui.test.onRoot
|
||||||
|
import com.karumi.shot.ScreenshotTest
|
||||||
|
import dev.msfjarvis.lobsters.ui.main.LobstersBottomNav
|
||||||
|
import dev.msfjarvis.lobsters.ui.theme.LobstersTheme
|
||||||
|
import org.junit.Rule
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
|
class LobstersBottomNavTest : ScreenshotTest {
|
||||||
|
|
||||||
|
@get:Rule
|
||||||
|
val composeTestRule = createComposeRule()
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun bottomNavIsRenderedCorrectlyOnScreen() {
|
||||||
|
composeTestRule.setContent {
|
||||||
|
LobstersTheme {
|
||||||
|
LobstersBottomNav(
|
||||||
|
currentDestination = Destination.startDestination,
|
||||||
|
navigateToDestination = { /*TODO*/ },
|
||||||
|
jumpToIndex = { /*TODO*/ }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compareScreenshot(composeTestRule.onRoot().captureToImage().asAndroidBitmap())
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue