@eohjsc/react-native-smart-city 0.5.8 → 0.6.0-rc1
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/README.md +1 -1
- package/android/build.gradle +8 -10
- package/package.json +52 -69
- package/src/commons/Action/__test__/ItemQuickAction.test.js +2 -2
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +3 -3
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +3 -3
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +3 -3
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +3 -3
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +0 -15
- package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +2 -2
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +2 -2
- package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +2 -2
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +5 -5
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +3 -3
- package/src/commons/ActionGroup/TerminalBoxTemplate.js +2 -2
- package/src/commons/ActionGroup/TextBoxTemplate.js +2 -2
- package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonTemplate.test.js +4 -4
- package/src/commons/ActionGroup/TimerActionTemplate.js +3 -4
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +2 -2
- package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +2 -9
- package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +4 -11
- package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +2 -9
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +4 -18
- package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +2 -2
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +1 -8
- package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +0 -7
- package/src/commons/ActionGroup/__test__/SwitchButtonTemplate.test.js +4 -15
- package/src/commons/ActionGroup/__test__/TerminalBoxTemplate.test.js +0 -7
- package/src/commons/ActionGroup/__test__/TextBoxTemplate.test.js +1 -8
- package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +1 -8
- package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +1 -8
- package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +2 -9
- package/src/commons/ActionGroup/__test__/index.test.js +14 -21
- package/src/commons/ActionTemplate/__test__/index.test.js +2 -0
- package/src/commons/ActionTemplate/__test__/utils.js +21 -0
- package/src/commons/ActionTemplate/index.js +1 -2
- package/src/commons/BackDefault/index.js +2 -2
- package/src/commons/ButtonPopup/index.js +2 -2
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +1 -12
- package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +27 -20
- package/src/commons/Dashboard/MyUnit/index.js +0 -1
- package/src/commons/DateTimeRangeChange/DateTimeButton.js +2 -2
- package/src/commons/Device/ConnectedViewHeader.js +2 -2
- package/src/commons/Device/DisconnectedView.js +2 -2
- package/src/commons/Device/Emergency/EmergencyDetail.js +3 -3
- package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +2 -2
- package/src/commons/Device/FlatListItems.js +3 -3
- package/src/commons/Device/Hanet/ItemHanetDevice.js +3 -3
- package/src/commons/Device/Hanet/ItemHanetDevice.test.js +3 -11
- package/src/commons/Device/HorizontalBarChart.js +1 -1
- package/src/commons/Device/ItemAddNew/index.js +2 -2
- package/src/commons/Device/ItemDevice.js +2 -2
- package/src/commons/Device/PowerConsumptionChart.js +154 -0
- package/src/commons/Device/SonosSpeaker/index.js +3 -3
- package/src/commons/Device/WaterPurifierStatus/AlertStatusMachine.js +2 -2
- package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +2 -6
- package/src/commons/DisplayChecking/index.js +2 -2
- package/src/commons/EmergencyButton/AlertSendConfirm.js +2 -2
- package/src/commons/EmergencyButton/AlertSent.js +2 -2
- package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
- package/src/commons/Form/CurrencyInput.js +1 -15
- package/src/commons/Header/HeaderCustom.js +3 -3
- package/src/commons/HeaderAni/index.js +2 -2
- package/src/commons/IconComponent/index.js +3 -3
- package/src/commons/MenuActionAddnew/__test__/MenuActionAddNew.test.js +1 -1
- package/src/commons/MenuActionList/__test__/MenuActionList.test.js +1 -0
- package/src/commons/NavBar/index.js +2 -2
- package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +3 -3
- package/src/commons/PreventAccess/__test__/PreventAccess.test.js +1 -13
- package/src/commons/Processing/__test__/Connecting.test.js +3 -14
- package/src/commons/SearchLocation/index.js +2 -2
- package/src/commons/SelectActionCard/index.js +2 -2
- package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +1 -18
- package/src/commons/SelectSubUnit/index.js +2 -2
- package/src/commons/SelectUnit/__test__/SelectUnit.test.js +1 -13
- package/src/commons/Sharing/BtnRemoveMember.js +2 -2
- package/src/commons/Sharing/StationDevicePermissions.js +2 -2
- package/src/commons/Sharing/WrapHeaderScrollable.js +1 -1
- package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +1 -1
- package/src/commons/SubUnit/DeviceTemplate/ConfigAndEvaluation/ConfigAndEvaluation.js +2 -2
- package/src/commons/SubUnit/DeviceTemplate/ConfigValue/ConfigValue.js +2 -2
- package/src/commons/SubUnit/DeviceTemplate/EvaluationOverConfig/EvaluationOverConfig.js +2 -2
- package/src/commons/SubUnit/Item/index.js +2 -2
- package/src/commons/SubUnit/OneTap/ItemOneTap.js +2 -2
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +11 -8
- package/src/commons/SubUnit/__test__/Favorites.test.js +1 -13
- package/src/commons/SubUnit/__test__/ShortDetail.test.js +5 -16
- package/src/commons/Tabbar/__test__/index.test.js +0 -11
- package/src/commons/Unit/HeaderUnit/index.js +4 -4
- package/src/commons/Unit/SharedUnit.js +5 -5
- package/src/commons/Unit/__test__/HeaderUnit.test.js +3 -15
- package/src/commons/Unit/__test__/SharedUnit.test.js +94 -105
- package/src/commons/UnitSummary/AirQuality/SegmentedRoundDisplay/index.js +11 -30
- package/src/commons/UnitSummary/ConfigHistoryChart/index.js +6 -61
- package/src/commons/Widgets/IFrame/IFrame.js +54 -0
- package/src/commons/Widgets/IFrame/IFrameStyles.js +35 -0
- package/src/commons/Widgets/IFrame/__tests__/IFrame.test.js +74 -0
- package/src/commons/Widgets/IFrame/index.js +0 -0
- package/src/commons/Widgets/IFrameWithConfig/IFrameWithConfig.js +163 -0
- package/src/commons/Widgets/IFrameWithConfig/IFrameWithConfigStyles.js +9 -0
- package/src/commons/Widgets/IFrameWithConfig/__tests__/IFrameWithConfig.test.js +284 -0
- package/src/commons/Widgets/IFrameWithConfig/index.js +0 -0
- package/src/commons/Widgets/Widget.js +0 -0
- package/src/commons/Widgets/index.js +0 -0
- package/src/configs/Constants.js +5 -0
- package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +4 -15
- package/src/hooks/Common/useDevicesStatus.js +42 -24
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +1 -1
- package/src/hooks/IoT/__test__/useWatchConfigs.test.js +0 -7
- package/src/iot/RemoteControl/HomeAssistant.js +1 -1
- package/src/iot/RemoteControl/__test__/Bluetooth.test.js +234 -232
- package/src/navigations/AutomateStack.js +2 -2
- package/src/navigations/EmergencyContactsStack.js +2 -2
- package/src/navigations/SharedStack.js +2 -2
- package/src/navigations/UnitStack.js +2 -2
- package/src/screens/ActivityLog/hooks/index.js +7 -4
- package/src/screens/ActivityLog/index.js +2 -2
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +4 -21
- package/src/screens/AddCommon/__test__/SelectUnit.test.js +7 -19
- package/src/screens/AddLocationMaps/__test__/index.test.js +3 -13
- package/src/screens/AddLocationMaps/index.js +4 -4
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +3 -20
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +11 -18
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/ZigbeeDeviceConnectGuide.test.js +4 -21
- package/src/screens/AddNewGateway/RenameNewDevices.js +2 -2
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +3 -3
- package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +0 -17
- package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +4 -19
- package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +3 -15
- package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +31 -51
- package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +9 -22
- package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +12 -19
- package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +6 -16
- package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +4 -15
- package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +3 -3
- package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +18 -10
- package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +12 -9
- package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +12 -9
- package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +7 -21
- package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +1 -10
- package/src/screens/AllGateway/DetailConfigActionInternal/__test__/index.test.js +0 -20
- package/src/screens/AllGateway/DetailConfigActionModbus/__test__/index.test.js +7 -24
- package/src/screens/AllGateway/DeviceGatewayInfo/__test__/index.test.js +0 -17
- package/src/screens/AllGateway/DeviceInternalDetail/__test__/index.test.js +84 -100
- package/src/screens/AllGateway/DeviceModbusDetail/__test__/index.test.js +64 -82
- package/src/screens/AllGateway/DeviceZigbeeDetail/__test__/index.test.js +36 -55
- package/src/screens/AllGateway/GatewayConnectionMethods/__test__/index.test.js +9 -18
- package/src/screens/AllGateway/GatewayDetail/__test__/index.test.js +10 -37
- package/src/screens/AllGateway/GatewayInfo/__test__/index.test.js +7 -32
- package/src/screens/AllGateway/__test__/index.test.js +1 -14
- package/src/screens/AllGateway/components/GatewayItem/__test__/index.test.js +0 -12
- package/src/screens/AllGateway/components/TabPaneCT/__test__/index.test.js +1 -13
- package/src/screens/AllGateway/components/TabPaneCT/index.js +1 -1
- package/src/screens/AllGateway/hooks/__test__/index.test.js +1 -8
- package/src/screens/AllGateway/test-utils.js +1 -1
- package/src/screens/Automate/AddNewAction/NewActionWrapper.js +2 -2
- package/src/screens/Automate/AddNewAction/SetupConfigCondition.js +27 -28
- package/src/screens/Automate/AddNewAction/__test__/ChooseAction.test.js +3 -3
- package/src/screens/Automate/AddNewAction/__test__/ChooseConfig.test.js +8 -5
- package/src/screens/Automate/AddNewAction/__test__/SelectControlDevices.test.js +2 -2
- package/src/screens/Automate/AddNewAction/__test__/SelectMonitorDevices.test.js +1 -18
- package/src/screens/Automate/AddNewAction/__test__/SetupConfigCondition.test.js +17 -15
- package/src/screens/Automate/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +4 -4
- package/src/screens/Automate/EditActionsList/__tests__/UpdateActionScript.test.js +38 -55
- package/src/screens/Automate/EditActionsList/__tests__/UpdateDelayScript.test.js +0 -18
- package/src/screens/Automate/EditActionsList/__tests__/UpdateNotifyScript.test.js +1 -19
- package/src/screens/Automate/EditActionsList/__tests__/index.test.js +14 -11
- package/src/screens/Automate/OneTap/__test__/AddNewOneTap.test.js +3 -3
- package/src/screens/Automate/Scenario/__test__/AddNewOneTap.test.js +2 -2
- package/src/screens/Automate/ScriptDetail/Components/AddActionScript.js +2 -2
- package/src/screens/Automate/ScriptDetail/__test__/index.test.js +33 -25
- package/src/screens/Automate/ScriptDetail/index.js +5 -6
- package/src/screens/Automate/SetSchedule/__test__/index.test.js +4 -4
- package/src/screens/Automate/SetSchedule/components/RowItem.js +3 -3
- package/src/screens/Automate/__test__/MultiUnits.test.js +5 -5
- package/src/screens/Automate/__test__/index.test.js +6 -6
- package/src/screens/Automate/index.js +2 -2
- package/src/screens/ChangePosition/__test__/index.test.js +1 -14
- package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +0 -12
- package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +1 -11
- package/src/screens/Device/EditDevice/index.js +2 -2
- package/src/screens/Device/__test__/detail.test.js +11 -11
- package/src/screens/Device/__test__/sensorDisplayItem.test.js +3 -15
- package/src/screens/Device/components/SensorDisplayItem.js +23 -5
- package/src/screens/Device/components/__test__/VisualChart.test.js +2 -9
- package/src/screens/Device/detail.js +11 -10
- package/src/screens/Drawer/Drawer.test.js +3 -11
- package/src/screens/Drawer/index.js +3 -4
- package/src/screens/EmergencyContacts/EmergencyContactsList.js +4 -8
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +3 -3
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +4 -17
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +3 -14
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +0 -10
- package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
- package/src/screens/EnterPassword/__test__/EnterPassword.test.js +4 -17
- package/src/screens/GuestInfo/__test__/index.test.js +0 -11
- package/src/screens/GuestInfo/components/RowGuestInfo.js +2 -2
- package/src/screens/GuestInfo/index.js +2 -2
- package/src/screens/HanetCamera/Detail.js +2 -2
- package/src/screens/HanetCamera/ManageAccess.js +3 -4
- package/src/screens/HanetCamera/MemberInfo.js +4 -4
- package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +2 -16
- package/src/screens/HanetCamera/__test__/Detail.test.js +1 -12
- package/src/screens/HanetCamera/__test__/ManageAccess.test.js +5 -16
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +5 -18
- package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
- package/src/screens/ManageAccess/__test__/ManageAccess.test.js +3 -19
- package/src/screens/ManageAccess/index.js +3 -3
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +5 -5
- package/src/screens/Notification/__test__/NotificationItem.test.js +9 -19
- package/src/screens/Notification/index.js +3 -3
- package/src/screens/PlayBackCamera/Styles/index.js +2 -4
- package/src/screens/PlayBackCamera/Timer.js +65 -47
- package/src/screens/PlayBackCamera/__test__/index.test.js +32 -33
- package/src/screens/PlayBackCamera/index.js +115 -112
- package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +0 -11
- package/src/screens/ScanChipQR/components/QRScan/index.js +3 -3
- package/src/screens/SelectUnit/__test__/index.test.js +1 -21
- package/src/screens/SelectUnit/index.js +2 -2
- package/src/screens/SharedUnit/TabHeader.js +2 -2
- package/src/screens/Sharing/Components/EndDevice.js +3 -3
- package/src/screens/Sharing/UnitMemberList.js +2 -2
- package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +9 -4
- package/src/screens/Sharing/__test__/SelectShareDevice.test.js +2 -15
- package/src/screens/Sharing/__test__/SelectUser.test.js +2 -22
- package/src/screens/Sharing/__test__/UnitMemberList.test.js +2 -2
- package/src/screens/Sharing/__test__/UpdateShareDevice.test.js +4 -17
- package/src/screens/Sharing/hooks/__test__/index.test.js +2 -13
- package/src/screens/SmartAccount/Connecting/index.js +0 -2
- package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +3 -18
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +11 -21
- package/src/screens/SmartAccount/SuccessfullyConnected/index.js +3 -4
- package/src/screens/SmartAccount/__test__/Connecting.test.js +30 -36
- package/src/screens/SmartAccount/__test__/SmartAccount.test.js +12 -21
- package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +7 -17
- package/src/screens/SmartIr/__test__/SelectBrand.test.js +1 -11
- package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +1 -12
- package/src/screens/SmartIr/__test__/SmartIr.test.js +3 -11
- package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +3 -3
- package/src/screens/SmartIr/components/SelectBrand.js +2 -2
- package/src/screens/SubUnit/AddSubUnit.js +1 -0
- package/src/screens/SubUnit/EditSubUnit.js +3 -2
- package/src/screens/SubUnit/ManageSubUnit.js +4 -5
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +9 -31
- package/src/screens/SubUnit/__test__/Detail.test.js +4 -28
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +12 -30
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +2 -2
- package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +0 -12
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +7 -20
- package/src/screens/Template/__test__/EditTemplate.test.js +2 -13
- package/src/screens/Template/__test__/GatewayList.test.js +0 -9
- package/src/screens/Template/__test__/detail.test.js +4 -4
- package/src/screens/Template/__test__/index.test.js +1 -12
- package/src/screens/Template/detail.js +2 -2
- package/src/screens/Unit/SelectAddToFavorites.js +2 -2
- package/src/screens/Unit/SelectAddress.js +4 -4
- package/src/screens/Unit/SmartAccountItem.js +2 -2
- package/src/screens/Unit/Summaries.js +26 -25
- package/src/screens/Unit/__test__/AddMenu.test.js +5 -2
- package/src/screens/Unit/__test__/CheckSendEmail.test.js +0 -12
- package/src/screens/Unit/__test__/ChooseLocation.test.js +1 -4
- package/src/screens/Unit/__test__/Detail.test.js +5 -5
- package/src/screens/Unit/__test__/ManageUnit.test.js +2 -17
- package/src/screens/Unit/__test__/MoreMenu.test.js +1 -11
- package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +3 -14
- package/src/screens/Unit/__test__/SelectAddress.test.js +4 -17
- package/src/screens/Unit/__test__/SmartAccount.test.js +14 -11
- package/src/screens/Unit/__test__/SmartAccountItem.test.js +0 -11
- package/src/screens/Unit/__test__/Summaries.test.js +2 -14
- package/src/screens/Unit/components/AutomateScript/index.js +2 -2
- package/src/screens/Unit/components/ButtonWrapper/index.js +3 -4
- package/src/screens/Unit/components/Header/index.js +3 -3
- package/src/screens/Unit/components/SharedUnit/index.js +5 -5
- package/src/screens/Unit/components/__test__/Header.test.js +1 -14
- package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +1 -11
- package/src/screens/Unit/components/__test__/SharedUnit.test.js +1 -11
- package/src/screens/UnitSummary/__test__/index.test.js +51 -17
- package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +0 -12
- package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +10 -23
- package/src/screens/UnitSummary/components/AirQuality/__test__/index.test.js +1 -7
- package/src/screens/UnitSummary/components/AirQuality/index.js +3 -3
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +38 -14
- package/src/screens/UnitSummary/components/PowerConsumption/index.js +21 -30
- package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +1 -16
- package/src/screens/UnitSummary/components/Temperature/index.js +5 -1
- package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +0 -8
- package/src/screens/UnitSummary/components/UvIndex/index.js +2 -2
- package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +2 -2
- package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +14 -18
- package/src/screens/UnitSummary/index.js +4 -8
- package/src/utils/Converter/__test__/timer.test.js +8 -0
- package/src/utils/Functions/preloadImages.js +13 -14
- package/src/utils/Storage.js +1 -1
- package/src/commons/Device/HistoryChart.js +0 -225
- package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +0 -48
- package/src/commons/Device/WindSpeed/LinearChart/index.js +0 -155
- package/src/commons/UnitSummary/ConfigHistoryChart/__test__/ConfigHistoryChart.test.js +0 -289
- package/src/screens/Device/__test__/DetailHistoryChart.test.js +0 -69
- package/src/screens/Device/components/DetailHistoryChart.js +0 -118
- package/src/screens/UnitSummary/components/Temperature/ChartAverage/index.js +0 -62
- package/src/screens/UnitSummary/components/Temperature/__test__/ChartAverage.test.js +0 -17
- package/src/utils/dateHelper/getTickValues.js +0 -22
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
2
|
import { Switch, TouchableOpacity, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
import DateTimePickerModal from 'react-native-modal-datetime-picker';
|
|
5
5
|
import moment from 'moment';
|
|
6
|
-
import { IconOutline } from '@ant-design/icons-react-native';
|
|
7
6
|
import { watchMultiConfigs } from '../../iot/Monitor';
|
|
8
7
|
|
|
9
8
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
@@ -184,7 +183,7 @@ const TimerActionTemplate = ({ item = {}, doAction, sensor = {} }) => {
|
|
|
184
183
|
<Text>{title}</Text>
|
|
185
184
|
{configuration.config_hour && configuration.config_minute && (
|
|
186
185
|
<View style={styles.wrapTimer}>
|
|
187
|
-
<
|
|
186
|
+
<AntDesign style={styles.iconClockCircle} name={'clock-circle'} />
|
|
188
187
|
<Text type="Label" color={Colors.Gray7}>
|
|
189
188
|
{textTimer ? textTimer : t('set_time')}
|
|
190
189
|
</Text>
|
|
@@ -194,7 +193,7 @@ const TimerActionTemplate = ({ item = {}, doAction, sensor = {} }) => {
|
|
|
194
193
|
{configuration.config_hour && !configuration.config_minute && (
|
|
195
194
|
<View style={styles.timerButton}>
|
|
196
195
|
<Text style={styles.textTimerEndLine}>{textTimer}</Text>
|
|
197
|
-
<
|
|
196
|
+
<AntDesign name="right" size={20} />
|
|
198
197
|
</View>
|
|
199
198
|
)}
|
|
200
199
|
</TouchableOpacity>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
2
2
|
import React, { memo, useState, useCallback, useEffect } from 'react';
|
|
3
3
|
import { TouchableOpacity, View } from 'react-native';
|
|
4
4
|
|
|
@@ -122,7 +122,7 @@ const TwoButtonTemplate = memo(({ item = {}, doAction, sensor = {} }) => {
|
|
|
122
122
|
key={index}
|
|
123
123
|
>
|
|
124
124
|
<View style={styles.smallCircle}>
|
|
125
|
-
<
|
|
125
|
+
<AntDesign
|
|
126
126
|
name={button?.isCheckOnOff ? button?.icon_on : button?.icon_off}
|
|
127
127
|
size={44}
|
|
128
128
|
color={button?.isCheckOnOff ? Colors.Green7 : Colors.Gray6}
|
|
@@ -13,13 +13,6 @@ jest.mock('../../../iot/states', () => ({
|
|
|
13
13
|
useConfigGlobalState: () => [{ 5: { value: 25 } }, null],
|
|
14
14
|
}));
|
|
15
15
|
|
|
16
|
-
jest.mock('@react-navigation/native', () => {
|
|
17
|
-
return {
|
|
18
|
-
...jest.requireActual('@react-navigation/native'),
|
|
19
|
-
useFocusEffect: jest.fn(),
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
|
|
23
16
|
describe('Test NumberUpDownTemplate', () => {
|
|
24
17
|
const actionData = {
|
|
25
18
|
color: '#00979D',
|
|
@@ -27,7 +20,7 @@ describe('Test NumberUpDownTemplate', () => {
|
|
|
27
20
|
command_prefer_over_googlehome: false,
|
|
28
21
|
command_prefer_over_internet: false,
|
|
29
22
|
googlehome_actions: [],
|
|
30
|
-
icon: '
|
|
23
|
+
icon: 'caretup',
|
|
31
24
|
id: 20,
|
|
32
25
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
33
26
|
};
|
|
@@ -396,7 +389,7 @@ describe('Test NumberUpDownTemplate', () => {
|
|
|
396
389
|
command_prefer_over_googlehome: false,
|
|
397
390
|
command_prefer_over_internet: false,
|
|
398
391
|
googlehome_actions: [],
|
|
399
|
-
icon: '
|
|
392
|
+
icon: 'caretup',
|
|
400
393
|
id: 20,
|
|
401
394
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
402
395
|
},
|
|
@@ -18,13 +18,6 @@ const wrapComponent = (item, mockDoAction) => (
|
|
|
18
18
|
</SCProvider>
|
|
19
19
|
);
|
|
20
20
|
|
|
21
|
-
jest.mock('@react-navigation/native', () => {
|
|
22
|
-
return {
|
|
23
|
-
...jest.requireActual('@react-navigation/native'),
|
|
24
|
-
useFocusEffect: jest.fn(),
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
|
|
28
21
|
describe('Test OneBigButtonTemplate', () => {
|
|
29
22
|
const actionOnData = {
|
|
30
23
|
color: '#00979D',
|
|
@@ -32,7 +25,7 @@ describe('Test OneBigButtonTemplate', () => {
|
|
|
32
25
|
command_prefer_over_googlehome: false,
|
|
33
26
|
command_prefer_over_internet: false,
|
|
34
27
|
googlehome_actions: [],
|
|
35
|
-
icon: '
|
|
28
|
+
icon: 'caretup',
|
|
36
29
|
id: 20,
|
|
37
30
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
38
31
|
};
|
|
@@ -43,7 +36,7 @@ describe('Test OneBigButtonTemplate', () => {
|
|
|
43
36
|
command_prefer_over_googlehome: false,
|
|
44
37
|
command_prefer_over_internet: false,
|
|
45
38
|
googlehome_actions: [],
|
|
46
|
-
icon: '
|
|
39
|
+
icon: 'caretup',
|
|
47
40
|
id: 20,
|
|
48
41
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
49
42
|
};
|
|
@@ -51,11 +44,11 @@ describe('Test OneBigButtonTemplate', () => {
|
|
|
51
44
|
configuration: {
|
|
52
45
|
action_on: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
53
46
|
action_on_data: actionOnData,
|
|
54
|
-
icon_on: '
|
|
47
|
+
icon_on: 'caretup',
|
|
55
48
|
text_on: 'ON',
|
|
56
49
|
action_off: '5ed1d4dc-a905-47cd-b0c9-f979644bd21b',
|
|
57
50
|
action_off_data: actionOffData,
|
|
58
|
-
icon_off: '
|
|
51
|
+
icon_off: 'caretup',
|
|
59
52
|
text_off: 'OFF',
|
|
60
53
|
config: 1,
|
|
61
54
|
},
|
|
@@ -13,13 +13,6 @@ jest.mock('../../../iot/states', () => ({
|
|
|
13
13
|
useConfigGlobalState: jest.fn(),
|
|
14
14
|
}));
|
|
15
15
|
|
|
16
|
-
jest.mock('@react-navigation/native', () => {
|
|
17
|
-
return {
|
|
18
|
-
...jest.requireActual('@react-navigation/native'),
|
|
19
|
-
useFocusEffect: jest.fn(),
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
|
|
23
16
|
const wrapComponent = (item, doAction, sensor) => (
|
|
24
17
|
<SCProvider initState={mockSCStore({})}>
|
|
25
18
|
<OnOffSmartLock item={item} doAction={doAction} sensor={sensor} />
|
|
@@ -36,7 +29,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
36
29
|
command_prefer_over_googlehome: false,
|
|
37
30
|
command_prefer_over_internet: false,
|
|
38
31
|
googlehome_actions: [],
|
|
39
|
-
icon: '
|
|
32
|
+
icon: 'caretup',
|
|
40
33
|
id: 20,
|
|
41
34
|
key: 'key-2',
|
|
42
35
|
};
|
|
@@ -46,7 +39,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
46
39
|
command_prefer_over_googlehome: false,
|
|
47
40
|
command_prefer_over_internet: false,
|
|
48
41
|
googlehome_actions: [],
|
|
49
|
-
icon: '
|
|
42
|
+
icon: 'caretup',
|
|
50
43
|
id: 20,
|
|
51
44
|
key: 'key-3',
|
|
52
45
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
2
|
import { act, create } from 'react-test-renderer';
|
|
4
3
|
|
|
5
|
-
import { DEVICE_TYPE
|
|
4
|
+
import { DEVICE_TYPE } from '../../../configs/Constants';
|
|
6
5
|
import { watchMultiConfigs } from '../../../iot/Monitor';
|
|
7
6
|
import OnOffTemplate from '../OnOffTemplate';
|
|
8
7
|
import OnOffButtonTemplate from '../OnOffTemplate/OnOffButtonTemplate';
|
|
@@ -22,13 +21,6 @@ jest.mock('../../../iot/states', () => ({
|
|
|
22
21
|
useConfigGlobalState: () => [{ 5: { value: 2 } }, null],
|
|
23
22
|
}));
|
|
24
23
|
|
|
25
|
-
jest.mock('@react-navigation/native', () => {
|
|
26
|
-
return {
|
|
27
|
-
...jest.requireActual('@react-navigation/native'),
|
|
28
|
-
useFocusEffect: jest.fn(),
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
|
|
32
24
|
describe('Test OnOffTemplate', () => {
|
|
33
25
|
let displayItem;
|
|
34
26
|
let tree;
|
|
@@ -40,7 +32,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
40
32
|
command_prefer_over_googlehome: false,
|
|
41
33
|
command_prefer_over_internet: false,
|
|
42
34
|
googlehome_actions: [],
|
|
43
|
-
icon: '
|
|
35
|
+
icon: 'caretup',
|
|
44
36
|
id: 20,
|
|
45
37
|
key: 'key-1',
|
|
46
38
|
};
|
|
@@ -50,7 +42,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
50
42
|
command_prefer_over_googlehome: false,
|
|
51
43
|
command_prefer_over_internet: false,
|
|
52
44
|
googlehome_actions: [],
|
|
53
|
-
icon: '
|
|
45
|
+
icon: 'caretup',
|
|
54
46
|
id: 20,
|
|
55
47
|
key: 'key-2',
|
|
56
48
|
};
|
|
@@ -60,7 +52,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
60
52
|
command_prefer_over_googlehome: false,
|
|
61
53
|
command_prefer_over_internet: false,
|
|
62
54
|
googlehome_actions: [],
|
|
63
|
-
icon: '
|
|
55
|
+
icon: 'caretup',
|
|
64
56
|
id: 20,
|
|
65
57
|
key: 'key-3',
|
|
66
58
|
};
|
|
@@ -113,14 +105,8 @@ describe('Test OnOffTemplate', () => {
|
|
|
113
105
|
});
|
|
114
106
|
const instance = tree.root;
|
|
115
107
|
|
|
116
|
-
const templateOnOffButton = instance.findAll(
|
|
117
|
-
(el) =>
|
|
118
|
-
el.props.accessibilityLabel ===
|
|
119
|
-
AccessibilityLabel.ON_OFF_BUTTON_ACTION_TEMPLATE && el.type === View
|
|
120
|
-
);
|
|
121
108
|
const templateOnOffSimple = instance.findAllByType(OnOffSimpleTemplate);
|
|
122
109
|
|
|
123
|
-
expect(templateOnOffButton).not.toHaveLength(1);
|
|
124
110
|
expect(templateOnOffSimple).not.toHaveLength(1);
|
|
125
111
|
});
|
|
126
112
|
|
|
@@ -30,7 +30,7 @@ describe('Test OneBigButtonTemplate', () => {
|
|
|
30
30
|
command_prefer_over_googlehome: false,
|
|
31
31
|
command_prefer_over_internet: false,
|
|
32
32
|
googlehome_actions: [],
|
|
33
|
-
icon: '
|
|
33
|
+
icon: 'caretup',
|
|
34
34
|
id: 20,
|
|
35
35
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
36
36
|
};
|
|
@@ -38,7 +38,7 @@ describe('Test OneBigButtonTemplate', () => {
|
|
|
38
38
|
configuration: {
|
|
39
39
|
action: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
40
40
|
action_data: actionData,
|
|
41
|
-
icon: '
|
|
41
|
+
icon: 'caretup',
|
|
42
42
|
text: 'UP',
|
|
43
43
|
},
|
|
44
44
|
};
|
|
@@ -30,13 +30,6 @@ jest.mock('../../../iot/states', () => ({
|
|
|
30
30
|
useConfigGlobalState: () => [{ 5: { value: 2 } }, null],
|
|
31
31
|
}));
|
|
32
32
|
|
|
33
|
-
jest.mock('@react-navigation/native', () => {
|
|
34
|
-
return {
|
|
35
|
-
...jest.requireActual('@react-navigation/native'),
|
|
36
|
-
useFocusEffect: jest.fn(),
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
|
|
40
33
|
describe('Test OptionsDropdownActionTemplate', () => {
|
|
41
34
|
const actionData = {
|
|
42
35
|
color: '#00979D',
|
|
@@ -44,7 +37,7 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
44
37
|
command_prefer_over_googlehome: false,
|
|
45
38
|
command_prefer_over_internet: false,
|
|
46
39
|
googlehome_actions: [],
|
|
47
|
-
icon: '
|
|
40
|
+
icon: 'caretup',
|
|
48
41
|
id: 20,
|
|
49
42
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
50
43
|
};
|
|
@@ -8,13 +8,6 @@ import { DEVICE_TYPE } from '../../../configs/Constants';
|
|
|
8
8
|
const mockDoAction = jest.fn();
|
|
9
9
|
const mockActionData = jest.fn();
|
|
10
10
|
|
|
11
|
-
jest.mock('@react-navigation/native', () => {
|
|
12
|
-
return {
|
|
13
|
-
...jest.requireActual('@react-navigation/native'),
|
|
14
|
-
useFocusEffect: jest.fn(),
|
|
15
|
-
};
|
|
16
|
-
});
|
|
17
|
-
|
|
18
11
|
describe('Test StatesGridActionTemplate', () => {
|
|
19
12
|
let tree;
|
|
20
13
|
let displayItem;
|
|
@@ -17,13 +17,6 @@ const wrapComponent = (item, mockDoAction, isOn) => (
|
|
|
17
17
|
</SCProvider>
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
-
jest.mock('@react-navigation/native', () => {
|
|
21
|
-
return {
|
|
22
|
-
...jest.requireActual('@react-navigation/native'),
|
|
23
|
-
useFocusEffect: jest.fn(),
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
|
|
27
20
|
describe('Test SwitchButtonTemplate', () => {
|
|
28
21
|
const actionOnData = {
|
|
29
22
|
color: '#00979D',
|
|
@@ -31,7 +24,7 @@ describe('Test SwitchButtonTemplate', () => {
|
|
|
31
24
|
command_prefer_over_googlehome: false,
|
|
32
25
|
command_prefer_over_internet: false,
|
|
33
26
|
googlehome_actions: [],
|
|
34
|
-
icon: '
|
|
27
|
+
icon: 'caretup',
|
|
35
28
|
id: 20,
|
|
36
29
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
37
30
|
};
|
|
@@ -42,7 +35,7 @@ describe('Test SwitchButtonTemplate', () => {
|
|
|
42
35
|
command_prefer_over_googlehome: false,
|
|
43
36
|
command_prefer_over_internet: false,
|
|
44
37
|
googlehome_actions: [],
|
|
45
|
-
icon: '
|
|
38
|
+
icon: 'caretup',
|
|
46
39
|
id: 20,
|
|
47
40
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
48
41
|
};
|
|
@@ -50,11 +43,11 @@ describe('Test SwitchButtonTemplate', () => {
|
|
|
50
43
|
configuration: {
|
|
51
44
|
action_on: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
52
45
|
action_on_data: actionOnData,
|
|
53
|
-
icon_on: '
|
|
46
|
+
icon_on: 'caretup',
|
|
54
47
|
text_on: 'ON',
|
|
55
48
|
action_off: '5ed1d4dc-a905-47cd-b0c9-f979644bd21b',
|
|
56
49
|
action_off_data: actionOffData,
|
|
57
|
-
icon_off: '
|
|
50
|
+
icon_off: 'caretup',
|
|
58
51
|
text_off: 'OFF',
|
|
59
52
|
config: 1,
|
|
60
53
|
},
|
|
@@ -67,12 +60,8 @@ describe('Test SwitchButtonTemplate', () => {
|
|
|
67
60
|
await act(async () => {
|
|
68
61
|
wrapper = await create(wrapComponent(displayItem, mockDoAction));
|
|
69
62
|
});
|
|
70
|
-
|
|
71
|
-
const renderJson = wrapper.toJSON();
|
|
72
63
|
const switchButton = wrapper.root.findByType(Switch);
|
|
73
64
|
|
|
74
|
-
expect(renderJson[1].props?.visible).toEqual(false);
|
|
75
|
-
expect(renderJson[1]?.type).toEqual('Modal');
|
|
76
65
|
expect(switchButton.props.value).toEqual(state);
|
|
77
66
|
};
|
|
78
67
|
|
|
@@ -30,13 +30,6 @@ jest.mock('../../../iot/states', () => ({
|
|
|
30
30
|
useConfigGlobalState: () => [{ 5: { value: 2 } }, null],
|
|
31
31
|
}));
|
|
32
32
|
|
|
33
|
-
jest.mock('@react-navigation/native', () => {
|
|
34
|
-
return {
|
|
35
|
-
...jest.requireActual('@react-navigation/native'),
|
|
36
|
-
useFocusEffect: jest.fn(),
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
|
|
40
33
|
describe('Test TerminalBoxTemplate', () => {
|
|
41
34
|
let displayItem;
|
|
42
35
|
let sensor;
|
|
@@ -27,13 +27,6 @@ jest.mock('../../../iot/states', () => ({
|
|
|
27
27
|
useConfigGlobalState: () => [{ 5: { value: 2 } }, null],
|
|
28
28
|
}));
|
|
29
29
|
|
|
30
|
-
jest.mock('@react-navigation/native', () => {
|
|
31
|
-
return {
|
|
32
|
-
...jest.requireActual('@react-navigation/native'),
|
|
33
|
-
useFocusEffect: jest.fn(),
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
|
|
37
30
|
describe('Test TextBoxTemplate', () => {
|
|
38
31
|
const actionData = {
|
|
39
32
|
color: '#00979D',
|
|
@@ -41,7 +34,7 @@ describe('Test TextBoxTemplate', () => {
|
|
|
41
34
|
command_prefer_over_googlehome: false,
|
|
42
35
|
command_prefer_over_internet: false,
|
|
43
36
|
googlehome_actions: [],
|
|
44
|
-
icon: '
|
|
37
|
+
icon: 'caretup',
|
|
45
38
|
id: 20,
|
|
46
39
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
47
40
|
};
|
|
@@ -17,13 +17,6 @@ jest.mock('../../../iot/states', () => ({
|
|
|
17
17
|
useConfigGlobalState: () => [{ 5: { value: 18 }, 6: { value: 30 } }, null],
|
|
18
18
|
}));
|
|
19
19
|
|
|
20
|
-
jest.mock('@react-navigation/native', () => {
|
|
21
|
-
return {
|
|
22
|
-
...jest.requireActual('@react-navigation/native'),
|
|
23
|
-
useFocusEffect: jest.fn(),
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
|
|
27
20
|
const mockDoAction = jest.fn();
|
|
28
21
|
|
|
29
22
|
const wrapComponent = (item, sensor) => (
|
|
@@ -39,7 +32,7 @@ describe('Test TimerActionTemplate success with config value', () => {
|
|
|
39
32
|
command_prefer_over_googlehome: false,
|
|
40
33
|
command_prefer_over_internet: false,
|
|
41
34
|
googlehome_actions: [],
|
|
42
|
-
icon: '
|
|
35
|
+
icon: 'caretup',
|
|
43
36
|
id: 20,
|
|
44
37
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
45
38
|
};
|
|
@@ -16,13 +16,6 @@ jest.mock('../../../iot/states', () => ({
|
|
|
16
16
|
useConfigGlobalState: () => [{}, null],
|
|
17
17
|
}));
|
|
18
18
|
|
|
19
|
-
jest.mock('@react-navigation/native', () => {
|
|
20
|
-
return {
|
|
21
|
-
...jest.requireActual('@react-navigation/native'),
|
|
22
|
-
useFocusEffect: jest.fn(),
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
|
|
26
19
|
const wrapComponent = (item, mockDoAction, is_managed_by_backend) => (
|
|
27
20
|
<SCProvider initState={mockSCStore({})}>
|
|
28
21
|
<TimerActionTemplate
|
|
@@ -40,7 +33,7 @@ describe('Test TimerActionTemplate without config value', () => {
|
|
|
40
33
|
command_prefer_over_googlehome: false,
|
|
41
34
|
command_prefer_over_internet: false,
|
|
42
35
|
googlehome_actions: [],
|
|
43
|
-
icon: '
|
|
36
|
+
icon: 'caretup',
|
|
44
37
|
id: 20,
|
|
45
38
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
46
39
|
};
|
|
@@ -9,13 +9,6 @@ jest.mock('react', () => ({
|
|
|
9
9
|
useState: jest.fn(),
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
|
-
jest.mock('@react-navigation/native', () => {
|
|
13
|
-
return {
|
|
14
|
-
...jest.requireActual('@react-navigation/native'),
|
|
15
|
-
useFocusEffect: jest.fn(),
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
|
|
19
12
|
describe('Test TwoButtonTemplate', () => {
|
|
20
13
|
const actionOnData = {
|
|
21
14
|
color: '#00979D',
|
|
@@ -23,7 +16,7 @@ describe('Test TwoButtonTemplate', () => {
|
|
|
23
16
|
command_prefer_over_googlehome: false,
|
|
24
17
|
command_prefer_over_internet: false,
|
|
25
18
|
googlehome_actions: [],
|
|
26
|
-
icon: '
|
|
19
|
+
icon: 'caretup',
|
|
27
20
|
id: 20,
|
|
28
21
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
29
22
|
};
|
|
@@ -34,7 +27,7 @@ describe('Test TwoButtonTemplate', () => {
|
|
|
34
27
|
command_prefer_over_googlehome: false,
|
|
35
28
|
command_prefer_over_internet: false,
|
|
36
29
|
googlehome_actions: [],
|
|
37
|
-
icon: '
|
|
30
|
+
icon: 'caretup',
|
|
38
31
|
id: 20,
|
|
39
32
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
40
33
|
};
|
|
@@ -25,13 +25,6 @@ const wrapComponent = (item, mockDoAction, sensor) => (
|
|
|
25
25
|
</SCProvider>
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
jest.mock('@react-navigation/native', () => {
|
|
29
|
-
return {
|
|
30
|
-
...jest.requireActual('@react-navigation/native'),
|
|
31
|
-
useFocusEffect: jest.fn(),
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
|
|
35
28
|
describe('Test ActionGroup', () => {
|
|
36
29
|
const configurationWithNoneActionOnOff = {
|
|
37
30
|
action1: '2b949045-8e03-4c07-a855-7794ade2e69c',
|
|
@@ -41,7 +34,7 @@ describe('Test ActionGroup', () => {
|
|
|
41
34
|
command_prefer_over_googlehome: false,
|
|
42
35
|
command_prefer_over_internet: false,
|
|
43
36
|
googlehome_actions: [],
|
|
44
|
-
icon: '
|
|
37
|
+
icon: 'caretup',
|
|
45
38
|
id: 9,
|
|
46
39
|
key: '2b949045-8e03-4c07-a855-7794ade2e69c',
|
|
47
40
|
},
|
|
@@ -63,13 +56,13 @@ describe('Test ActionGroup', () => {
|
|
|
63
56
|
command_prefer_over_googlehome: false,
|
|
64
57
|
command_prefer_over_internet: false,
|
|
65
58
|
googlehome_actions: [],
|
|
66
|
-
icon: '
|
|
59
|
+
icon: 'caretdown',
|
|
67
60
|
id: 10,
|
|
68
61
|
key: 'a492e08c-8cb1-44ee-8ea0-46aaca4e5141',
|
|
69
62
|
},
|
|
70
|
-
icon1: '
|
|
63
|
+
icon1: 'caretup',
|
|
71
64
|
icon2: 'stop',
|
|
72
|
-
icon3: '
|
|
65
|
+
icon3: 'caretdown',
|
|
73
66
|
text_door_lock: 'Door lock',
|
|
74
67
|
text1: 'UP',
|
|
75
68
|
text2: 'STOP',
|
|
@@ -82,7 +75,7 @@ describe('Test ActionGroup', () => {
|
|
|
82
75
|
command_prefer_over_googlehome: false,
|
|
83
76
|
command_prefer_over_internet: false,
|
|
84
77
|
googlehome_actions: [],
|
|
85
|
-
icon: '
|
|
78
|
+
icon: 'caretup',
|
|
86
79
|
id: 20,
|
|
87
80
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
88
81
|
};
|
|
@@ -104,7 +97,7 @@ describe('Test ActionGroup', () => {
|
|
|
104
97
|
command_prefer_over_googlehome: false,
|
|
105
98
|
command_prefer_over_internet: false,
|
|
106
99
|
googlehome_actions: [],
|
|
107
|
-
icon: '
|
|
100
|
+
icon: 'caretup',
|
|
108
101
|
id: 9,
|
|
109
102
|
key: '2b949045-8e03-4c07-a855-7794ade2e69c',
|
|
110
103
|
},
|
|
@@ -126,7 +119,7 @@ describe('Test ActionGroup', () => {
|
|
|
126
119
|
command_prefer_over_googlehome: false,
|
|
127
120
|
command_prefer_over_internet: false,
|
|
128
121
|
googlehome_actions: [],
|
|
129
|
-
icon: '
|
|
122
|
+
icon: 'caretdown',
|
|
130
123
|
id: 10,
|
|
131
124
|
key: 'a492e08c-8cb1-44ee-8ea0-46aaca4e5141',
|
|
132
125
|
},
|
|
@@ -152,9 +145,9 @@ describe('Test ActionGroup', () => {
|
|
|
152
145
|
id: 12,
|
|
153
146
|
key: '09bc3472-e1e7-4bba-ac5a-d0d140a919d9',
|
|
154
147
|
},
|
|
155
|
-
icon1: '
|
|
148
|
+
icon1: 'caretup',
|
|
156
149
|
icon2: 'stop',
|
|
157
|
-
icon3: '
|
|
150
|
+
icon3: 'caretdown',
|
|
158
151
|
text_door_lock: 'Door lock',
|
|
159
152
|
text1: 'UP',
|
|
160
153
|
text2: 'STOP',
|
|
@@ -300,7 +293,7 @@ describe('Test ActionGroup', () => {
|
|
|
300
293
|
configuration: {
|
|
301
294
|
action: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
302
295
|
action_data: actionData,
|
|
303
|
-
icon: '
|
|
296
|
+
icon: 'caretup',
|
|
304
297
|
text: 'UP',
|
|
305
298
|
},
|
|
306
299
|
};
|
|
@@ -326,9 +319,9 @@ describe('Test ActionGroup', () => {
|
|
|
326
319
|
configuration: {
|
|
327
320
|
action_on_data: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
328
321
|
action_off_data: '5ed1d4dc-a905-47cd-b0c9-f979644bd21b',
|
|
329
|
-
icon_on: '
|
|
322
|
+
icon_on: 'caretup',
|
|
330
323
|
text_on: 'ON',
|
|
331
|
-
icon_off: '
|
|
324
|
+
icon_off: 'caretup',
|
|
332
325
|
text_off: 'OFF',
|
|
333
326
|
},
|
|
334
327
|
title: 'Power',
|
|
@@ -354,9 +347,9 @@ describe('Test ActionGroup', () => {
|
|
|
354
347
|
configuration: {
|
|
355
348
|
action_on_data: 'action_on_data',
|
|
356
349
|
action_off_data: 'action_off_data',
|
|
357
|
-
icon_on: '
|
|
350
|
+
icon_on: 'caretup',
|
|
358
351
|
text_on: 'ON',
|
|
359
|
-
icon_off: '
|
|
352
|
+
icon_off: 'caretup',
|
|
360
353
|
text_off: 'OFF',
|
|
361
354
|
button_type: BUTTON_TYPE.PUSH_BUTTON,
|
|
362
355
|
},
|
|
@@ -9,6 +9,7 @@ import Modal from 'react-native-modal';
|
|
|
9
9
|
import ThreeButtonAction from '../ThreeButtonAction';
|
|
10
10
|
import AccessibilityLabel from '../../../configs/AccessibilityLabel';
|
|
11
11
|
import Text from '../../Text';
|
|
12
|
+
import { showAllCards } from './utils';
|
|
12
13
|
|
|
13
14
|
const mockOnSelectAction = jest.fn();
|
|
14
15
|
|
|
@@ -92,6 +93,7 @@ describe('Test ActionTemplate', () => {
|
|
|
92
93
|
tree = await renderer.create(wrapComponent(switchTemplate));
|
|
93
94
|
});
|
|
94
95
|
const instance = tree.root;
|
|
96
|
+
await showAllCards(instance);
|
|
95
97
|
const textTitle = instance.findAll(
|
|
96
98
|
(el) =>
|
|
97
99
|
el.props.accessibilityLabel ===
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { act } from 'react-test-renderer';
|
|
2
|
+
import SelectActionCard from '../../SelectActionCard';
|
|
3
|
+
import GridItem from '../../Grid/GridItem';
|
|
4
|
+
|
|
5
|
+
export const showAllCards = async (instance) => {
|
|
6
|
+
const items = instance.findAllByType(SelectActionCard);
|
|
7
|
+
for (let i = 0; i < items.length; i++) {
|
|
8
|
+
await act(async () => {
|
|
9
|
+
items[i].props.onPress();
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const showAllGridItems = async (instance) => {
|
|
15
|
+
const items = instance.findAllByType(GridItem);
|
|
16
|
+
for (let i = 0; i < items.length; i++) {
|
|
17
|
+
await act(async () => {
|
|
18
|
+
items[i].props.onPress();
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -18,7 +18,6 @@ const ActionTemplate = memo(({ device, item, onSelectAction }) => {
|
|
|
18
18
|
const t = useTranslations();
|
|
19
19
|
const [visible, setVisible] = useState(false);
|
|
20
20
|
const onClose = () => setVisible(false);
|
|
21
|
-
const onPress = () => setVisible(true);
|
|
22
21
|
const [actionName, setActionName] = useState();
|
|
23
22
|
|
|
24
23
|
const onPressSelectAction = useCallback(
|
|
@@ -72,7 +71,7 @@ const ActionTemplate = memo(({ device, item, onSelectAction }) => {
|
|
|
72
71
|
return (
|
|
73
72
|
<>
|
|
74
73
|
<SelectActionCard
|
|
75
|
-
onPress={
|
|
74
|
+
onPress={() => setVisible(true)}
|
|
76
75
|
action={actionName}
|
|
77
76
|
title={t(item?.title === 'Power' ? 'power' : 'action')}
|
|
78
77
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
import { AccessibilityLabel } from '../../configs/Constants';
|
|
5
5
|
|
|
6
6
|
const BackDefault = memo(({ goBack, color, fixedHeight }) => {
|
|
@@ -10,7 +10,7 @@ const BackDefault = memo(({ goBack, color, fixedHeight }) => {
|
|
|
10
10
|
onPress={goBack}
|
|
11
11
|
style={[styles.wrap, fixedHeight && styles.noPaddingVertical]}
|
|
12
12
|
>
|
|
13
|
-
<
|
|
13
|
+
<AntDesign name="left" size={27} color={color} />
|
|
14
14
|
</TouchableOpacity>
|
|
15
15
|
);
|
|
16
16
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
|
|
5
5
|
import { Colors, Device } from '../../configs';
|
|
6
6
|
import { AccessibilityLabel } from '../../configs/Constants';
|
|
@@ -42,7 +42,7 @@ const ButtonPopup = ({
|
|
|
42
42
|
<View style={styles.popoverStyle}>
|
|
43
43
|
<View style={styles.modalWrapper}>
|
|
44
44
|
{!hideClose && (
|
|
45
|
-
<
|
|
45
|
+
<AntDesign
|
|
46
46
|
name={'close'}
|
|
47
47
|
color={Colors.Gray8}
|
|
48
48
|
style={styles.close}
|