mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 22:37:03 +05:30
Merge #127
127: Add regression test for month header r=msfjarvis a=msfjarvis bors r+ Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
commit
58116fb451
2 changed files with 39 additions and 0 deletions
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
|
@ -0,0 +1,39 @@
|
|||
package dev.msfjarvis.lobsters.ui.posts
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
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.DarkTestTheme
|
||||
import java.time.Month
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class HeaderTest : ScreenshotTest {
|
||||
@get:Rule
|
||||
val composeTestRule = createComposeRule()
|
||||
|
||||
@Test
|
||||
fun headerDoesNotHaveATransparentBackground() {
|
||||
composeTestRule.setContent {
|
||||
DarkTestTheme {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.background(color = Color(0xffffff))
|
||||
.fillMaxWidth()
|
||||
.fillMaxHeight(),
|
||||
) {
|
||||
MonthHeader(month = Month.AUGUST)
|
||||
}
|
||||
}
|
||||
}
|
||||
compareScreenshot(composeTestRule.onRoot().captureToImage().asAndroidBitmap())
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue