From d9f60d43974564e5cd20bc12eeb60fb3c05f6d9b Mon Sep 17 00:00:00 2001 From: Xavier Molloy Date: Fri, 6 Oct 2023 08:43:15 +0200 Subject: [PATCH] make state not nullable for input components --- .../org/hisp/dhis/common/screens/FormShellsScreen.kt | 10 +++++++++- .../hisp/dhis/common/screens/InputCheckBoxScreen.kt | 2 ++ .../org/hisp/dhis/common/screens/InputEmailScreen.kt | 2 ++ .../org/hisp/dhis/common/screens/InputIntegerScreen.kt | 1 + .../org/hisp/dhis/common/screens/InputLetterScreen.kt | 1 + .../org/hisp/dhis/common/screens/InputLinkScreen.kt | 3 +++ .../hisp/dhis/common/screens/InputLongTextScreen.kt | 1 + .../org/hisp/dhis/common/screens/InputMatrixScreen.kt | 1 + .../dhis/common/screens/InputNegativeIntegerScreen.kt | 1 + .../org/hisp/dhis/common/screens/InputNumberScreen.kt | 2 ++ .../hisp/dhis/common/screens/InputPercentageScreen.kt | 1 + .../hisp/dhis/common/screens/InputPhoneNumberScreen.kt | 1 + .../common/screens/InputPositiveIntegerOrZeroScreen.kt | 1 + .../dhis/common/screens/InputPositiveIntegerScreen.kt | 1 + .../hisp/dhis/common/screens/InputRadioButtonScreen.kt | 2 ++ .../hisp/dhis/common/screens/InputSequentialScreen.kt | 1 + .../org/hisp/dhis/common/screens/InputTextScreen.kt | 1 + .../hisp/dhis/common/screens/InputYesNoFieldScreen.kt | 2 ++ .../dhis/common/screens/InputYesOnlyCheckBoxScreen.kt | 6 ++++-- .../dhis/common/screens/InputYesOnlySwitchScreen.kt | 2 ++ .../org/hisp/dhis/common/screens/SectionScreen.kt | 4 ++++ .../mobile/ui/designsystem/component/InputCheckBox.kt | 2 +- .../mobile/ui/designsystem/component/InputEmail.kt | 2 +- .../mobile/ui/designsystem/component/InputInteger.kt | 2 +- .../mobile/ui/designsystem/component/InputLetter.kt | 2 +- .../dhis/mobile/ui/designsystem/component/InputLink.kt | 2 +- .../mobile/ui/designsystem/component/InputLongText.kt | 2 +- .../mobile/ui/designsystem/component/InputMatrix.kt | 3 +-- .../ui/designsystem/component/InputNegativeInteger.kt | 2 +- .../mobile/ui/designsystem/component/InputNumber.kt | 2 +- .../ui/designsystem/component/InputPercentage.kt | 2 +- .../ui/designsystem/component/InputPhoneNumber.kt | 2 +- .../ui/designsystem/component/InputPositiveInteger.kt | 2 +- .../component/InputPositiveIntegerOrZero.kt | 2 +- .../mobile/ui/designsystem/component/InputQRCode.kt | 2 +- .../ui/designsystem/component/InputRadioButton.kt | 3 +-- .../ui/designsystem/component/InputSequential.kt | 3 +-- .../dhis/mobile/ui/designsystem/component/InputText.kt | 2 +- .../ui/designsystem/component/InputYesNoField.kt | 2 +- .../ui/designsystem/component/InputYesOnlyCheckBox.kt | 2 +- .../ui/designsystem/component/InputYesOnlySwitch.kt | 2 +- .../ui/designsystem/component/InputCheckBoxTest.kt | 7 +++++++ .../mobile/ui/designsystem/component/InputEmailTest.kt | 8 ++++++++ .../ui/designsystem/component/InputIntegerTest.kt | 9 +++++++++ .../ui/designsystem/component/InputLetterTest.kt | 7 +++++++ .../mobile/ui/designsystem/component/InputLinkTest.kt | 8 ++++++++ .../ui/designsystem/component/InputLongTextTest.kt | 6 ++++++ .../designsystem/component/InputNegativeIntegerTest.kt | 8 ++++++++ .../ui/designsystem/component/InputNumberTest.kt | 7 +++++++ .../ui/designsystem/component/InputPercentageTest.kt | 8 ++++++++ .../ui/designsystem/component/InputPhoneNumberTest.kt | 2 ++ .../component/InputPositiveIntegerOrZeroTest.kt | 10 ++++++++++ .../designsystem/component/InputPositiveIntegerTest.kt | 9 +++++++++ .../ui/designsystem/component/InputQRCodeTest.kt | 3 +++ .../ui/designsystem/component/InputRadioButtonTest.kt | 7 +++++++ .../mobile/ui/designsystem/component/InputTextTest.kt | 6 ++++++ .../ui/designsystem/component/InputYesNoFieldTest.kt | 7 +++++++ .../designsystem/component/InputYesOnlyCheckBoxTest.kt | 6 +++++- .../designsystem/component/InputYesOnlySwitchTest.kt | 4 ++++ 59 files changed, 184 insertions(+), 27 deletions(-) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/FormShellsScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/FormShellsScreen.kt index 17fcd8f41..bd3cdb9f8 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/FormShellsScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/FormShellsScreen.kt @@ -38,6 +38,7 @@ fun FormShellsScreen() { inputValue1 = it } }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) @@ -52,7 +53,7 @@ fun FormShellsScreen() { inputValue2 = it } }, - + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) @@ -124,6 +125,7 @@ fun FormShellsScreen() { inputValue7 = it } }, + state = InputShellState.ERROR, ) Spacer(Modifier.size(Spacing.Spacing18)) @@ -159,6 +161,7 @@ fun FormShellsScreen() { inputValue9 = it } }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) @@ -178,6 +181,8 @@ fun FormShellsScreen() { inputValue10 = it } }, + state = InputShellState.UNFOCUSED, + ) Spacer(Modifier.size(Spacing.Spacing18)) @@ -263,6 +268,7 @@ fun FormShellsScreen() { inputValue14 = it } }, + state = InputShellState.UNFOCUSED, ) var inputValue15 by rememberSaveable { mutableStateOf("Input") } @@ -275,6 +281,7 @@ fun FormShellsScreen() { inputValue15 = it } }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) @@ -296,6 +303,7 @@ fun FormShellsScreen() { inputValue16 = it } }, + state = InputShellState.UNFOCUSED, ) } } diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputCheckBoxScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputCheckBoxScreen.kt index ec81816af..38a960616 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputCheckBoxScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputCheckBoxScreen.kt @@ -68,6 +68,7 @@ fun InputCheckBoxScreen() { checkBoxDataItemsVertical[index] = checkBoxData.copy(checked = !checkBoxData.checked) }, onClearSelection = { checkBoxDataItemsVertical.replaceAll { it.copy(checked = false) } }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) InputCheckBox( @@ -99,6 +100,7 @@ fun InputCheckBoxScreen() { checkBoxDataItemsHorizontal[index] = checkBoxData.copy(checked = !checkBoxData.checked) }, onClearSelection = { checkBoxDataItemsHorizontal.replaceAll { it.copy(checked = false) } }, + state = InputShellState.UNFOCUSED, ) } } diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputEmailScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputEmailScreen.kt index d42b8b2d8..901da6625 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputEmailScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputEmailScreen.kt @@ -35,6 +35,7 @@ fun InputEmailScreen() { } }, onEmailActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) @@ -51,6 +52,7 @@ fun InputEmailScreen() { } }, onEmailActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputIntegerScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputIntegerScreen.kt index 66e35c69d..17fab4e97 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputIntegerScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputIntegerScreen.kt @@ -33,6 +33,7 @@ fun InputIntegerScreen() { inputValue1 = it } }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLetterScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLetterScreen.kt index 9b4feabe8..2fd6a7431 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLetterScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLetterScreen.kt @@ -33,6 +33,7 @@ fun InputLetterScreen() { inputValue1 = it } }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLinkScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLinkScreen.kt index 158779c7a..cf6976962 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLinkScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLinkScreen.kt @@ -35,6 +35,7 @@ fun InputLinkScreen() { } }, onLinkActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) @@ -51,6 +52,7 @@ fun InputLinkScreen() { } }, onLinkActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) @@ -67,6 +69,7 @@ fun InputLinkScreen() { } }, onLinkActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLongTextScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLongTextScreen.kt index 9880f2c7d..a31f08a1f 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLongTextScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLongTextScreen.kt @@ -38,6 +38,7 @@ fun InputLongTextScreen() { inputValue1 = it } }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputMatrixScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputMatrixScreen.kt index 32ddc314f..fde6479f8 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputMatrixScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputMatrixScreen.kt @@ -70,6 +70,7 @@ fun InputMatrixScreen() { newSelectedItem } }, + state = InputShellState.UNFOCUSED, ) InputMatrix( diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputNegativeIntegerScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputNegativeIntegerScreen.kt index 6349f906c..2883bbb15 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputNegativeIntegerScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputNegativeIntegerScreen.kt @@ -33,6 +33,7 @@ fun InputNegativeIntegerScreen() { inputValue1 = it } }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputNumberScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputNumberScreen.kt index 8c9964929..530429cdf 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputNumberScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputNumberScreen.kt @@ -34,6 +34,7 @@ fun InputNumberScreen() { } }, notation = RegExValidations.BRITISH_DECIMAL_NOTATION, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) @@ -49,6 +50,7 @@ fun InputNumberScreen() { } }, notation = RegExValidations.EUROPEAN_DECIMAL_NOTATION, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPercentageScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPercentageScreen.kt index 7013cff13..79c340854 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPercentageScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPercentageScreen.kt @@ -31,6 +31,7 @@ fun InputPercentageScreen() { inputValue1 = it } }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPhoneNumberScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPhoneNumberScreen.kt index 850ec3a70..68872471f 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPhoneNumberScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPhoneNumberScreen.kt @@ -34,6 +34,7 @@ fun InputPhoneNumberScreen() { // no-op }, onFocusChanged = {}, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPositiveIntegerOrZeroScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPositiveIntegerOrZeroScreen.kt index e25077ed0..3e12e4e6b 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPositiveIntegerOrZeroScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPositiveIntegerOrZeroScreen.kt @@ -33,6 +33,7 @@ fun InputPositiveIntegerOrZeroScreen() { inputValue1 = it } }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPositiveIntegerScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPositiveIntegerScreen.kt index 5394a7a68..793f63ced 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPositiveIntegerScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputPositiveIntegerScreen.kt @@ -33,6 +33,7 @@ fun InputPositiveIntegerScreen() { inputValue1 = it } }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) SubTitle("Basic Input Integer with error", textColor = TextColor.OnSurfaceVariant) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputRadioButtonScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputRadioButtonScreen.kt index 03722fac3..f189e1fb5 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputRadioButtonScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputRadioButtonScreen.kt @@ -76,6 +76,7 @@ fun InputRadioButtonScreen() { onItemChange = { selectedItemVertical = it }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) InputRadioButton( @@ -106,6 +107,7 @@ fun InputRadioButtonScreen() { onItemChange = { selectedItemHorizontal = it }, + state = InputShellState.UNFOCUSED, ) } } diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputSequentialScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputSequentialScreen.kt index 4ae53d27a..2dffac55b 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputSequentialScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputSequentialScreen.kt @@ -70,6 +70,7 @@ fun InputSequentialScreen() { newSelectedItem } }, + state = InputShellState.UNFOCUSED, ) InputSequential( diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputTextScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputTextScreen.kt index c56b6e80b..d86cbc6a8 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputTextScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputTextScreen.kt @@ -31,6 +31,7 @@ fun InputTextScreen() { inputValue1 = it } }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) SubTitle("Input text with error ") diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputYesNoFieldScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputYesNoFieldScreen.kt index 5afdb21ca..eeec96866 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputYesNoFieldScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputYesNoFieldScreen.kt @@ -37,6 +37,7 @@ fun InputYesNoFieldScreen() { onItemChange = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) InputYesNoField( @@ -45,6 +46,7 @@ fun InputYesNoFieldScreen() { onItemChange = { selectedItem1 = it }, + state = InputShellState.UNFOCUSED, ) Spacer(Modifier.size(Spacing.Spacing18)) InputYesNoField( diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputYesOnlyCheckBoxScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputYesOnlyCheckBoxScreen.kt index 28d696806..77d53c00b 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputYesOnlyCheckBoxScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputYesOnlyCheckBoxScreen.kt @@ -28,20 +28,22 @@ fun InputYesOnlyCheckBoxScreen() { var checkboxData2 by rememberSaveable { mutableStateOf(CheckBoxData(uid = "0", checked = false, enabled = true, textInput = "Label")) } - var checkboxData3 by rememberSaveable { + val checkboxData3 by rememberSaveable { mutableStateOf(CheckBoxData(uid = "0", checked = false, enabled = true, textInput = "Label")) } - var checkboxData4 by rememberSaveable { + val checkboxData4 by rememberSaveable { mutableStateOf(CheckBoxData(uid = "0", checked = true, enabled = true, textInput = "Label")) } InputYesOnlyCheckBox( checkBoxData = checkboxData, + state = InputShellState.UNFOCUSED, ) { checkboxData = checkboxData.copy(checked = !checkboxData.checked) } Spacer(Modifier.size(Spacing.Spacing18)) InputYesOnlyCheckBox( checkBoxData = checkboxData1, + state = InputShellState.UNFOCUSED, ) { checkboxData1 = checkboxData1.copy(checked = !checkboxData.checked) } diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputYesOnlySwitchScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputYesOnlySwitchScreen.kt index d554234af..af1980e73 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputYesOnlySwitchScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputYesOnlySwitchScreen.kt @@ -26,6 +26,7 @@ fun InputYesOnlySwitchScreen() { InputYesOnlySwitch( title = "Label", isChecked = isSelected, + state = InputShellState.UNFOCUSED, ) { isSelected = !isSelected } @@ -33,6 +34,7 @@ fun InputYesOnlySwitchScreen() { InputYesOnlySwitch( title = "Label", isChecked = isSelected1, + state = InputShellState.UNFOCUSED, ) { isSelected1 = !isSelected1 } diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/SectionScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/SectionScreen.kt index 2a9d7ad89..2313dd06e 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/SectionScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/SectionScreen.kt @@ -13,6 +13,7 @@ import org.hisp.dhis.common.screens.previews.lorem import org.hisp.dhis.common.screens.previews.lorem_medium import org.hisp.dhis.common.screens.previews.lorem_short import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer +import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState import org.hisp.dhis.mobile.ui.designsystem.component.InputText import org.hisp.dhis.mobile.ui.designsystem.component.Section import org.hisp.dhis.mobile.ui.designsystem.component.SectionState @@ -162,15 +163,18 @@ private fun TestingFields() { title = "Label", inputText = inputValue1, onValueChanged = { inputValue1 = it ?: "" }, + state = InputShellState.UNFOCUSED, ) InputText( title = "Label", inputText = inputValue2, onValueChanged = { inputValue2 = it ?: "" }, + state = InputShellState.UNFOCUSED, ) InputText( title = "Label", inputText = inputValue3, onValueChanged = { inputValue3 = it ?: "" }, + state = InputShellState.UNFOCUSED, ) } diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputCheckBox.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputCheckBox.kt index dc8452d62..5d4d0786b 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputCheckBox.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputCheckBox.kt @@ -32,7 +32,7 @@ fun InputCheckBox( checkBoxData: List, modifier: Modifier = Modifier, orientation: Orientation = Orientation.VERTICAL, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, isRequired: Boolean = false, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputEmail.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputEmail.kt index d674860db..e43ded9d0 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputEmail.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputEmail.kt @@ -31,7 +31,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.internal.RegExValidations @Composable fun InputEmail( title: String, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, inputText: String? = null, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputInteger.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputInteger.kt index 53909baf5..baa5c0054 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputInteger.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputInteger.kt @@ -27,7 +27,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.internal.RegExValidations @Composable fun InputInteger( title: String, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, inputText: String? = null, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLetter.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLetter.kt index a0dc99544..5304e6a6c 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLetter.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLetter.kt @@ -29,7 +29,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.internal.RegExValidations @Composable fun InputLetter( title: String, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, inputText: String? = null, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLink.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLink.kt index 305d732bf..7ea5f7e3a 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLink.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLink.kt @@ -31,7 +31,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.internal.RegExValidations @Composable fun InputLink( title: String, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, inputText: String? = null, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLongText.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLongText.kt index 72e5f691a..0c2d508f8 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLongText.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLongText.kt @@ -30,7 +30,7 @@ import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing @Composable fun InputLongText( title: String, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, inputText: String? = null, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputMatrix.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputMatrix.kt index 41f63699f..dfe7af4a2 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputMatrix.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputMatrix.kt @@ -14,7 +14,6 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.testTag -import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState.UNFOCUSED import org.hisp.dhis.mobile.ui.designsystem.component.internal.IconCard import org.hisp.dhis.mobile.ui.designsystem.component.internal.IconCardData import org.hisp.dhis.mobile.ui.designsystem.component.internal.VerticalGrid @@ -42,7 +41,7 @@ fun InputMatrix( itemCount: Int = 2, selectedData: IconCardData? = null, modifier: Modifier = Modifier, - state: InputShellState = UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, isRequired: Boolean = false, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNegativeInteger.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNegativeInteger.kt index 1f5753644..f30d23516 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNegativeInteger.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNegativeInteger.kt @@ -31,7 +31,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.internal.RegExValidations @Composable fun InputNegativeInteger( title: String, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, inputText: String? = null, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNumber.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNumber.kt index 1ca6f04d0..047610be6 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNumber.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNumber.kt @@ -29,7 +29,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.internal.RegExValidations @Composable fun InputNumber( title: String, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, inputText: String? = null, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPercentage.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPercentage.kt index f585c2fa5..91e16b97a 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPercentage.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPercentage.kt @@ -27,7 +27,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.internal.RegExValidations @Composable fun InputPercentage( title: String, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, inputText: String? = null, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPhoneNumber.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPhoneNumber.kt index 8d2aa97a9..8c3f0b8a1 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPhoneNumber.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPhoneNumber.kt @@ -34,7 +34,7 @@ fun InputPhoneNumber( onCallActionClicked: () -> Unit, modifier: Modifier = Modifier, maxLength: Int = 12, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, legendData: LegendData? = null, inputText: String? = null, isRequiredField: Boolean = false, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveInteger.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveInteger.kt index 10224b5e6..f7cad92ff 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveInteger.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveInteger.kt @@ -27,7 +27,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.internal.RegExValidations @Composable fun InputPositiveInteger( title: String, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, inputText: String? = null, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveIntegerOrZero.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveIntegerOrZero.kt index 615466cb3..359da11eb 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveIntegerOrZero.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveIntegerOrZero.kt @@ -27,7 +27,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.internal.RegExValidations @Composable fun InputPositiveIntegerOrZero( title: String, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, inputText: String? = null, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputQRCode.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputQRCode.kt index 7d3b626b7..d0e697127 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputQRCode.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputQRCode.kt @@ -31,7 +31,7 @@ import androidx.compose.ui.text.input.ImeAction @Composable fun InputQRCode( title: String, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, onQRButtonClicked: () -> Unit, supportingText: List? = null, legendData: LegendData? = null, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputRadioButton.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputRadioButton.kt index 110dc1e75..e489feb79 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputRadioButton.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputRadioButton.kt @@ -9,7 +9,6 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState.DISABLED -import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState.UNFOCUSED import org.hisp.dhis.mobile.ui.designsystem.component.Orientation.VERTICAL import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing @@ -36,7 +35,7 @@ fun InputRadioButton( radioButtonData: List, modifier: Modifier = Modifier, orientation: Orientation = VERTICAL, - state: InputShellState = UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, isRequired: Boolean = false, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputSequential.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputSequential.kt index 8a05dcc3a..a70047663 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputSequential.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputSequential.kt @@ -15,7 +15,6 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.testTag -import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState.UNFOCUSED import org.hisp.dhis.mobile.ui.designsystem.component.internal.IconCard import org.hisp.dhis.mobile.ui.designsystem.component.internal.IconCardData import org.hisp.dhis.mobile.ui.designsystem.resource.provideDHIS2Icon @@ -41,7 +40,7 @@ fun InputSequential( data: List, selectedData: IconCardData? = null, modifier: Modifier = Modifier, - state: InputShellState = UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, isRequired: Boolean = false, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputText.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputText.kt index d8d2e910f..e2ab9ed62 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputText.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputText.kt @@ -24,7 +24,7 @@ import androidx.compose.ui.text.input.ImeAction @Composable fun InputText( title: String, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, inputText: String? = null, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesNoField.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesNoField.kt index 693e2d13e..46e7ff045 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesNoField.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesNoField.kt @@ -28,7 +28,7 @@ import java.util.Locale fun InputYesNoField( title: String, modifier: Modifier = Modifier, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, isRequired: Boolean = false, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlyCheckBox.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlyCheckBox.kt index 30f40a8bc..65f4cb4f2 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlyCheckBox.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlyCheckBox.kt @@ -16,7 +16,7 @@ import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing fun InputYesOnlyCheckBox( checkBoxData: CheckBoxData, modifier: Modifier = Modifier, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, isRequired: Boolean = false, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlySwitch.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlySwitch.kt index 69d83f11d..e561852c9 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlySwitch.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlySwitch.kt @@ -19,7 +19,7 @@ import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing fun InputYesOnlySwitch( title: String, modifier: Modifier = Modifier, - state: InputShellState = InputShellState.UNFOCUSED, + state: InputShellState, supportingText: List? = null, legendData: LegendData? = null, isRequired: Boolean = false, diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputCheckBoxTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputCheckBoxTest.kt index e848bd24d..aa333c095 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputCheckBoxTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputCheckBoxTest.kt @@ -41,6 +41,7 @@ class InputCheckBoxTest { checkBoxDataList[index] = checkBoxData.copy(checked = !checkBoxData.checked) }, onClearSelection = { checkBoxDataList.replaceAll { it.copy(checked = false) } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_CHECK_BOX").assertExists() @@ -68,6 +69,7 @@ class InputCheckBoxTest { checkBoxDataList[index] = checkBoxData.copy(checked = !checkBoxData.checked) }, onClearSelection = { checkBoxDataList.replaceAll { it.copy(checked = false) } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_CHECK_BOX").assertExists() @@ -121,6 +123,7 @@ class InputCheckBoxTest { checkBoxDataList[index] = checkBoxData.copy(checked = !checkBoxData.checked) }, onClearSelection = { checkBoxDataList.replaceAll { it.copy(checked = false) } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_CHECK_BOX").assertExists() @@ -147,6 +150,7 @@ class InputCheckBoxTest { checkBoxDataList[index] = checkBoxData.copy(checked = !checkBoxData.checked) }, onClearSelection = { checkBoxDataList.replaceAll { it.copy(checked = false) } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_CHECK_BOX").assertExists() @@ -197,6 +201,7 @@ class InputCheckBoxTest { checkBoxDataList[index] = checkBoxData.copy(checked = !checkBoxData.checked) }, onClearSelection = { checkBoxDataList.replaceAll { it.copy(checked = false) } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_CHECK_BOX").assertExists() @@ -224,6 +229,7 @@ class InputCheckBoxTest { legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), onItemChange = { }, onClearSelection = { }, + state = InputShellState.UNFOCUSED, ) } @@ -249,6 +255,7 @@ class InputCheckBoxTest { supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), onItemChange = { }, onClearSelection = { }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_CHECK_BOX").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputEmailTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputEmailTest.kt index ddd9ee40e..4d8ba0cf6 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputEmailTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputEmailTest.kt @@ -30,6 +30,7 @@ class InputEmailTest { InputEmail( title = "Label", onEmailActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_EMAIL").assertExists() @@ -50,6 +51,7 @@ class InputEmailTest { } }, onEmailActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_EMAIL").assertExists() @@ -83,6 +85,7 @@ class InputEmailTest { } }, onEmailActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_EMAIL").assertExists() @@ -105,6 +108,7 @@ class InputEmailTest { } }, onEmailActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_EMAIL").assertExists() @@ -142,6 +146,7 @@ class InputEmailTest { inputText = "Input", legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), onEmailActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_EMAIL").assertExists() @@ -157,6 +162,7 @@ class InputEmailTest { inputText = "Input", supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), onEmailActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_EMAIL").assertExists() @@ -177,6 +183,7 @@ class InputEmailTest { } }, onEmailActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("EMAIL_BUTTON").assertIsNotEnabled() @@ -211,6 +218,7 @@ class InputEmailTest { } }, onEmailActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("EMAIL_BUTTON").assertIsEnabled() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputIntegerTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputIntegerTest.kt index 8c0810df6..09f922f53 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputIntegerTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputIntegerTest.kt @@ -27,6 +27,7 @@ class InputIntegerTest { rule.setContent { InputInteger( title = "Label", + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_INTEGER").assertExists() @@ -46,6 +47,7 @@ class InputIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_INTEGER").assertExists() @@ -77,6 +79,7 @@ class InputIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_INTEGER").assertExists() @@ -98,6 +101,7 @@ class InputIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_INTEGER").assertExists() @@ -114,6 +118,7 @@ class InputIntegerTest { title = "Label", inputText = "Input", legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_INTEGER").assertExists() @@ -128,6 +133,7 @@ class InputIntegerTest { title = "Label", inputText = "Input", supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_INTEGER").assertExists() @@ -146,6 +152,7 @@ class InputIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_INTEGER").assertExists() @@ -166,6 +173,7 @@ class InputIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_INTEGER").assertExists() @@ -186,6 +194,7 @@ class InputIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_INTEGER").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLetterTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLetterTest.kt index 958649bde..0ee982ec8 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLetterTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLetterTest.kt @@ -30,6 +30,7 @@ class InputLetterTest { InputLetter( title = "Label", modifier = Modifier.testTag("INPUT_LETTER"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LETTER").assertExists() @@ -50,6 +51,7 @@ class InputLetterTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LETTER").assertExists() @@ -83,6 +85,7 @@ class InputLetterTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LETTER").assertExists() @@ -105,6 +108,7 @@ class InputLetterTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LETTER").assertExists() @@ -122,6 +126,7 @@ class InputLetterTest { modifier = Modifier.testTag("INPUT_LETTER"), inputText = "Input", legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LETTER").assertExists() @@ -137,6 +142,7 @@ class InputLetterTest { modifier = Modifier.testTag("INPUT_LETTER"), inputText = "Input", supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LETTER").assertExists() @@ -156,6 +162,7 @@ class InputLetterTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LETTER").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLinkTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLinkTest.kt index b8c197832..bdf4dcdc7 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLinkTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLinkTest.kt @@ -31,6 +31,7 @@ class InputLinkTest { InputLink( title = "Label", onLinkActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LINK").assertExists() @@ -51,6 +52,7 @@ class InputLinkTest { } }, onLinkActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LINK").assertExists() @@ -84,6 +86,7 @@ class InputLinkTest { } }, onLinkActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LINK").assertExists() @@ -106,6 +109,7 @@ class InputLinkTest { } }, onLinkActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LINK").assertExists() @@ -143,6 +147,7 @@ class InputLinkTest { inputText = "Input", legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), onLinkActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LINK").assertExists() @@ -158,6 +163,7 @@ class InputLinkTest { inputText = "Input", supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), onLinkActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LINK").assertExists() @@ -178,6 +184,7 @@ class InputLinkTest { } }, onLinkActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("LINK_BUTTON").assertIsNotEnabled() @@ -212,6 +219,7 @@ class InputLinkTest { } }, onLinkActionCLicked = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("LINK_BUTTON").assertIsEnabled() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLongTextTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLongTextTest.kt index c34765c52..c1e91f0ac 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLongTextTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputLongTextTest.kt @@ -30,6 +30,7 @@ class InputLongTextTest { InputLongText( title = "Label", modifier = Modifier.testTag("INPUT_LONG_TEXT"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LONG_TEXT").assertExists() @@ -50,6 +51,7 @@ class InputLongTextTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LONG_TEXT").assertExists() @@ -83,6 +85,7 @@ class InputLongTextTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LONG_TEXT").assertExists() @@ -105,6 +108,7 @@ class InputLongTextTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LONG_TEXT").assertExists() @@ -122,6 +126,7 @@ class InputLongTextTest { modifier = Modifier.testTag("INPUT_LONG_TEXT"), inputText = "Input", legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LONG_TEXT").assertExists() @@ -137,6 +142,7 @@ class InputLongTextTest { modifier = Modifier.testTag("INPUT_LONG_TEXT"), inputText = "Input", supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_LONG_TEXT").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNegativeIntegerTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNegativeIntegerTest.kt index 7733b0aec..d7ff0564c 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNegativeIntegerTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNegativeIntegerTest.kt @@ -26,6 +26,7 @@ class InputNegativeIntegerTest { rule.setContent { InputNegativeInteger( title = "Label", + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NEGATIVE_INTEGER").assertExists() @@ -45,6 +46,7 @@ class InputNegativeIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NEGATIVE_INTEGER").assertExists() @@ -76,6 +78,7 @@ class InputNegativeIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NEGATIVE_INTEGER").assertExists() @@ -97,6 +100,7 @@ class InputNegativeIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NEGATIVE_INTEGER").assertExists() @@ -112,6 +116,7 @@ class InputNegativeIntegerTest { title = "Label", inputText = "", legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NEGATIVE_INTEGER").assertExists() @@ -126,6 +131,7 @@ class InputNegativeIntegerTest { title = "Label", inputText = "", supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NEGATIVE_INTEGER").assertExists() @@ -144,6 +150,7 @@ class InputNegativeIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NEGATIVE_INTEGER").assertExists() @@ -163,6 +170,7 @@ class InputNegativeIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NEGATIVE_INTEGER").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNumberTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNumberTest.kt index 6bace7313..a7645c247 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNumberTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputNumberTest.kt @@ -30,6 +30,7 @@ class InputNumberTest { InputNumber( title = "Label", modifier = Modifier.testTag("INPUT_NUMBER"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NUMBER").assertExists() @@ -50,6 +51,7 @@ class InputNumberTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NUMBER").assertExists() @@ -83,6 +85,7 @@ class InputNumberTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NUMBER").assertExists() @@ -105,6 +108,7 @@ class InputNumberTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NUMBER").assertExists() @@ -122,6 +126,7 @@ class InputNumberTest { modifier = Modifier.testTag("INPUT_NUMBER"), inputText = "", legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NUMBER").assertExists() @@ -137,6 +142,7 @@ class InputNumberTest { modifier = Modifier.testTag("INPUT_NUMBER"), inputText = "", supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NUMBER").assertExists() @@ -156,6 +162,7 @@ class InputNumberTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_NUMBER").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPercentageTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPercentageTest.kt index e8598ec95..5d5ae0dd7 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPercentageTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPercentageTest.kt @@ -27,6 +27,7 @@ class InputPercentageTest { rule.setContent { InputPercentage( title = "Label", + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_PERCENTAGE").assertExists() @@ -46,6 +47,7 @@ class InputPercentageTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_PERCENTAGE").assertExists() @@ -77,6 +79,7 @@ class InputPercentageTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_PERCENTAGE").assertExists() @@ -98,6 +101,7 @@ class InputPercentageTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_PERCENTAGE").assertExists() @@ -113,6 +117,7 @@ class InputPercentageTest { title = "Label", inputText = "", legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_PERCENTAGE").assertExists() @@ -127,6 +132,7 @@ class InputPercentageTest { title = "Label", inputText = "", supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_PERCENTAGE").assertExists() @@ -145,6 +151,7 @@ class InputPercentageTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_PERCENTAGE").assertExists() @@ -164,6 +171,7 @@ class InputPercentageTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_PERCENTAGE").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPhoneNumberTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPhoneNumberTest.kt index c311b8a03..465a6fc54 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPhoneNumberTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPhoneNumberTest.kt @@ -33,6 +33,7 @@ class InputPhoneNumberTest { onCallActionClicked = { // no-op }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_PHONE_NUMBER_FIELD").assertTextEquals("") @@ -89,6 +90,7 @@ class InputPhoneNumberTest { onCallActionClicked = { // no-op }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_PHONE_NUMBER_RESET_BUTTON").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveIntegerOrZeroTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveIntegerOrZeroTest.kt index 45069ad3b..35224b3ae 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveIntegerOrZeroTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveIntegerOrZeroTest.kt @@ -27,6 +27,7 @@ class InputPositiveIntegerOrZeroTest { rule.setContent { InputPositiveIntegerOrZero( title = "Label", + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER_OR_ZERO").assertExists() @@ -46,6 +47,7 @@ class InputPositiveIntegerOrZeroTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER_OR_ZERO").assertExists() @@ -77,6 +79,7 @@ class InputPositiveIntegerOrZeroTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER_OR_ZERO").assertExists() @@ -98,6 +101,7 @@ class InputPositiveIntegerOrZeroTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER_OR_ZERO").assertExists() @@ -114,6 +118,7 @@ class InputPositiveIntegerOrZeroTest { title = "Label", inputText = "", legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER_OR_ZERO").assertExists() @@ -128,6 +133,7 @@ class InputPositiveIntegerOrZeroTest { title = "Label", inputText = "", supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER_OR_ZERO").assertExists() @@ -146,6 +152,7 @@ class InputPositiveIntegerOrZeroTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER_OR_ZERO").assertExists() @@ -165,6 +172,7 @@ class InputPositiveIntegerOrZeroTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER_OR_ZERO").assertExists() @@ -184,6 +192,7 @@ class InputPositiveIntegerOrZeroTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER_OR_ZERO").assertExists() @@ -203,6 +212,7 @@ class InputPositiveIntegerOrZeroTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER_OR_ZERO").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveIntegerTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveIntegerTest.kt index d329b4bc9..1a2663dab 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveIntegerTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputPositiveIntegerTest.kt @@ -27,6 +27,7 @@ class InputPositiveIntegerTest { rule.setContent { InputPositiveInteger( title = "Label", + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER").assertExists() @@ -46,6 +47,7 @@ class InputPositiveIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER").assertExists() @@ -77,6 +79,7 @@ class InputPositiveIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER").assertExists() @@ -98,6 +101,7 @@ class InputPositiveIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER").assertExists() @@ -114,6 +118,7 @@ class InputPositiveIntegerTest { title = "Label", inputText = "", legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER").assertExists() @@ -128,6 +133,7 @@ class InputPositiveIntegerTest { title = "Label", inputText = "", supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER").assertExists() @@ -146,6 +152,7 @@ class InputPositiveIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER").assertExists() @@ -165,6 +172,7 @@ class InputPositiveIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER").assertExists() @@ -184,6 +192,7 @@ class InputPositiveIntegerTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_POSITIVE_INTEGER").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputQRCodeTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputQRCodeTest.kt index 9d0c655d2..ae5084e14 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputQRCodeTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputQRCodeTest.kt @@ -33,6 +33,7 @@ class InputQRCodeTest { onQRButtonClicked = { // no-op }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_QR_CODE").assertExists() @@ -54,6 +55,7 @@ class InputQRCodeTest { onQRButtonClicked = { // no-op }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_QR_CODE").assertExists() @@ -79,6 +81,7 @@ class InputQRCodeTest { onQRButtonClicked = { // no-op }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_QR_CODE").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputRadioButtonTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputRadioButtonTest.kt index 8e8164115..095cabc62 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputRadioButtonTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputRadioButtonTest.kt @@ -40,6 +40,7 @@ class InputRadioButtonTest { onItemChange = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("RADIO_BUTTON_INPUT").assertExists() @@ -66,6 +67,7 @@ class InputRadioButtonTest { onItemChange = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("RADIO_BUTTON_INPUT").assertExists() @@ -119,6 +121,7 @@ class InputRadioButtonTest { onItemChange = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("RADIO_BUTTON_INPUT").assertExists() @@ -143,6 +146,7 @@ class InputRadioButtonTest { onItemChange = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("RADIO_BUTTON_INPUT").assertExists() @@ -194,6 +198,7 @@ class InputRadioButtonTest { onItemChange = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("RADIO_BUTTON_INPUT").assertExists() @@ -216,6 +221,7 @@ class InputRadioButtonTest { radioButtonData = radioButtonData, legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), onItemChange = {}, + state = InputShellState.UNFOCUSED, ) } @@ -237,6 +243,7 @@ class InputRadioButtonTest { radioButtonData = radioButtonData, supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), onItemChange = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("RADIO_BUTTON_INPUT").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputTextTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputTextTest.kt index aea27a9cc..96b70ae2f 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputTextTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputTextTest.kt @@ -30,6 +30,7 @@ class InputTextTest { InputText( title = "Label", modifier = Modifier.testTag("INPUT_TEXT"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_TEXT").assertExists() @@ -50,6 +51,7 @@ class InputTextTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_TEXT").assertExists() @@ -83,6 +85,7 @@ class InputTextTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_TEXT").assertExists() @@ -105,6 +108,7 @@ class InputTextTest { inputValue = it } }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_TEXT").assertExists() @@ -122,6 +126,7 @@ class InputTextTest { modifier = Modifier.testTag("INPUT_TEXT"), inputText = "Input", legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_TEXT").assertExists() @@ -137,6 +142,7 @@ class InputTextTest { modifier = Modifier.testTag("INPUT_TEXT"), inputText = "Input", supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_TEXT").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesNoFieldTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesNoFieldTest.kt index 3cf0641f2..365d99d72 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesNoFieldTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesNoFieldTest.kt @@ -34,6 +34,7 @@ class InputYesNoFieldTest { onItemChange = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_NO_FIELD").assertExists() @@ -54,6 +55,7 @@ class InputYesNoFieldTest { onItemChange = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_NO_FIELD").assertExists() @@ -95,6 +97,7 @@ class InputYesNoFieldTest { onItemChange = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_NO_FIELD").assertExists() @@ -109,6 +112,7 @@ class InputYesNoFieldTest { modifier = Modifier.testTag("INPUT_YES_NO_FIELD"), onItemChange = { }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_NO_FIELD").assertExists() @@ -148,6 +152,7 @@ class InputYesNoFieldTest { onItemChange = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_NO_FIELD").assertExists() @@ -164,6 +169,7 @@ class InputYesNoFieldTest { title = "Label", legendData = LegendData(SurfaceColor.CustomGreen, "Legend"), onItemChange = {}, + state = InputShellState.UNFOCUSED, ) } @@ -179,6 +185,7 @@ class InputYesNoFieldTest { title = "Label", supportingText = listOf(SupportingTextData("Supporting text", SupportingTextState.DEFAULT)), onItemChange = {}, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_NO_FIELD").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlyCheckBoxTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlyCheckBoxTest.kt index dbafe49f1..679d3dcf5 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlyCheckBoxTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlyCheckBoxTest.kt @@ -27,7 +27,7 @@ class InputYesOnlyCheckBoxTest { @Test fun shouldDisplayInputYesOnlyCheckBoxCorrectly() { rule.setContent { - var checkboxData by rememberSaveable { + val checkboxData by rememberSaveable { mutableStateOf(CheckBoxData(uid = "0", checked = false, enabled = true, textInput = "Label")) } InputYesOnlyCheckBox( @@ -35,6 +35,7 @@ class InputYesOnlyCheckBoxTest { modifier = Modifier.testTag("INPUT_YES_ONLY_CHECKBOX"), onClick = { }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_ONLY_CHECKBOX").assertExists() @@ -54,6 +55,7 @@ class InputYesOnlyCheckBoxTest { onClick = { checkboxData = checkboxData.copy(checked = !checkboxData.checked) }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_ONLY_CHECKBOX").assertExists() @@ -95,6 +97,7 @@ class InputYesOnlyCheckBoxTest { onClick = { checkboxData = checkboxData.copy(enabled = !checkboxData.enabled) }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_ONLY_CHECKBOX").assertExists() @@ -114,6 +117,7 @@ class InputYesOnlyCheckBoxTest { onClick = { checkboxData = checkboxData.copy(enabled = !checkboxData.enabled) }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_ONLY_CHECKBOX").assertExists() diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlySwitchTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlySwitchTest.kt index 6350700fe..a32d4a1f1 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlySwitchTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputYesOnlySwitchTest.kt @@ -34,6 +34,7 @@ class InputYesOnlySwitchTest { onClick = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_ONLY_SWITCH").assertExists() @@ -54,6 +55,7 @@ class InputYesOnlySwitchTest { onClick = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_ONLY_SWITCH").assertExists() @@ -94,6 +96,7 @@ class InputYesOnlySwitchTest { onClick = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } @@ -115,6 +118,7 @@ class InputYesOnlySwitchTest { onClick = { selectedItem = it }, + state = InputShellState.UNFOCUSED, ) } rule.onNodeWithTag("INPUT_YES_ONLY_SWITCH").assertExists()