tests
This commit is contained in:
parent
a8e5a262d9
commit
372b523c0b
@ -0,0 +1,47 @@
|
|||||||
|
package com.example.libary
|
||||||
|
|
||||||
|
import androidx.compose.ui.test.assertIsDisplayed
|
||||||
|
import androidx.compose.ui.test.junit4.createComposeRule
|
||||||
|
import androidx.compose.ui.test.onNodeWithText
|
||||||
|
import org.junit.Rule
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
|
class CardPrimaryTest {
|
||||||
|
|
||||||
|
@get:Rule
|
||||||
|
val composeRule = createComposeRule()
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun test() {
|
||||||
|
composeRule.setContent {
|
||||||
|
PrimaryCard(
|
||||||
|
name = "name",
|
||||||
|
category = "category",
|
||||||
|
price = "100",
|
||||||
|
isAdd = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
composeRule.onNodeWithText("name").assertIsDisplayed()
|
||||||
|
composeRule.onNodeWithText("category").assertIsDisplayed()
|
||||||
|
composeRule.onNodeWithText("100 ₽").assertIsDisplayed()
|
||||||
|
composeRule.onNodeWithText("Убрать").assertIsDisplayed()
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun test1() {
|
||||||
|
composeRule.setContent {
|
||||||
|
PrimaryCard(
|
||||||
|
name = "name",
|
||||||
|
category = "category",
|
||||||
|
price = "100",
|
||||||
|
isAdd = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
composeRule.onNodeWithText("name").assertIsDisplayed()
|
||||||
|
composeRule.onNodeWithText("category").assertIsDisplayed()
|
||||||
|
composeRule.onNodeWithText("100 ₽").assertIsDisplayed()
|
||||||
|
composeRule.onNodeWithText("Добавить").assertIsDisplayed()
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user