Skip to content

Instantly share code, notes, and snippets.

@andersu
Created January 30, 2022 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andersu/2d7cfa9e84f331d3a0cc52e2d9a02689 to your computer and use it in GitHub Desktop.
Save andersu/2d7cfa9e84f331d3a0cc52e2d9a02689 to your computer and use it in GitHub Desktop.
MenuItem screenshot test
import androidx.compose.ui.test.junit4.createComposeRule
import com.karumi.shot.ScreenshotTest
import org.junit.Rule
import org.junit.Test
class MenuItemScreenshotTest : ScreenshotTest {
@get:Rule
val composeRule = createComposeRule()
@Test
fun testMenuItem() {
composeRule.setContent { MenuItemPreview() }
compareScreenshot(composeRule)
}
@Test
fun testExternalLinkMenuItem() {
composeRule.setContent { ExternalLinkMenuItemPreview() }
compareScreenshot(composeRule)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment