diff --git a/android/quest/src/androidTest/java/org/smartregister/fhircore/quest/integration/ui/shared/components/ExtendedFabTest.kt b/android/quest/src/androidTest/java/org/smartregister/fhircore/quest/integration/ui/shared/components/ExtendedFabTest.kt index f64b1db060..d850e2e8c7 100644 --- a/android/quest/src/androidTest/java/org/smartregister/fhircore/quest/integration/ui/shared/components/ExtendedFabTest.kt +++ b/android/quest/src/androidTest/java/org/smartregister/fhircore/quest/integration/ui/shared/components/ExtendedFabTest.kt @@ -67,6 +67,37 @@ class ExtendedFabTest { } } + @Test + fun can_initializing_extended_fab_with_null_resource_data() { + composeRule.setContent { + ExtendedFab( + fabActions = + listOf( + NavigationMenuConfig( + id = "test", + display = "Fab Button", + menuIconConfig = ImageConfig(type = ICON_TYPE_LOCAL, reference = "ic_user"), + actions = + listOf( + ActionConfig( + trigger = ActionTrigger.ON_CLICK, + workflow = ApplicationWorkflow.LAUNCH_QUESTIONNAIRE.name, + questionnaire = QuestionnaireConfig(id = "23", title = "Add Family"), + ), + ), + ), + ), + resourceData = null, + navController = TestNavHostController(LocalContext.current), + lazyListState = null, + ) + } + composeRule + .onNodeWithTag(FAB_BUTTON_TEST_TAG, useUnmergedTree = true) + .assertExists() + .assertIsDisplayed() + } + @Test fun testFloatingButtonIsDisplayed() { init() diff --git a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/shared/components/ExtendedFab.kt b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/shared/components/ExtendedFab.kt index ffccca67fd..baff4a9a17 100644 --- a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/shared/components/ExtendedFab.kt +++ b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/shared/components/ExtendedFab.kt @@ -89,7 +89,7 @@ fun ExtendedFab( imageProperties = ImageProperties(imageConfig = firstMenuIconConfig), tint = if (firstFabEnabled) Color.White else DefaultColor, navController = navController, - resourceData = resourceData!!, + resourceData = resourceData, ) } if (text.isNotEmpty()) {