mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 23:47:02 +05:30
Add a basic UI test
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
6e246ed246
commit
2c0b4fc072
2 changed files with 30 additions and 0 deletions
|
@ -75,4 +75,5 @@ dependencies {
|
|||
testImplementation 'junit:junit:4.13'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
androidTestImplementation "androidx.ui:ui-test:$compose_version"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package dev.msfjarvis.todo
|
||||
|
||||
import androidx.ui.test.android.createAndroidComposeRule
|
||||
import androidx.ui.test.assertIsDisplayed
|
||||
import androidx.ui.test.onNodeWithText
|
||||
import dev.msfjarvis.todo.ui.TodoTheme
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class MainActivityTest {
|
||||
|
||||
@get:Rule
|
||||
val composeTestRule = createAndroidComposeRule<MainActivity>(disableTransitions = true)
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
composeTestRule.setContent {
|
||||
TodoTheme {
|
||||
TodoApp()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun test_default_item() {
|
||||
onNodeWithText("Default item").assertIsDisplayed()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue