From 52f1385abbff9d30fc56a4bad7df94c63bde6571 Mon Sep 17 00:00:00 2001 From: Douglas Ronne Date: Sat, 27 Jul 2024 10:45:21 -0400 Subject: [PATCH] subitems are displayed --- .../kotlin/view/ItemCardMakerTest.kt | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/composeApp/src/desktopTest/kotlin/view/ItemCardMakerTest.kt b/composeApp/src/desktopTest/kotlin/view/ItemCardMakerTest.kt index f1a1602..be8928e 100644 --- a/composeApp/src/desktopTest/kotlin/view/ItemCardMakerTest.kt +++ b/composeApp/src/desktopTest/kotlin/view/ItemCardMakerTest.kt @@ -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 { @@ -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() + val parentItemsState = mutableStateOf(parentItems) + val selectedCard = mutableStateOf(null) + val statusText = mutableStateOf("") + + setContent { + ItemCardMaker( + item, + parentItems, + parentItemsState, + selectedCard, + statusText + ).Compose() + } + + onNodeWithText(subItemContent) + .assertIsDisplayed() + } } \ No newline at end of file