@eohjsc/react-native-smart-city 0.3.36 → 0.3.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commons/Action/__test__/ItemQuickAction.test.js +36 -32
- package/src/commons/ActionGroup/ColorPickerTemplate.js +61 -23
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/ItemPasscode.test.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +2 -2
- package/src/commons/ActionGroup/SliderRangeTemplate.js +35 -20
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/CircleButton.test.js +12 -12
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/ControlPlay.test.js +10 -10
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/RectangleButton.test.js +7 -7
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/SmartTiviActionTemplate.test.js +23 -23
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +1 -3
- package/src/commons/ActionGroup/__test__/ColorPickerTemplate.test.js +1 -1
- package/src/commons/ActionGroup/__test__/CurtainButtonTemplate.test.js +4 -4
- package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +14 -14
- package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +12 -12
- package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +2 -2
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +10 -10
- package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +2 -2
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +7 -7
- package/src/commons/ActionGroup/__test__/SliderRangeTemplate.test.js +1 -1
- package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +2 -2
- package/src/commons/ActionGroup/__test__/ThreeButtonTemplate.test.js +2 -2
- package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +3 -3
- package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +2 -2
- package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +14 -14
- package/src/commons/ActionGroup/__test__/index.test.js +41 -41
- package/src/commons/ActionTemplate/OnOffButtonAction.js +6 -4
- package/src/commons/ActionTemplate/OnOffSimpleAction.js +9 -3
- package/src/commons/ActionTemplate/OnOffSmartLockAction.js +12 -10
- package/src/commons/ActionTemplate/__test__/OnOffButtonAction.test.js +3 -3
- package/src/commons/ActionTemplate/__test__/OnOffSimpleAction.test.js +3 -3
- package/src/commons/ActionTemplate/__test__/OneButtonAction.test.js +3 -3
- package/src/commons/ActionTemplate/__test__/ThreeButtonAction.test.js +3 -3
- package/src/commons/ActionTemplate/__test__/index.test.js +6 -6
- package/src/commons/ActionTemplate/index.js +15 -3
- package/src/commons/Alert/__test__/Alert.test.js +2 -2
- package/src/commons/AlertAction/__test__/AlertAction.test.js +2 -2
- package/src/commons/Auth/__test__/AccountItem.test.js +4 -4
- package/src/commons/Auth/__test__/AccountList.test.js +4 -4
- package/src/commons/Auth/__test__/OtpInputList.test.js +20 -16
- package/src/commons/Auth/__test__/SocialButton.test.js +6 -6
- package/src/commons/Automate/__test__/ItemAutomate.test.js +2 -2
- package/src/commons/Automate/__test__/ItemScriptAction.test.js +2 -2
- package/src/commons/BackDefault/__test__/BackDefault.test.js +2 -2
- package/src/commons/Button/__test__/Button.test.js +3 -3
- package/src/commons/ButtonPopup/__test__/ButtonPopup.test.js +2 -2
- package/src/commons/Calendar/__test__/Calendar.test.js +2 -2
- package/src/commons/ChartLoading/__test__/ChartLoading.test.js +2 -2
- package/src/commons/CircleButton/__test__/CircleButton.test.js +2 -2
- package/src/commons/CircleView/__test__/CircleView.test.js +2 -2
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +3 -3
- package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +2 -2
- package/src/commons/DateTimeRangeChange/__test__/DateTimeButton.test.js +4 -4
- package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +5 -5
- package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +2 -2
- package/src/commons/Device/Hanet/ItemHanetDevice.test.js +5 -5
- package/src/commons/Device/LinearChart/LinearChart.test.js +2 -2
- package/src/commons/Device/RainningSensor/__test__/CurrentRainSensor.test.js +6 -6
- package/src/commons/Device/SonosSpeaker/__test__/SonosSpeaker.test.js +8 -8
- package/src/commons/Device/WindDirection/Compass/Compass.test.js +4 -4
- package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +2 -2
- package/src/commons/Device/WindSpeed/LinearChart/__test__/ValueBalloon.test.js +2 -2
- package/src/commons/Device/WindSpeed/__test__/Anemometer.test.js +4 -4
- package/src/commons/Device/WindSpeed/__test__/ChartInfo.test.js +5 -5
- package/src/commons/Device/__test__/ConnectedViewHeader.test.js +6 -6
- package/src/commons/Device/__test__/DeviceAlertStatus.test.js +6 -6
- package/src/commons/Device/__test__/DisconnectedView.test.js +12 -12
- package/src/commons/Device/__test__/FlatListItems.test.js +2 -2
- package/src/commons/Device/__test__/FooterInfo.test.js +2 -2
- package/src/commons/Device/__test__/SensorConnectedStatus.test.js +2 -2
- package/src/commons/DisplayChecking/__test__/DisplayChecking.test.js +2 -2
- package/src/commons/Explore/SearchBox/__test__/SearchBox.test.js +6 -6
- package/src/commons/Explore/__test__/CityItem.test.js +6 -6
- package/src/commons/Explore/__test__/HeaderExplore.test.js +2 -2
- package/src/commons/Explore/__test__/HeaderLabel.test.js +3 -3
- package/src/commons/Explore/__test__/LocationItem.test.js +3 -3
- package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +4 -4
- package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +2 -2
- package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +1 -1
- package/src/commons/Form/__test__/CurrencyInput.test.js +12 -12
- package/src/commons/Form/__test__/TextInput.test.js +4 -4
- package/src/commons/Form/__test__/TextInputPassword.test.js +5 -5
- package/src/commons/FourButtonFilterHistory/__test__/FourButtonFilterHistory.test.js +1 -1
- package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +12 -10
- package/src/commons/Header/__test__/HeaderCT.test.js +11 -11
- package/src/commons/ImageButton/__test__/ImageButton.test.js +2 -2
- package/src/commons/ImagePicker/__test__/ImagePicker.test.js +8 -8
- package/src/commons/MediaPlayerDetail/__test__/MediaPlayerDetail.test.js +1 -1
- package/src/commons/MediaPlayerDetail/__test__/MediaPlayerFull.test.js +8 -8
- package/src/commons/MenuActionAddnew/__test__/MenuActionAddNew.test.js +3 -3
- package/src/commons/MenuActionList/__test__/MenuActionList.test.js +3 -3
- package/src/commons/MenuActionMore/__test__/MenuActionMore.test.js +2 -2
- package/src/commons/Modal/__test__/ModalBottom.test.js +4 -4
- package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +39 -13
- package/src/commons/OneTapTemplate/OptionsDropdownActionTemplate.js +33 -14
- package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +9 -4
- package/src/commons/OneTapTemplate/__test__/NumberUpDownActionTemplate.test.js +25 -12
- package/src/commons/OneTapTemplate/__test__/OptionsDropdownActionTemplate.test.js +13 -13
- package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +7 -7
- package/src/commons/PreventAccess/__test__/PreventAccess.test.js +7 -5
- package/src/commons/Processing/__test__/Connecting.test.js +61 -25
- package/src/commons/Processing/index.js +21 -7
- package/src/commons/RowItem/__test__/RowItem.test.js +2 -2
- package/src/commons/RowUser/__test__/RowUser.test.js +2 -2
- package/src/commons/SearchLocation/__test__/RowLocation.test.js +4 -4
- package/src/commons/Section/Section.test.js +4 -4
- package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +3 -3
- package/src/commons/SelectSubUnit/index.js +1 -1
- package/src/commons/SelectUnit/__test__/SelectUnit.test.js +3 -3
- package/src/commons/SelectUnit/index.js +3 -4
- package/src/commons/Sharing/__test__/BtnRemoveMember.test.js +3 -3
- package/src/commons/Sharing/__test__/ButtonRemoveMember.test.js +2 -2
- package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +3 -3
- package/src/commons/Sharing/__test__/MemberList.test.js +8 -8
- package/src/commons/Sharing/__test__/RowMember.test.js +4 -4
- package/src/commons/Sharing/__test__/StationDevicePermission.test.js +7 -7
- package/src/commons/Sharing/__test__/WrapHeaderScrollable.test.js +6 -6
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +6 -6
- package/src/commons/SubUnit/__test__/Favorites.test.js +3 -3
- package/src/commons/SubUnit/__test__/Item.test.js +4 -4
- package/src/commons/SubUnit/__test__/ShortDetail.test.js +16 -16
- package/src/commons/SummaryItem/__test__/SummaryItem.test.js +7 -7
- package/src/commons/Tabbar/__test__/index.test.js +1 -1
- package/src/commons/TextButton/__test__/TextButton.test.js +6 -6
- package/src/commons/Today/__test__/Today.test.js +2 -2
- package/src/commons/TouchableScale/__test__/TouchableScale.test.js +5 -5
- package/src/commons/Unit/__test__/HeaderUnit.test.js +3 -3
- package/src/commons/Unit/__test__/SharedUnit.test.js +13 -13
- package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +25 -25
- package/src/commons/UnitSummary/ConfigHistoryChart/__test__/ConfigHistoryChart.test.js +258 -25
- package/src/commons/UnitSummary/ConfigHistoryChart/index.js +90 -1
- package/src/commons/UnitSummary/__test__/TotalPowerBox.test.js +2 -2
- package/src/commons/UnitSummary/__test__/TotalPowerConsumption.test.js +2 -2
- package/src/commons/ViewButtonBottom/__test__/ViewButtonBottom.test.js +3 -3
- package/src/commons/WheelDateTimePicker/__test__/index.test.js +2 -2
- package/src/commons/WrapParallaxScrollView/index.js +2 -1
- package/src/configs/API.js +6 -2
- package/src/configs/AccessibilityLabel.js +5 -0
- package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +2 -2
- package/src/hooks/Common/__test__/useStatusbar.test.js +4 -4
- package/src/hooks/Common/__test__/useTranslations.test.js +1 -1
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +7 -7
- package/src/hooks/IoT/useRemoteControl.js +0 -1
- package/src/iot/RemoteControl/__test__/Bluetooth.test.js +17 -17
- package/src/iot/RemoteControl/__test__/Internet.test.js +4 -4
- package/src/screens/AQIGuide/__test__/AQIGuide.test.js +3 -3
- package/src/screens/ActivityLog/__test__/FilterPopup.test.js +2 -2
- package/src/screens/ActivityLog/__test__/ItemLog.test.js +21 -21
- package/src/screens/ActivityLog/hooks/__test__/index.test.js +1 -1
- package/src/screens/AddCommon/SelectUnit.js +1 -1
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +4 -4
- package/src/screens/AddCommon/__test__/SelectUnit.test.js +11 -6
- package/src/screens/AddLocationMaps/__test__/index.test.js +6 -6
- package/src/screens/AddNewAction/Device/__test__/index.test.js +3 -3
- package/src/screens/AddNewAction/SelectAction.js +6 -1
- package/src/screens/AddNewAction/__test__/SelectAction.test.js +128 -20
- package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +10 -10
- package/src/screens/AddNewAction/__test__/SetupSensor.test.js +8 -8
- package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +2 -2
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +8 -8
- package/src/screens/AddNewDevice/__test__/ConnectingDevices.test.js +8 -8
- package/src/screens/AddNewGateway/ConnectingDevice.js +29 -7
- package/src/screens/AddNewGateway/ConnectingWifiGuide.js +2 -2
- package/src/screens/AddNewGateway/ConnectingZigbeeDevice.js +3 -2
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +5 -5
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +6 -6
- package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +9 -9
- package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +4 -4
- package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +4 -4
- package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +4 -4
- package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +4 -4
- package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +2 -2
- package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +6 -6
- package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +2 -2
- package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +2 -2
- package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +6 -6
- package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +4 -4
- package/src/screens/AllCamera/__test__/index.test.js +2 -2
- package/src/screens/Automate/__test__/Loading.test.js +2 -2
- package/src/screens/Automate/__test__/MultiUnits.test.js +10 -10
- package/src/screens/Automate/__test__/index.test.js +3 -3
- package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +2 -2
- package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +4 -4
- package/src/screens/Device/__test__/DetailHistoryChart.test.js +2 -2
- package/src/screens/Device/__test__/detail.test.js +14 -14
- package/src/screens/Device/detail.js +10 -3
- package/src/screens/Device/utils/index.test.js +4 -4
- package/src/screens/Drawer/Drawer.test.js +1 -1
- package/src/screens/EditActionsList/__tests__/index.test.js +5 -5
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +15 -15
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +19 -19
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +12 -12
- package/src/screens/EmergencySetting/__test__/DropDownItem.test.js +7 -7
- package/src/screens/EmergencySetting/__test__/index.test.js +3 -3
- package/src/screens/EnterPassword/__test__/EnterPassword.test.js +12 -12
- package/src/screens/Explore/__test__/Explore.test.js +3 -3
- package/src/screens/GuestInfo/__test__/index.test.js +3 -3
- package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +2 -2
- package/src/screens/HanetCamera/__test__/Detail.test.js +2 -2
- package/src/screens/HanetCamera/__test__/ManageAccess.test.js +5 -5
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +5 -5
- package/src/screens/HanetCamera/hooks/__test__/useHanetCheckinData.test.js +6 -6
- package/src/screens/HanetCamera/hooks/__test__/useHanetPlaceMembers.test.js +3 -3
- package/src/screens/ManageAccess/hooks/__test__/useManageAccess.test.js +11 -7
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +1 -1
- package/src/screens/Notification/__test__/Notification.test.js +5 -5
- package/src/screens/Notification/__test__/NotificationItem.test.js +41 -41
- package/src/screens/PlayBackCamera/__test__/Timer.test.js +3 -3
- package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +7 -7
- package/src/screens/ScriptDetail/__test__/index.test.js +31 -31
- package/src/screens/SetSchedule/__test__/SelectWeekday.test.js +1 -1
- package/src/screens/SetSchedule/__test__/index.test.js +4 -4
- package/src/screens/SharedUnit/__test__/ShareUnit.test.js +2 -2
- package/src/screens/SharedUnit/__test__/TabHeader.test.js +3 -3
- package/src/screens/Sharing/Components/__test__/DeviceItem.test.js +4 -4
- package/src/screens/Sharing/Components/__test__/ItemChangeRole.test.js +4 -4
- package/src/screens/Sharing/Components/__test__/TitleCheckBox.test.js +4 -4
- package/src/screens/Sharing/__test__/MemberList.test.js +1 -1
- package/src/screens/Sharing/__test__/MemberList2.test.js +1 -1
- package/src/screens/Sharing/__test__/SelectPermission.test.js +41 -41
- package/src/screens/Sharing/__test__/SelectUser.test.js +14 -14
- package/src/screens/SideMenuDetail/__test__/index.test.js +25 -4
- package/src/screens/SideMenuDetail/index.js +32 -19
- package/src/screens/SmartAccount/ListDevice/__test__/DeviceItem.test.js +3 -3
- package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +13 -21
- package/src/screens/SmartAccount/ListDevice/index.js +1 -0
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/DeviceItem.test.js +6 -6
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +6 -5
- package/src/screens/SmartAccount/SuccessfullyConnected/index.js +1 -0
- package/src/screens/SmartAccount/__test__/Connecting.test.js +4 -4
- package/src/screens/SmartAccount/__test__/SmartAccount.test.js +17 -17
- package/src/screens/SmartIr/__test__/ButtonsBottom.test.js +2 -2
- package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +12 -12
- package/src/screens/SmartIr/__test__/SelectBrand.test.js +5 -5
- package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +5 -5
- package/src/screens/SmartIr/__test__/SmartIr.test.js +5 -5
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +12 -12
- package/src/screens/SubUnit/__test__/Detail.test.js +6 -6
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +44 -44
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +6 -6
- package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +5 -5
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +10 -10
- package/src/screens/TDSGuide/__test__/TDSGuide.test.js +3 -3
- package/src/screens/UVIndexGuide/__test__/UVIndexGuide.test.js +3 -3
- package/src/screens/Unit/ManageUnit.js +4 -45
- package/src/screens/Unit/ManageUnitStyles.js +5 -35
- package/src/screens/Unit/Station/__test__/index.test.js +1 -1
- package/src/screens/Unit/Summaries.js +11 -20
- package/src/screens/Unit/__test__/AddMenu.test.js +8 -8
- package/src/screens/Unit/__test__/CheckSendEmail.test.js +3 -3
- package/src/screens/Unit/__test__/ChooseLocation.test.js +2 -2
- package/src/screens/Unit/__test__/Detail.test.js +17 -17
- package/src/screens/Unit/__test__/ManageUnit.test.js +17 -17
- package/src/screens/Unit/__test__/MyAllUnit.test.js +5 -5
- package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +4 -4
- package/src/screens/Unit/__test__/SelectAddress.test.js +10 -10
- package/src/screens/Unit/__test__/SmartAccount.test.js +4 -4
- package/src/screens/Unit/__test__/SmartAccountItem.test.js +1 -1
- package/src/screens/Unit/__test__/Summaries.test.js +2 -2
- package/src/screens/Unit/components/ButtonWrapper/index.js +60 -0
- package/src/screens/Unit/components/ButtonWrapper/styles.js +37 -0
- package/src/screens/Unit/components/MyAllUnit/__test__/Header.test.js +19 -19
- package/src/screens/Unit/components/MyAllUnit/__test__/MyAllUnit.test.js +3 -3
- package/src/screens/Unit/components/MyAllUnit/__test__/index.test.js +4 -4
- package/src/screens/Unit/components/__test__/Header.test.js +12 -12
- package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
- package/src/screens/Unit/components/__test__/SharedUnit.test.js +6 -6
- package/src/screens/UnitSummary/__test__/index.test.js +24 -24
- package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +3 -3
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/ItemPower.test.js +3 -3
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +5 -5
- package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +3 -3
- package/src/screens/UnitSummary/components/Temperature/__test__/ChartAverage.test.js +3 -3
- package/src/screens/UnitSummary/components/Temperature/__test__/ItemAverage.test.js +3 -3
- package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +18 -18
- package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +12 -12
- package/src/screens/UnitSummary/components/__test__/TotalPowerBox.test.js +2 -2
- package/src/screens/UnitSummary/components/__test__/TotalPowerConsumption.test.js +2 -2
- package/src/screens/UnitSummary/components/__test__/UnitSummary.test.js +8 -8
- package/src/screens/UnitSummary/components/__test__/index.test.js +5 -5
- package/src/screens/WaterQualityGuide/__test__/index.test.js +12 -12
- package/src/utils/Apis/axios.js +22 -0
- package/src/utils/Converter/__test__/array.test.js +1 -1
- package/src/utils/Converter/__test__/url.test.js +1 -1
- package/src/utils/Functions/__test__/Search.test.js +1 -1
- package/src/utils/Functions/__test__/ShortEmail.test.js +1 -1
- package/src/utils/I18n/translations/en.json +3 -1
- package/src/utils/I18n/translations/vi.json +3 -1
- package/src/utils/__test__/InitData.test.js +2 -2
- package/src/utils/__test__/Utils.test.js +2 -2
- package/src/commons/UnitSummary/ConfigHistoryChart.js +0 -105
- package/src/screens/AddNewDevice/hooks/ConnectDevices.js +0 -67
- package/src/screens/AddNewDevice/hooks/useStateAlertRename.js +0 -32
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/__test__/index.test.js +0 -63
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/index.js +0 -53
|
@@ -24,36 +24,36 @@ describe('Test HeaderCustom', () => {
|
|
|
24
24
|
showPopoverWithRef: mockShowPopoverWithRef,
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
it('Test not render right', () => {
|
|
28
|
-
act(() => {
|
|
29
|
-
tree = create(wrapComponent(defaultProps));
|
|
27
|
+
it('Test not render right', async () => {
|
|
28
|
+
await act(async () => {
|
|
29
|
+
tree = await create(wrapComponent(defaultProps));
|
|
30
30
|
});
|
|
31
31
|
const instance = tree.root;
|
|
32
32
|
const TouchableOpacityElement = instance.findAllByType(TouchableOpacity);
|
|
33
33
|
expect(TouchableOpacityElement).toHaveLength(1);
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
it('Test render right', () => {
|
|
36
|
+
it('Test render right', async () => {
|
|
37
37
|
defaultProps = { ...defaultProps, isShowRight: true };
|
|
38
|
-
act(() => {
|
|
39
|
-
tree = create(wrapComponent(defaultProps));
|
|
38
|
+
await act(async () => {
|
|
39
|
+
tree = await create(wrapComponent(defaultProps));
|
|
40
40
|
});
|
|
41
41
|
const instance = tree.root;
|
|
42
42
|
const TouchableOpacityElement = instance.findAllByType(TouchableOpacity);
|
|
43
43
|
expect(TouchableOpacityElement).toHaveLength(3);
|
|
44
|
-
act(() => {
|
|
44
|
+
await act(async () => {
|
|
45
45
|
TouchableOpacityElement[1].props.onPress();
|
|
46
46
|
});
|
|
47
47
|
expect(mockOnRefresh).toBeCalled();
|
|
48
|
-
act(() => {
|
|
48
|
+
await act(async () => {
|
|
49
49
|
TouchableOpacityElement[2].props.onPress();
|
|
50
50
|
});
|
|
51
51
|
expect(mockShowPopoverWithRef).toBeCalled();
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
it('Test render without props', () => {
|
|
55
|
-
act(() => {
|
|
56
|
-
tree = create(wrapComponent(defaultProps));
|
|
54
|
+
it('Test render without props', async () => {
|
|
55
|
+
await act(async () => {
|
|
56
|
+
tree = await create(wrapComponent(defaultProps));
|
|
57
57
|
});
|
|
58
58
|
const instance = tree.root;
|
|
59
59
|
const TouchableOpacityElement = instance.findAllByType(TouchableOpacity);
|
|
@@ -7,8 +7,8 @@ import AddMemberIcon from '../../../../assets/images/Popover/Dashboard/AddMember
|
|
|
7
7
|
describe('Test ImageButton component', () => {
|
|
8
8
|
let tree;
|
|
9
9
|
const mockFunc = jest.fn();
|
|
10
|
-
|
|
11
|
-
act(() => {
|
|
10
|
+
it('create ImageButton', async () => {
|
|
11
|
+
await act(async () => {
|
|
12
12
|
tree = renderer.create(
|
|
13
13
|
<ImageButton
|
|
14
14
|
onPress={mockFunc}
|
|
@@ -27,9 +27,9 @@ describe('Test ImagePicker', () => {
|
|
|
27
27
|
beforeEach(() => {
|
|
28
28
|
Platform = require('react-native').Platform;
|
|
29
29
|
});
|
|
30
|
-
|
|
30
|
+
it('create ImagePicker', async () => {
|
|
31
31
|
Platform.OS = 'android';
|
|
32
|
-
act(() => {
|
|
32
|
+
await act(async () => {
|
|
33
33
|
tree = renderer.create(wrapComponent());
|
|
34
34
|
});
|
|
35
35
|
const instance = tree.root;
|
|
@@ -37,7 +37,7 @@ describe('Test ImagePicker', () => {
|
|
|
37
37
|
expect(textInputs.length).toBe(1);
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
it('create ImagePicker optionsCapture', async () => {
|
|
41
41
|
Platform.OS = 'android';
|
|
42
42
|
const options = {
|
|
43
43
|
mediaType: 'photo',
|
|
@@ -45,17 +45,17 @@ describe('Test ImagePicker', () => {
|
|
|
45
45
|
compressImageMaxHeight: 720,
|
|
46
46
|
compressImageQuality: 0.8,
|
|
47
47
|
};
|
|
48
|
-
act(() => {
|
|
48
|
+
await act(async () => {
|
|
49
49
|
tree = renderer.create(wrapComponent(options));
|
|
50
50
|
});
|
|
51
51
|
const instance = tree.root;
|
|
52
52
|
const textInputs = instance.findAllByType(ButtonPopup);
|
|
53
53
|
expect(textInputs.length).toBe(1);
|
|
54
|
-
act(() => {
|
|
54
|
+
await act(async () => {
|
|
55
55
|
textInputs[0].props.onPressMain();
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
|
-
|
|
58
|
+
it('create ImagePicker onChooseFile', async () => {
|
|
59
59
|
Platform.OS = 'android';
|
|
60
60
|
const options = {
|
|
61
61
|
mediaType: 'photo',
|
|
@@ -63,13 +63,13 @@ describe('Test ImagePicker', () => {
|
|
|
63
63
|
compressImageMaxHeight: 720,
|
|
64
64
|
compressImageQuality: 0.8,
|
|
65
65
|
};
|
|
66
|
-
act(() => {
|
|
66
|
+
await act(async () => {
|
|
67
67
|
tree = renderer.create(wrapComponent(options));
|
|
68
68
|
});
|
|
69
69
|
const instance = tree.root;
|
|
70
70
|
const textInputs = instance.findAllByType(ButtonPopup);
|
|
71
71
|
expect(textInputs.length).toBe(1);
|
|
72
|
-
act(() => {
|
|
72
|
+
await act(async () => {
|
|
73
73
|
textInputs[0].props.onPressSecondary();
|
|
74
74
|
});
|
|
75
75
|
});
|
|
@@ -20,7 +20,7 @@ const wrapComponent = () => (
|
|
|
20
20
|
describe('Test MediaPlayerDetail', () => {
|
|
21
21
|
let wrapper;
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
it('MediaPlayerDetail render when onTap setPause', async () => {
|
|
24
24
|
await act(async () => {
|
|
25
25
|
wrapper = await create(wrapComponent());
|
|
26
26
|
});
|
|
@@ -31,8 +31,8 @@ describe('Test MediaPlayerFull', () => {
|
|
|
31
31
|
useState.mockImplementationOnce((init) => [false, mockSetState]);
|
|
32
32
|
useState.mockImplementationOnce((init) => [false, mockSetState]);
|
|
33
33
|
useState.mockImplementationOnce((init) => [init, mockSetState]);
|
|
34
|
-
await act(() => {
|
|
35
|
-
tree = create(
|
|
34
|
+
await act(async () => {
|
|
35
|
+
tree = await create(
|
|
36
36
|
wrapComponent({
|
|
37
37
|
isShowFullScreenIcon: true,
|
|
38
38
|
thumbnail: { uri: 'test' },
|
|
@@ -42,11 +42,11 @@ describe('Test MediaPlayerFull', () => {
|
|
|
42
42
|
const instance = tree.root;
|
|
43
43
|
const TouchableOpacities = instance.findAllByType(TouchableOpacity);
|
|
44
44
|
expect(TouchableOpacities).toHaveLength(3);
|
|
45
|
-
act(() => {
|
|
45
|
+
await act(async () => {
|
|
46
46
|
TouchableOpacities[0].props.onPress();
|
|
47
47
|
});
|
|
48
48
|
expect(mockSetState).toBeCalledWith(false);
|
|
49
|
-
act(() => {
|
|
49
|
+
await act(async () => {
|
|
50
50
|
TouchableOpacities[1].props.onPress();
|
|
51
51
|
TouchableOpacities[2].props.onPress();
|
|
52
52
|
});
|
|
@@ -57,8 +57,8 @@ describe('Test MediaPlayerFull', () => {
|
|
|
57
57
|
useState.mockImplementationOnce((init) => [true, mockSetState]);
|
|
58
58
|
useState.mockImplementationOnce((init) => [true, mockSetState]);
|
|
59
59
|
useState.mockImplementationOnce((init) => [init, mockSetState]);
|
|
60
|
-
await act(() => {
|
|
61
|
-
tree = create(
|
|
60
|
+
await act(async () => {
|
|
61
|
+
tree = await create(
|
|
62
62
|
wrapComponent({
|
|
63
63
|
isShowFullScreenIcon: true,
|
|
64
64
|
cameraName: 'test',
|
|
@@ -70,11 +70,11 @@ describe('Test MediaPlayerFull', () => {
|
|
|
70
70
|
const instance = tree.root;
|
|
71
71
|
const TouchableOpacities = instance.findAllByType(TouchableOpacity);
|
|
72
72
|
expect(TouchableOpacities).toHaveLength(3);
|
|
73
|
-
act(() => {
|
|
73
|
+
await act(async () => {
|
|
74
74
|
TouchableOpacities[0].props.onPress();
|
|
75
75
|
});
|
|
76
76
|
expect(mockSetState).toBeCalledWith(false);
|
|
77
|
-
act(() => {
|
|
77
|
+
await act(async () => {
|
|
78
78
|
TouchableOpacities[1].props.onPress();
|
|
79
79
|
TouchableOpacities[2].props.onPress();
|
|
80
80
|
});
|
|
@@ -16,14 +16,14 @@ describe('Test MenuActionAddNew', () => {
|
|
|
16
16
|
const dataActions = [item(1), item(2)];
|
|
17
17
|
let wrapper;
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
it('onItemClick MenuActionAddNew', async () => {
|
|
20
20
|
const mockFunc = jest.fn();
|
|
21
|
-
act(() => {
|
|
21
|
+
await act(async () => {
|
|
22
22
|
wrapper = create(wrapComponent(dataActions));
|
|
23
23
|
});
|
|
24
24
|
const instance = wrapper.root;
|
|
25
25
|
const imageButtons = instance.findAllByType(ImageButton);
|
|
26
|
-
act(() => {
|
|
26
|
+
await act(async () => {
|
|
27
27
|
imageButtons[0].props.onPress();
|
|
28
28
|
});
|
|
29
29
|
expect(imageButtons.length).toEqual(2);
|
|
@@ -9,11 +9,11 @@ describe('Test MenuActionList', () => {
|
|
|
9
9
|
const listItem = [item(1)];
|
|
10
10
|
let wrapper;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
it('onItemClick MenuActionList', async () => {
|
|
13
13
|
const mockOnItemClick = jest.fn();
|
|
14
14
|
const mockHideModal = jest.fn();
|
|
15
15
|
|
|
16
|
-
act(() => {
|
|
16
|
+
await act(async () => {
|
|
17
17
|
wrapper = create(
|
|
18
18
|
<MenuActionList
|
|
19
19
|
title="Title"
|
|
@@ -26,7 +26,7 @@ describe('Test MenuActionList', () => {
|
|
|
26
26
|
const instance = wrapper.root;
|
|
27
27
|
const button = instance.findByType(TouchableOpacity);
|
|
28
28
|
|
|
29
|
-
act(() => {
|
|
29
|
+
await act(async () => {
|
|
30
30
|
button.props.onPress();
|
|
31
31
|
});
|
|
32
32
|
|
|
@@ -6,7 +6,7 @@ import MenuActionMore from '..';
|
|
|
6
6
|
describe('Test MenuActionMore', () => {
|
|
7
7
|
let wrapper;
|
|
8
8
|
const mockFunc = jest.fn();
|
|
9
|
-
|
|
9
|
+
it('render MenuActionMore', async () => {
|
|
10
10
|
let listMenuItem = [{ text: 'text' }];
|
|
11
11
|
await act(async () => {
|
|
12
12
|
wrapper = await renderer.create(
|
|
@@ -22,7 +22,7 @@ describe('Test MenuActionMore', () => {
|
|
|
22
22
|
const instance = wrapper.root;
|
|
23
23
|
const buttons = instance.findAllByType(TouchableOpacity);
|
|
24
24
|
expect(buttons.length).toEqual(1);
|
|
25
|
-
act(() => {
|
|
25
|
+
await act(async () => {
|
|
26
26
|
buttons[0].props.onPress();
|
|
27
27
|
});
|
|
28
28
|
expect(mockFunc).toHaveBeenCalled();
|
|
@@ -20,8 +20,8 @@ describe('Test ModalBottom', () => {
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
it('Test render with isVisible', async () => {
|
|
23
|
-
await act(() => {
|
|
24
|
-
tree = create(wrapComponent(true));
|
|
23
|
+
await act(async () => {
|
|
24
|
+
tree = await create(wrapComponent(true));
|
|
25
25
|
});
|
|
26
26
|
const instance = tree.root;
|
|
27
27
|
const Views = instance.findAllByType(View);
|
|
@@ -29,8 +29,8 @@ describe('Test ModalBottom', () => {
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
it('Test render without isVisible', async () => {
|
|
32
|
-
await act(() => {
|
|
33
|
-
tree = create(wrapComponent());
|
|
32
|
+
await act(async () => {
|
|
33
|
+
tree = await create(wrapComponent());
|
|
34
34
|
});
|
|
35
35
|
const instance = tree.root;
|
|
36
36
|
const Views = instance.findAllByType(View);
|
|
@@ -8,16 +8,23 @@ import { Colors } from '../../configs';
|
|
|
8
8
|
import SelectActionCard from '../SelectActionCard';
|
|
9
9
|
import Text from '../Text';
|
|
10
10
|
import { useConfigGlobalState } from '../../iot/states';
|
|
11
|
-
import { AccessibilityLabel } from '../../configs/Constants';
|
|
11
|
+
import { AccessibilityLabel, DEVICE_TYPE } from '../../configs/Constants';
|
|
12
12
|
import { ModalCustom } from '../Modal';
|
|
13
13
|
|
|
14
|
-
const NumberUpDownActionTemplate =
|
|
14
|
+
const NumberUpDownActionTemplate = ({ device, data = {}, onSelectAction }) => {
|
|
15
15
|
const t = useTranslations();
|
|
16
16
|
const [visible, setVisible] = useState(false);
|
|
17
17
|
const onClose = () => setVisible(false);
|
|
18
18
|
const onPress = () => setVisible(true);
|
|
19
19
|
const { configuration, template, title } = data;
|
|
20
|
-
const {
|
|
20
|
+
const {
|
|
21
|
+
config,
|
|
22
|
+
text_format,
|
|
23
|
+
min_value,
|
|
24
|
+
max_value,
|
|
25
|
+
action,
|
|
26
|
+
allow_config_store_value,
|
|
27
|
+
} = configuration || {};
|
|
21
28
|
const [configValues] = useConfigGlobalState('configValues');
|
|
22
29
|
const [value, setValue] = useState();
|
|
23
30
|
const [actionName, setActionName] = useState(null);
|
|
@@ -49,21 +56,40 @@ const NumberUpDownActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
49
56
|
}, [value, max_value]);
|
|
50
57
|
|
|
51
58
|
const onPressDone = useCallback(() => {
|
|
59
|
+
let data = String(value);
|
|
60
|
+
if (device?.device_type !== DEVICE_TYPE.GOOGLE_HOME) {
|
|
61
|
+
data = { temperature: value };
|
|
62
|
+
if (allow_config_store_value && config) {
|
|
63
|
+
data.config_id = config;
|
|
64
|
+
data.config_value = value;
|
|
65
|
+
}
|
|
66
|
+
} else if (device?.device_type === DEVICE_TYPE.LG_THINQ) {
|
|
67
|
+
data = {
|
|
68
|
+
temperature: {
|
|
69
|
+
targetTemperature: value,
|
|
70
|
+
unit: 'C',
|
|
71
|
+
locationName: 'FREEZER',
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
52
75
|
setActionName(text_format.replace('{number}', value));
|
|
53
76
|
onSelectAction &&
|
|
54
77
|
onSelectAction({
|
|
55
78
|
action,
|
|
56
|
-
data:
|
|
57
|
-
temperature: {
|
|
58
|
-
targetTemperature: value,
|
|
59
|
-
unit: 'C',
|
|
60
|
-
locationName: 'FREEZER',
|
|
61
|
-
},
|
|
62
|
-
},
|
|
79
|
+
data: data,
|
|
63
80
|
template,
|
|
64
81
|
});
|
|
65
82
|
onClose();
|
|
66
|
-
}, [
|
|
83
|
+
}, [
|
|
84
|
+
device?.device_type,
|
|
85
|
+
text_format,
|
|
86
|
+
value,
|
|
87
|
+
onSelectAction,
|
|
88
|
+
action,
|
|
89
|
+
template,
|
|
90
|
+
allow_config_store_value,
|
|
91
|
+
config,
|
|
92
|
+
]);
|
|
67
93
|
|
|
68
94
|
return (
|
|
69
95
|
<>
|
|
@@ -141,6 +167,6 @@ const NumberUpDownActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
141
167
|
</ModalCustom>
|
|
142
168
|
</>
|
|
143
169
|
);
|
|
144
|
-
}
|
|
170
|
+
};
|
|
145
171
|
|
|
146
|
-
export default NumberUpDownActionTemplate;
|
|
172
|
+
export default memo(NumberUpDownActionTemplate);
|
|
@@ -8,9 +8,9 @@ import styles from './OptionsDropdownActionTemplateStyles';
|
|
|
8
8
|
import { Colors } from '../../configs';
|
|
9
9
|
import SelectActionCard from '../SelectActionCard';
|
|
10
10
|
import Text from '../Text';
|
|
11
|
-
import { AccessibilityLabel } from '../../configs/Constants';
|
|
11
|
+
import { AccessibilityLabel, DEVICE_TYPE } from '../../configs/Constants';
|
|
12
12
|
|
|
13
|
-
const OptionsDropdownActionTemplate =
|
|
13
|
+
const OptionsDropdownActionTemplate = ({ device, data, onSelectAction }) => {
|
|
14
14
|
const t = useTranslations();
|
|
15
15
|
const [visible, setVisible] = useState(false);
|
|
16
16
|
const [actionName, setActionName] = useState(null);
|
|
@@ -18,29 +18,49 @@ const OptionsDropdownActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
18
18
|
const onClose = () => setVisible(false);
|
|
19
19
|
const onPress = () => setVisible(true);
|
|
20
20
|
const { title, configuration, template } = data;
|
|
21
|
-
const { options, action } = configuration;
|
|
21
|
+
const { options, action, config, allow_config_store_value } = configuration;
|
|
22
22
|
|
|
23
23
|
const handleOnPressItem = useCallback(
|
|
24
|
-
(
|
|
24
|
+
(index) => {
|
|
25
25
|
setActiveAction(index);
|
|
26
26
|
},
|
|
27
27
|
[setActiveAction]
|
|
28
28
|
);
|
|
29
29
|
|
|
30
30
|
const onPressDone = useCallback(() => {
|
|
31
|
+
const { value_text, value_int } = options[activeAction];
|
|
32
|
+
let data = { level: value_text, key_code: value_int };
|
|
33
|
+
if (allow_config_store_value && config) {
|
|
34
|
+
data.config_id = config;
|
|
35
|
+
data.config_value = value_int;
|
|
36
|
+
} else if (device?.device_type === DEVICE_TYPE.LG_THINQ) {
|
|
37
|
+
data = {
|
|
38
|
+
airFlow: {
|
|
39
|
+
windStrength: value_text,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
} else if (device?.device_type === DEVICE_TYPE.GOOGLE_HOME) {
|
|
43
|
+
data = value_text;
|
|
44
|
+
}
|
|
45
|
+
|
|
31
46
|
onSelectAction &&
|
|
32
47
|
onSelectAction({
|
|
33
48
|
action,
|
|
34
|
-
data:
|
|
35
|
-
airFlow: {
|
|
36
|
-
windStrength: options[activeAction]?.value_text,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
49
|
+
data: data,
|
|
39
50
|
template,
|
|
40
51
|
});
|
|
41
52
|
setActionName(options[activeAction]?.text);
|
|
42
53
|
setVisible(false);
|
|
43
|
-
}, [
|
|
54
|
+
}, [
|
|
55
|
+
options,
|
|
56
|
+
activeAction,
|
|
57
|
+
allow_config_store_value,
|
|
58
|
+
config,
|
|
59
|
+
device?.device_type,
|
|
60
|
+
onSelectAction,
|
|
61
|
+
action,
|
|
62
|
+
template,
|
|
63
|
+
]);
|
|
44
64
|
|
|
45
65
|
return (
|
|
46
66
|
<View>
|
|
@@ -65,7 +85,7 @@ const OptionsDropdownActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
65
85
|
<View style={styles.lineBottom} key={index}>
|
|
66
86
|
<TouchableOpacity
|
|
67
87
|
style={styles.flexRow}
|
|
68
|
-
onPress={() => handleOnPressItem(
|
|
88
|
+
onPress={() => handleOnPressItem(index)}
|
|
69
89
|
accessibilityLabel={
|
|
70
90
|
AccessibilityLabel.OPTIONS_DROPDOWN_ACTION_CHOOSING_ITEM
|
|
71
91
|
}
|
|
@@ -112,6 +132,5 @@ const OptionsDropdownActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
112
132
|
</Modal>
|
|
113
133
|
</View>
|
|
114
134
|
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export default OptionsDropdownActionTemplate;
|
|
135
|
+
};
|
|
136
|
+
export default memo(OptionsDropdownActionTemplate);
|
|
@@ -8,7 +8,7 @@ import { AccessibilityLabel } from '../../configs/Constants';
|
|
|
8
8
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
9
9
|
import { ModalCustom } from '../Modal';
|
|
10
10
|
|
|
11
|
-
const StatesGridActionTemplate =
|
|
11
|
+
const StatesGridActionTemplate = ({ device, data, onSelectAction }) => {
|
|
12
12
|
const t = useTranslations();
|
|
13
13
|
const [visible, setVisible] = useState(false);
|
|
14
14
|
const [actionName, setActionName] = useState(null);
|
|
@@ -19,11 +19,16 @@ const StatesGridActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
19
19
|
|
|
20
20
|
const hanleSelectAction = useCallback(
|
|
21
21
|
(item) => {
|
|
22
|
+
let data = null;
|
|
23
|
+
const { allow_config_store_value, config, is_on_value } = item;
|
|
24
|
+
if (allow_config_store_value && config) {
|
|
25
|
+
data = { config_id: config, config_value: is_on_value };
|
|
26
|
+
}
|
|
22
27
|
setActionName(item.text);
|
|
23
28
|
onSelectAction &&
|
|
24
29
|
onSelectAction({
|
|
25
30
|
action: item.action,
|
|
26
|
-
data:
|
|
31
|
+
data: data,
|
|
27
32
|
template,
|
|
28
33
|
});
|
|
29
34
|
setVisible(false);
|
|
@@ -64,6 +69,6 @@ const StatesGridActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
64
69
|
</ModalCustom>
|
|
65
70
|
</View>
|
|
66
71
|
);
|
|
67
|
-
}
|
|
72
|
+
};
|
|
68
73
|
|
|
69
|
-
export default StatesGridActionTemplate;
|
|
74
|
+
export default memo(StatesGridActionTemplate);
|
|
@@ -40,9 +40,9 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
40
40
|
text_format: '{number} *C',
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
act(() => {
|
|
45
|
-
tree = create(wrapComponent(data));
|
|
43
|
+
it('Test onPressDown', async () => {
|
|
44
|
+
await act(async () => {
|
|
45
|
+
tree = await create(wrapComponent(data));
|
|
46
46
|
});
|
|
47
47
|
const instance = tree.root;
|
|
48
48
|
const touchableOpacity = instance.find(
|
|
@@ -56,15 +56,15 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
56
56
|
item.props.accessibilityLabel ===
|
|
57
57
|
AccessibilityLabel.NUMBER_UP_DOWN_ACTION_TEXT && item.type === Text
|
|
58
58
|
);
|
|
59
|
-
act(() => {
|
|
59
|
+
await act(async () => {
|
|
60
60
|
touchableOpacity.props.onPress();
|
|
61
61
|
});
|
|
62
62
|
expect(textElement.props.children).toEqual('27 *C');
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
act(() => {
|
|
67
|
-
tree = create(wrapComponent(data));
|
|
65
|
+
it('Test onPressUp', async () => {
|
|
66
|
+
await act(async () => {
|
|
67
|
+
tree = await create(wrapComponent(data));
|
|
68
68
|
});
|
|
69
69
|
const instance = tree.root;
|
|
70
70
|
const touchableOpacity = instance.find(
|
|
@@ -78,15 +78,15 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
78
78
|
item.props.accessibilityLabel ===
|
|
79
79
|
AccessibilityLabel.NUMBER_UP_DOWN_ACTION_TEXT && item.type === Text
|
|
80
80
|
);
|
|
81
|
-
act(() => {
|
|
81
|
+
await act(async () => {
|
|
82
82
|
touchableOpacity.props.onPress();
|
|
83
83
|
});
|
|
84
84
|
expect(textElement.props.children).toEqual('29 *C');
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
act(() => {
|
|
89
|
-
tree = create(wrapComponent(data));
|
|
87
|
+
it('Test onPressDone', async () => {
|
|
88
|
+
await act(async () => {
|
|
89
|
+
tree = await create(wrapComponent(data));
|
|
90
90
|
});
|
|
91
91
|
const instance = tree.root;
|
|
92
92
|
const touchableOpacity = instance.find(
|
|
@@ -95,9 +95,22 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
95
95
|
AccessibilityLabel.NUMBER_UP_DOWN_ACTION_DONE &&
|
|
96
96
|
item.type === TouchableOpacity
|
|
97
97
|
);
|
|
98
|
-
act(() => {
|
|
98
|
+
await act(async () => {
|
|
99
99
|
touchableOpacity.props.onPress();
|
|
100
100
|
});
|
|
101
101
|
expect(mockOnSelectAction).toHaveBeenCalled();
|
|
102
102
|
});
|
|
103
|
+
it('Test config null show valueDefault', async () => {
|
|
104
|
+
data.configuration.config = null;
|
|
105
|
+
await act(async () => {
|
|
106
|
+
tree = await create(wrapComponent(data));
|
|
107
|
+
});
|
|
108
|
+
const instance = tree.root;
|
|
109
|
+
const textElement = instance.find(
|
|
110
|
+
(item) =>
|
|
111
|
+
item.props.accessibilityLabel ===
|
|
112
|
+
AccessibilityLabel.NUMBER_UP_DOWN_ACTION_TEXT && item.type === Text
|
|
113
|
+
);
|
|
114
|
+
expect(textElement.props.children).toEqual('28 *C');
|
|
115
|
+
});
|
|
103
116
|
});
|
|
@@ -75,9 +75,9 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
75
75
|
icon_kit: 43,
|
|
76
76
|
},
|
|
77
77
|
};
|
|
78
|
-
|
|
79
|
-
act(() => {
|
|
80
|
-
tree = create(wrapComponent(data));
|
|
78
|
+
it('Test render OptionsDropdownActionTemplate', async () => {
|
|
79
|
+
await act(async () => {
|
|
80
|
+
tree = await create(wrapComponent(data));
|
|
81
81
|
});
|
|
82
82
|
const instance = tree.root;
|
|
83
83
|
const touchOpacity = instance.findAll(
|
|
@@ -89,9 +89,9 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
89
89
|
expect(touchOpacity).toHaveLength(7);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
act(() => {
|
|
94
|
-
tree = create(wrapComponent(data));
|
|
92
|
+
it('Test handleOnPressItem', async () => {
|
|
93
|
+
await act(async () => {
|
|
94
|
+
tree = await create(wrapComponent(data));
|
|
95
95
|
});
|
|
96
96
|
const instance = tree.root;
|
|
97
97
|
const touchOpacity = instance.findAll(
|
|
@@ -102,15 +102,15 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
102
102
|
);
|
|
103
103
|
const radioCircle = instance.findAllByType(RadioCircle);
|
|
104
104
|
|
|
105
|
-
act(() => {
|
|
105
|
+
await act(async () => {
|
|
106
106
|
touchOpacity[0].props.onPress(data.configuration.options[0], 0);
|
|
107
107
|
});
|
|
108
108
|
expect(radioCircle[0].props.active).toEqual(true);
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
act(() => {
|
|
113
|
-
tree = create(wrapComponent(data));
|
|
111
|
+
it.only('Test onPressDone', async () => {
|
|
112
|
+
await act(async () => {
|
|
113
|
+
tree = await create(wrapComponent(data));
|
|
114
114
|
});
|
|
115
115
|
const instance = tree.root;
|
|
116
116
|
const selectOptions = instance.findAll(
|
|
@@ -126,9 +126,9 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
126
126
|
item.type === TouchableOpacity
|
|
127
127
|
);
|
|
128
128
|
|
|
129
|
-
act(() => {
|
|
130
|
-
selectOptions[0].props.onPress(
|
|
131
|
-
touchOpacity.props.onPress();
|
|
129
|
+
await act(async () => {
|
|
130
|
+
await selectOptions[0].props.onPress(0);
|
|
131
|
+
await touchOpacity.props.onPress();
|
|
132
132
|
});
|
|
133
133
|
expect(mockOnSelectAction).toHaveBeenCalled();
|
|
134
134
|
});
|
|
@@ -64,9 +64,9 @@ describe('Test StatesGridActionTempalte', () => {
|
|
|
64
64
|
],
|
|
65
65
|
},
|
|
66
66
|
};
|
|
67
|
-
|
|
68
|
-
act(() => {
|
|
69
|
-
tree = create(wrapComponent(data));
|
|
67
|
+
it('Test render StatesGridActionTempalte', async () => {
|
|
68
|
+
await act(async () => {
|
|
69
|
+
tree = await create(wrapComponent(data));
|
|
70
70
|
});
|
|
71
71
|
const instance = tree.root;
|
|
72
72
|
const touchOpacity = instance.findAll(
|
|
@@ -78,9 +78,9 @@ describe('Test StatesGridActionTempalte', () => {
|
|
|
78
78
|
expect(touchOpacity).toHaveLength(4);
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
act(() => {
|
|
83
|
-
tree = create(wrapComponent(data));
|
|
81
|
+
it('Test onPress hanleSelectAction', async () => {
|
|
82
|
+
await act(async () => {
|
|
83
|
+
tree = await create(wrapComponent(data));
|
|
84
84
|
});
|
|
85
85
|
const instance = tree.root;
|
|
86
86
|
const touchOpacity = instance.findAll(
|
|
@@ -91,7 +91,7 @@ describe('Test StatesGridActionTempalte', () => {
|
|
|
91
91
|
);
|
|
92
92
|
expect(touchOpacity).toHaveLength(4);
|
|
93
93
|
|
|
94
|
-
act(() => {
|
|
94
|
+
await act(async () => {
|
|
95
95
|
touchOpacity[0].props.onPress(data.configuration.options[0]);
|
|
96
96
|
});
|
|
97
97
|
expect(mockOnSelectAction).toHaveBeenCalled();
|
|
@@ -35,9 +35,11 @@ describe('Test PreventAccess.test', () => {
|
|
|
35
35
|
let visible;
|
|
36
36
|
let hidePreventAccess = () => {};
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
act(() => {
|
|
40
|
-
tree = create(
|
|
38
|
+
it('onItemClick MenuActionList', async () => {
|
|
39
|
+
await act(async () => {
|
|
40
|
+
tree = await create(
|
|
41
|
+
wrapComponent(headerBodyText, visible, hidePreventAccess)
|
|
42
|
+
);
|
|
41
43
|
});
|
|
42
44
|
const instance = tree.root;
|
|
43
45
|
const text = instance.findAllByType(Text);
|
|
@@ -50,11 +52,11 @@ describe('Test PreventAccess.test', () => {
|
|
|
50
52
|
(el) =>
|
|
51
53
|
el.props.accessibilityLabel === AccessibilityLabel.TEXT_PREVENT_ACCESS
|
|
52
54
|
);
|
|
53
|
-
act(() => {
|
|
55
|
+
await act(async () => {
|
|
54
56
|
button1.props.onBackButtonPress();
|
|
55
57
|
});
|
|
56
58
|
|
|
57
|
-
act(() => {
|
|
59
|
+
await act(async () => {
|
|
58
60
|
button2.props.onPress();
|
|
59
61
|
});
|
|
60
62
|
expect(button1).toBeDefined();
|