Skip to content

Commit

Permalink
subitems are displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
vextorspace committed Jul 27, 2024
1 parent 1990606 commit 52f1385
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion composeApp/src/desktopTest/kotlin/view/ItemCardMakerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.runComposeUiTest
import model.Item
import org.junit.Test
import kotlin.test.Test

class ItemCardMakerTest {

Expand All @@ -33,4 +33,31 @@ class ItemCardMakerTest {
onNodeWithText(itemContent)
.assertIsDisplayed()
}

@OptIn(ExperimentalTestApi::class)
@Test
fun `displays subitems`() = runComposeUiTest {
val itemContent = "::ITEMS CONTENT::"
val item = Item(itemContent)
val subItemContent = "::SUBITEMS CONTENT::"
val subItem = Item(subItemContent)
item.add(subItem)
val parentItems = mutableListOf<Item>()
val parentItemsState = mutableStateOf(parentItems)
val selectedCard = mutableStateOf<Item?>(null)
val statusText = mutableStateOf("")

setContent {
ItemCardMaker(
item,
parentItems,
parentItemsState,
selectedCard,
statusText
).Compose()
}

onNodeWithText(subItemContent)
.assertIsDisplayed()
}
}

0 comments on commit 52f1385

Please sign in to comment.