@eohjsc/react-native-smart-city 0.6.2 → 0.7.0
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 +7 -10
- package/package.json +53 -70
- 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__/ItemPasscode.test.js +2 -2
- 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 +5 -5
- 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 +4 -5
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +2 -2
- package/src/commons/ActionGroup/__test__/ColorPickerTemplate.test.js +4 -9
- 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 +8 -15
- package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +2 -10
- package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +3 -20
- package/src/commons/ActionGroup/__test__/index.test.js +15 -23
- 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/Calendar/__test__/Calendar.test.js +0 -7
- package/src/commons/CircleButton/__test__/CircleButton.test.js +2 -2
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +11 -25
- 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/DateTimeRangeChange/__test__/DateTimeButton.test.js +4 -4
- package/src/commons/DateTimeRangeChange/index.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/ItemAddNew/index.js +2 -2
- package/src/commons/Device/ItemDevice.js +2 -2
- 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 +6 -2
- package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
- package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +5 -5
- package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +9 -9
- package/src/commons/Form/CurrencyInput.js +1 -15
- package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +1 -22
- package/src/commons/Header/HeaderCustom.js +8 -3
- package/src/commons/HeaderAni/index.js +2 -2
- package/src/commons/IconComponent/index.js +3 -3
- package/src/commons/MediaPlayerDetail/MediaPlayerFull.js +1 -1
- package/src/commons/MediaPlayerDetail/__test__/MediaPlayerFull.test.js +12 -48
- 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 +3 -3
- 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__/ButtonRemoveMember.test.js +2 -2
- 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 +3 -3
- 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/SummaryItem/index.js +22 -23
- package/src/commons/Tabbar/__test__/index.test.js +0 -11
- package/src/commons/Unit/HeaderUnit/index.js +84 -84
- package/src/commons/Unit/SharedUnit.js +7 -7
- package/src/commons/Unit/__test__/HeaderUnit.test.js +29 -52
- package/src/commons/Unit/__test__/SharedUnit.test.js +94 -105
- package/src/commons/UnitSummary/AirQuality/SegmentedRoundDisplay/index.js +11 -30
- package/src/commons/WrapParallaxScrollView/index.js +21 -50
- package/src/configs/API.js +1 -2
- package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +4 -15
- package/src/hooks/Common/useIsOwnerOfUnit.js +1 -1
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +1 -1
- package/src/hooks/IoT/__test__/useWatchConfigs.test.js +6 -21
- 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 +6 -4
- package/src/navigations/UnitStack.js +2 -10
- 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 +11 -6
- 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/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 +6 -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 +7 -7
- 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 +1 -23
- 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 +0 -12
- package/src/screens/Device/detail.js +14 -12
- 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 +6 -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 +7 -7
- package/src/screens/Notification/__test__/Notification.test.js +5 -15
- package/src/screens/Notification/__test__/NotificationItem.test.js +9 -19
- package/src/screens/Notification/index.js +5 -5
- package/src/screens/PlayBackCamera/__test__/index.test.js +13 -22
- package/src/screens/PlayBackCamera/index.js +2 -2
- 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 +9 -29
- 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/SelectUser.js +5 -4
- package/src/screens/Sharing/UnitMemberList.js +7 -6
- 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 +8 -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 +6 -5
- 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 +5 -5
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +9 -31
- 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 +4 -15
- package/src/screens/Template/__test__/GatewayList.test.js +0 -9
- package/src/screens/Template/__test__/detail.test.js +8 -8
- package/src/screens/Template/__test__/index.test.js +3 -14
- package/src/screens/Template/detail.js +2 -2
- package/src/screens/Unit/Detail.js +12 -53
- package/src/screens/Unit/SelectAddToFavorites.js +2 -2
- package/src/screens/Unit/SelectAddress.js +9 -4
- package/src/screens/Unit/SmartAccountItem.js +2 -2
- package/src/screens/Unit/Station/__test__/index.test.js +2 -2
- package/src/screens/Unit/Summaries.js +24 -29
- 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 +14 -12
- 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 +5 -4
- 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 +8 -25
- package/src/screens/UnitSummary/components/AirQuality/__test__/index.test.js +1 -7
- package/src/screens/UnitSummary/components/AirQuality/index.js +8 -3
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +0 -11
- 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 +6 -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/components/__test__/UnitSummary.test.js +8 -8
- 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/Monitor.js +2 -3
- package/src/utils/Route/index.js +0 -1
- package/src/utils/Storage.js +1 -1
- package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +0 -48
- package/src/commons/Device/WindSpeed/LinearChart/index.js +0 -155
- package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +0 -27
- package/src/screens/AddNewGateway/hooks/index.js +0 -31
- package/src/screens/SubUnit/Detail.js +0 -150
- package/src/screens/SubUnit/__test__/Detail.test.js +0 -125
- 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
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
} from 'react-native';
|
|
8
8
|
import renderer, { act } from 'react-test-renderer';
|
|
9
9
|
import DateTimePickerModal from 'react-native-modal-datetime-picker';
|
|
10
|
-
import moment from 'moment';
|
|
11
10
|
|
|
12
11
|
import ActionGroup from '..';
|
|
13
12
|
import Text from '../../Text';
|
|
@@ -25,13 +24,6 @@ const wrapComponent = (item, mockDoAction, sensor) => (
|
|
|
25
24
|
</SCProvider>
|
|
26
25
|
);
|
|
27
26
|
|
|
28
|
-
jest.mock('@react-navigation/native', () => {
|
|
29
|
-
return {
|
|
30
|
-
...jest.requireActual('@react-navigation/native'),
|
|
31
|
-
useFocusEffect: jest.fn(),
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
|
|
35
27
|
describe('Test ActionGroup', () => {
|
|
36
28
|
const configurationWithNoneActionOnOff = {
|
|
37
29
|
action1: '2b949045-8e03-4c07-a855-7794ade2e69c',
|
|
@@ -41,7 +33,7 @@ describe('Test ActionGroup', () => {
|
|
|
41
33
|
command_prefer_over_googlehome: false,
|
|
42
34
|
command_prefer_over_internet: false,
|
|
43
35
|
googlehome_actions: [],
|
|
44
|
-
icon: '
|
|
36
|
+
icon: 'caretup',
|
|
45
37
|
id: 9,
|
|
46
38
|
key: '2b949045-8e03-4c07-a855-7794ade2e69c',
|
|
47
39
|
},
|
|
@@ -63,13 +55,13 @@ describe('Test ActionGroup', () => {
|
|
|
63
55
|
command_prefer_over_googlehome: false,
|
|
64
56
|
command_prefer_over_internet: false,
|
|
65
57
|
googlehome_actions: [],
|
|
66
|
-
icon: '
|
|
58
|
+
icon: 'caretdown',
|
|
67
59
|
id: 10,
|
|
68
60
|
key: 'a492e08c-8cb1-44ee-8ea0-46aaca4e5141',
|
|
69
61
|
},
|
|
70
|
-
icon1: '
|
|
62
|
+
icon1: 'caretup',
|
|
71
63
|
icon2: 'stop',
|
|
72
|
-
icon3: '
|
|
64
|
+
icon3: 'caretdown',
|
|
73
65
|
text_door_lock: 'Door lock',
|
|
74
66
|
text1: 'UP',
|
|
75
67
|
text2: 'STOP',
|
|
@@ -82,7 +74,7 @@ describe('Test ActionGroup', () => {
|
|
|
82
74
|
command_prefer_over_googlehome: false,
|
|
83
75
|
command_prefer_over_internet: false,
|
|
84
76
|
googlehome_actions: [],
|
|
85
|
-
icon: '
|
|
77
|
+
icon: 'caretup',
|
|
86
78
|
id: 20,
|
|
87
79
|
key: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
88
80
|
};
|
|
@@ -104,7 +96,7 @@ describe('Test ActionGroup', () => {
|
|
|
104
96
|
command_prefer_over_googlehome: false,
|
|
105
97
|
command_prefer_over_internet: false,
|
|
106
98
|
googlehome_actions: [],
|
|
107
|
-
icon: '
|
|
99
|
+
icon: 'caretup',
|
|
108
100
|
id: 9,
|
|
109
101
|
key: '2b949045-8e03-4c07-a855-7794ade2e69c',
|
|
110
102
|
},
|
|
@@ -126,7 +118,7 @@ describe('Test ActionGroup', () => {
|
|
|
126
118
|
command_prefer_over_googlehome: false,
|
|
127
119
|
command_prefer_over_internet: false,
|
|
128
120
|
googlehome_actions: [],
|
|
129
|
-
icon: '
|
|
121
|
+
icon: 'caretdown',
|
|
130
122
|
id: 10,
|
|
131
123
|
key: 'a492e08c-8cb1-44ee-8ea0-46aaca4e5141',
|
|
132
124
|
},
|
|
@@ -152,9 +144,9 @@ describe('Test ActionGroup', () => {
|
|
|
152
144
|
id: 12,
|
|
153
145
|
key: '09bc3472-e1e7-4bba-ac5a-d0d140a919d9',
|
|
154
146
|
},
|
|
155
|
-
icon1: '
|
|
147
|
+
icon1: 'caretup',
|
|
156
148
|
icon2: 'stop',
|
|
157
|
-
icon3: '
|
|
149
|
+
icon3: 'caretdown',
|
|
158
150
|
text_door_lock: 'Door lock',
|
|
159
151
|
text1: 'UP',
|
|
160
152
|
text2: 'STOP',
|
|
@@ -300,7 +292,7 @@ describe('Test ActionGroup', () => {
|
|
|
300
292
|
configuration: {
|
|
301
293
|
action: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
302
294
|
action_data: actionData,
|
|
303
|
-
icon: '
|
|
295
|
+
icon: 'caretup',
|
|
304
296
|
text: 'UP',
|
|
305
297
|
},
|
|
306
298
|
};
|
|
@@ -326,9 +318,9 @@ describe('Test ActionGroup', () => {
|
|
|
326
318
|
configuration: {
|
|
327
319
|
action_on_data: '5ed1d4dc-a905-47cd-b0c9-f979644bd21a',
|
|
328
320
|
action_off_data: '5ed1d4dc-a905-47cd-b0c9-f979644bd21b',
|
|
329
|
-
icon_on: '
|
|
321
|
+
icon_on: 'caretup',
|
|
330
322
|
text_on: 'ON',
|
|
331
|
-
icon_off: '
|
|
323
|
+
icon_off: 'caretup',
|
|
332
324
|
text_off: 'OFF',
|
|
333
325
|
},
|
|
334
326
|
title: 'Power',
|
|
@@ -354,9 +346,9 @@ describe('Test ActionGroup', () => {
|
|
|
354
346
|
configuration: {
|
|
355
347
|
action_on_data: 'action_on_data',
|
|
356
348
|
action_off_data: 'action_off_data',
|
|
357
|
-
icon_on: '
|
|
349
|
+
icon_on: 'caretup',
|
|
358
350
|
text_on: 'ON',
|
|
359
|
-
icon_off: '
|
|
351
|
+
icon_off: 'caretup',
|
|
360
352
|
text_off: 'OFF',
|
|
361
353
|
button_type: BUTTON_TYPE.PUSH_BUTTON,
|
|
362
354
|
},
|
|
@@ -477,7 +469,7 @@ describe('Test ActionGroup', () => {
|
|
|
477
469
|
const dateTimePicker = instance.findByType(DateTimePickerModal);
|
|
478
470
|
expect(dateTimePicker.props.isVisible).toBeFalsy();
|
|
479
471
|
expect(dateTimePicker.props.date).toEqual(
|
|
480
|
-
|
|
472
|
+
new Date('2021-09-09T10:00:00.000Z')
|
|
481
473
|
);
|
|
482
474
|
});
|
|
483
475
|
|
|
@@ -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}
|
|
@@ -5,13 +5,6 @@ import { Calendar } from 'react-native-calendars';
|
|
|
5
5
|
import { SCProvider } from '../../../context';
|
|
6
6
|
import { mockSCStore } from '../../../context/mockStore';
|
|
7
7
|
|
|
8
|
-
const mockSetState = jest.fn();
|
|
9
|
-
jest.mock('react', () => {
|
|
10
|
-
return {
|
|
11
|
-
...jest.requireActual('react'),
|
|
12
|
-
useState: jest.fn((init) => [init, mockSetState]),
|
|
13
|
-
};
|
|
14
|
-
});
|
|
15
8
|
const wrapComponent = ({ route, isVisible, navigation }) => (
|
|
16
9
|
<SCProvider initState={mockSCStore({})}>
|
|
17
10
|
<CalendarComponent route={route} isVisible={isVisible} />
|
|
@@ -10,7 +10,7 @@ describe('Test circle button', () => {
|
|
|
10
10
|
tree = await renderer.create(<CircleButton size={5} />);
|
|
11
11
|
});
|
|
12
12
|
const instance = tree.root;
|
|
13
|
-
const
|
|
14
|
-
expect(
|
|
13
|
+
const touchableOpacities = instance.findAllByType(TouchableOpacity);
|
|
14
|
+
expect(touchableOpacities).toHaveLength(1);
|
|
15
15
|
});
|
|
16
16
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
2
|
import { act, create } from 'react-test-renderer';
|
|
3
3
|
import MockAdapter from 'axios-mock-adapter';
|
|
4
4
|
|
|
@@ -16,31 +16,8 @@ import { Action } from '../../../../context/actionType';
|
|
|
16
16
|
|
|
17
17
|
const mock = new MockAdapter(api.axiosInstance);
|
|
18
18
|
|
|
19
|
-
const mockedNavigate = jest.fn();
|
|
20
19
|
const mockSetAction = jest.fn();
|
|
21
20
|
|
|
22
|
-
jest.mock('@react-navigation/native', () => {
|
|
23
|
-
return {
|
|
24
|
-
...jest.requireActual('@react-navigation/native'),
|
|
25
|
-
useNavigation: () => ({
|
|
26
|
-
navigate: mockedNavigate,
|
|
27
|
-
}),
|
|
28
|
-
useIsFocused: () => true,
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
jest.mock('react', () => {
|
|
33
|
-
return {
|
|
34
|
-
...jest.requireActual('react'),
|
|
35
|
-
useContext: () => ({
|
|
36
|
-
stateData: mockSCStore({
|
|
37
|
-
app: { isNeedUpdateCache: true },
|
|
38
|
-
}),
|
|
39
|
-
setAction: mockSetAction,
|
|
40
|
-
}),
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
|
|
44
21
|
const wrapComponent = (route) => (
|
|
45
22
|
<SCProvider initState={mockSCStore({})}>
|
|
46
23
|
<MyPinnedSharedUnit />
|
|
@@ -50,6 +27,15 @@ const wrapComponent = (route) => (
|
|
|
50
27
|
describe('Test MyPinnedSharedUnit', () => {
|
|
51
28
|
let tree;
|
|
52
29
|
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
useContext.mockReturnValue({
|
|
32
|
+
stateData: mockSCStore({
|
|
33
|
+
app: { isNeedUpdateCache: true },
|
|
34
|
+
}),
|
|
35
|
+
setAction: mockSetAction,
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
53
39
|
it('create', async () => {
|
|
54
40
|
mock.onGet(API.UNIT.SHARED_UNITS()).reply(200, [{ id: 1 }]);
|
|
55
41
|
|
|
@@ -74,7 +60,7 @@ describe('Test MyPinnedSharedUnit', () => {
|
|
|
74
60
|
await act(async () => {
|
|
75
61
|
goToAllSharedUnits.props.onPress();
|
|
76
62
|
});
|
|
77
|
-
expect(mockedNavigate).toHaveBeenCalled();
|
|
63
|
+
expect(global.mockedNavigate).toHaveBeenCalled();
|
|
78
64
|
expect(mockSetAction).toBeCalledWith(
|
|
79
65
|
Action.IS_CHECK_CLEAR_CACHE_UNITS,
|
|
80
66
|
false
|
|
@@ -10,22 +10,12 @@ import { mockSCStore } from '../../../../context/mockStore';
|
|
|
10
10
|
import api from '../../../../utils/Apis/axios';
|
|
11
11
|
import { API } from '../../../../configs';
|
|
12
12
|
import Routes from '../../../../utils/Route';
|
|
13
|
+
import { flushPromises } from '../../../../screens/AllGateway/test-utils';
|
|
14
|
+
import FastImage from 'react-native-fast-image';
|
|
15
|
+
import { removeMultiple, STORAGE_KEY } from '../../../../utils/Storage';
|
|
13
16
|
|
|
14
17
|
const mock = new MockAdapter(api.axiosInstance);
|
|
15
18
|
|
|
16
|
-
const mockedNavigate = jest.fn();
|
|
17
|
-
|
|
18
|
-
jest.mock('@react-navigation/native', () => {
|
|
19
|
-
return {
|
|
20
|
-
...jest.requireActual('@react-navigation/native'),
|
|
21
|
-
useNavigation: () => ({
|
|
22
|
-
navigate: mockedNavigate,
|
|
23
|
-
}),
|
|
24
|
-
useIsFocused: () => true,
|
|
25
|
-
useFocusEffect: jest.fn(),
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
|
|
29
19
|
const wrapComponent = (data = {}) => (
|
|
30
20
|
<SCProvider initState={mockSCStore(data)}>
|
|
31
21
|
<MyUnit refreshing={true} />
|
|
@@ -34,7 +24,7 @@ const wrapComponent = (data = {}) => (
|
|
|
34
24
|
|
|
35
25
|
describe('Test MyUnit', () => {
|
|
36
26
|
let tree;
|
|
37
|
-
let
|
|
27
|
+
let stateData = {
|
|
38
28
|
app: { isDeleteUnitSuccessFully: true, isNeedUpdateCache: true },
|
|
39
29
|
};
|
|
40
30
|
let data = [
|
|
@@ -69,9 +59,10 @@ describe('Test MyUnit', () => {
|
|
|
69
59
|
},
|
|
70
60
|
];
|
|
71
61
|
|
|
72
|
-
beforeEach(() => {
|
|
62
|
+
beforeEach(async () => {
|
|
73
63
|
mock.resetHistory();
|
|
74
|
-
|
|
64
|
+
FastImage.preload.mockClear();
|
|
65
|
+
await removeMultiple([STORAGE_KEY.IS_FIRST_TIME_LOAD_MY_UNITS]);
|
|
75
66
|
});
|
|
76
67
|
|
|
77
68
|
const getElement = (instance) => {
|
|
@@ -89,7 +80,7 @@ describe('Test MyUnit', () => {
|
|
|
89
80
|
|
|
90
81
|
it('MyUnit no Unit', async () => {
|
|
91
82
|
await act(async () => {
|
|
92
|
-
tree = await renderer.create(wrapComponent(
|
|
83
|
+
tree = await renderer.create(wrapComponent(stateData));
|
|
93
84
|
});
|
|
94
85
|
const instance = tree.root;
|
|
95
86
|
const { textNoUnit } = getElement(instance);
|
|
@@ -99,8 +90,9 @@ describe('Test MyUnit', () => {
|
|
|
99
90
|
it('MyUnit with unit', async () => {
|
|
100
91
|
mock.onGet(API.UNIT.MY_UNITS()).replyOnce(200, data);
|
|
101
92
|
await act(async () => {
|
|
102
|
-
tree = await renderer.create(wrapComponent(
|
|
93
|
+
tree = await renderer.create(wrapComponent(stateData));
|
|
103
94
|
});
|
|
95
|
+
await flushPromises();
|
|
104
96
|
const instance = tree.root;
|
|
105
97
|
const devices = instance.findAllByType(MyUnitDevice);
|
|
106
98
|
expect(devices).toHaveLength(2);
|
|
@@ -111,7 +103,7 @@ describe('Test MyUnit', () => {
|
|
|
111
103
|
await act(async () => {
|
|
112
104
|
await button.props.onPress(data[0]);
|
|
113
105
|
});
|
|
114
|
-
expect(mockedNavigate).toBeCalledWith(Routes.UnitStack, {
|
|
106
|
+
expect(global.mockedNavigate).toBeCalledWith(Routes.UnitStack, {
|
|
115
107
|
params: { unitId: 1 },
|
|
116
108
|
screen: Routes.UnitDetail,
|
|
117
109
|
});
|
|
@@ -131,9 +123,24 @@ describe('Test MyUnit', () => {
|
|
|
131
123
|
await act(async () => {
|
|
132
124
|
await button.props.onPress(data[1]);
|
|
133
125
|
});
|
|
134
|
-
expect(mockedNavigate).toBeCalledWith('UnitStack', {
|
|
126
|
+
expect(global.mockedNavigate).toBeCalledWith('UnitStack', {
|
|
135
127
|
params: { unitId: 2 },
|
|
136
128
|
screen: 'UnitDetail',
|
|
137
129
|
});
|
|
138
130
|
});
|
|
131
|
+
|
|
132
|
+
it('Test preload image', async () => {
|
|
133
|
+
mock.onGet(API.UNIT.MY_UNITS()).replyOnce(200, [data[1]]);
|
|
134
|
+
mock.onGet(API.UNIT.UNIT_DETAIL(2)).replyOnce(200, {
|
|
135
|
+
stations: [{ background: 'background' }],
|
|
136
|
+
});
|
|
137
|
+
await act(async () => {
|
|
138
|
+
tree = await renderer.create(
|
|
139
|
+
wrapComponent({ app: { isNeedUpdateCache: false } })
|
|
140
|
+
);
|
|
141
|
+
});
|
|
142
|
+
expect(FastImage.preload).toHaveBeenCalledWith([
|
|
143
|
+
{ uri: 'background', priority: FastImage.priority.high },
|
|
144
|
+
]);
|
|
145
|
+
});
|
|
139
146
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
import { Colors } from '../../configs';
|
|
5
5
|
|
|
6
6
|
const DateTimeButton = memo(({ onPress, style, children }) => {
|
|
7
7
|
return (
|
|
8
8
|
<TouchableOpacity style={[styles.dateSelect, style]} onPress={onPress}>
|
|
9
9
|
{children}
|
|
10
|
-
<
|
|
10
|
+
<AntDesign style={styles.iconDateTime} name={'calendar'} />
|
|
11
11
|
</TouchableOpacity>
|
|
12
12
|
);
|
|
13
13
|
});
|
|
@@ -15,8 +15,8 @@ describe('Test DateTimeButton', () => {
|
|
|
15
15
|
);
|
|
16
16
|
});
|
|
17
17
|
const instance = tree.root;
|
|
18
|
-
const
|
|
19
|
-
expect(
|
|
18
|
+
const touchableOpacities = instance.findAllByType(TouchableOpacity);
|
|
19
|
+
expect(touchableOpacities).toHaveLength(1);
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
it('render DateTimeButton formatType is undefined', async () => {
|
|
@@ -26,7 +26,7 @@ describe('Test DateTimeButton', () => {
|
|
|
26
26
|
);
|
|
27
27
|
});
|
|
28
28
|
const instance = tree.root;
|
|
29
|
-
const
|
|
30
|
-
expect(
|
|
29
|
+
const touchableOpacities = instance.findAllByType(TouchableOpacity);
|
|
30
|
+
expect(touchableOpacities).toHaveLength(1);
|
|
31
31
|
});
|
|
32
32
|
});
|
|
@@ -119,7 +119,7 @@ const DateTimeRangeChange = memo(
|
|
|
119
119
|
</View>
|
|
120
120
|
<DateTimePickerModal
|
|
121
121
|
isVisible={eventPicker.showModalStart}
|
|
122
|
-
date={startDate.valueOf()}
|
|
122
|
+
date={new Date(startDate.valueOf())}
|
|
123
123
|
mode={mode}
|
|
124
124
|
onConfirm={onConfirmStart}
|
|
125
125
|
onCancel={onCancel}
|
|
@@ -132,7 +132,7 @@ const DateTimeRangeChange = memo(
|
|
|
132
132
|
/>
|
|
133
133
|
<DateTimePickerModal
|
|
134
134
|
isVisible={eventPicker.showModalEnd}
|
|
135
|
-
date={endDate.valueOf()}
|
|
135
|
+
date={new Date(endDate.valueOf())}
|
|
136
136
|
mode={mode}
|
|
137
137
|
onConfirm={onConfirmEnd}
|
|
138
138
|
onCancel={onCancel}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
5
5
|
import { Colors } from '../../configs';
|
|
6
6
|
import Text from '../../commons/Text';
|
|
@@ -30,7 +30,7 @@ const ConnectedViewHeader = memo(
|
|
|
30
30
|
return (
|
|
31
31
|
<View style={styles.statusContainer}>
|
|
32
32
|
<View style={styles.connectStatus}>
|
|
33
|
-
<
|
|
33
|
+
<AntDesign name={'wifi'} color={Colors.Green6} size={16} />
|
|
34
34
|
<DisplayTextConnected type={type} />
|
|
35
35
|
</View>
|
|
36
36
|
{isDisplayTime && (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
4
4
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
5
5
|
|
|
6
6
|
import { Colors } from '../../configs';
|
|
@@ -57,7 +57,7 @@ const DisconnectedView = memo(({ sensor, type, isDeviceHasBle }) => {
|
|
|
57
57
|
</View>
|
|
58
58
|
<View style={styles.disconnectSuggestionContainer} testID={'suggestions'}>
|
|
59
59
|
<View style={styles.row}>
|
|
60
|
-
<
|
|
60
|
+
<MaterialCommunityIcons name={'alert-circle-outline'} size={16} />
|
|
61
61
|
<Text bold style={styles.boldText}>
|
|
62
62
|
{t('suggestions')}:
|
|
63
63
|
</Text>
|
|
@@ -6,7 +6,7 @@ import MediaPlayer from '../../MediaPlayer';
|
|
|
6
6
|
import { standardizeCameraScreenSize } from '../../../utils/Utils';
|
|
7
7
|
import { Colors, Device } from '../../../configs';
|
|
8
8
|
import { RowUser } from '../../RowUser';
|
|
9
|
-
import
|
|
9
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
10
10
|
import { useEmeragencyContacts } from '../../../screens/EmergencyContacts/hook';
|
|
11
11
|
import { useIsFocused } from '@react-navigation/native';
|
|
12
12
|
|
|
@@ -49,12 +49,12 @@ const EmergencyDetail = memo(({ item }) => {
|
|
|
49
49
|
key={contact.id.toString()}
|
|
50
50
|
index={index}
|
|
51
51
|
leftIcon={
|
|
52
|
-
<
|
|
52
|
+
<AntDesign name={'user'} size={20} color={Colors.White} />
|
|
53
53
|
}
|
|
54
54
|
text={contact.name}
|
|
55
55
|
rightComponent={
|
|
56
56
|
<View style={styles.rightComponent}>
|
|
57
|
-
<
|
|
57
|
+
<AntDesign
|
|
58
58
|
name={'phone'}
|
|
59
59
|
size={20}
|
|
60
60
|
color={Colors.Gray9}
|
|
@@ -12,11 +12,11 @@ const wrapComponent = (item) => (
|
|
|
12
12
|
</SCProvider>
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const mockedUseIsFocused = jest.fn();
|
|
16
16
|
jest.mock('@react-navigation/core', () => {
|
|
17
17
|
return {
|
|
18
18
|
...jest.requireActual('@react-navigation/core'),
|
|
19
|
-
useIsFocused:
|
|
19
|
+
useIsFocused: mockedUseIsFocused,
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
22
|
|
|
@@ -5,7 +5,7 @@ import AlertStatusMachine from './WaterPurifierStatus/AlertStatusMachine';
|
|
|
5
5
|
import { useBoolean } from '../../hooks/Common';
|
|
6
6
|
import Text from '../Text';
|
|
7
7
|
import Routes from '../../utils/Route';
|
|
8
|
-
import
|
|
8
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
9
9
|
import { Colors, Constants } from '../../configs';
|
|
10
10
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
11
11
|
import { AccessibilityLabel } from '../../configs/Constants';
|
|
@@ -75,7 +75,7 @@ const FlatListItems = memo(({ data, style, title, offsetTitle }) => {
|
|
|
75
75
|
style={styles.iconInfo}
|
|
76
76
|
accessibilityLabel={AccessibilityLabel.TOUCH_INFO_FLAT_LIST_ITEM}
|
|
77
77
|
>
|
|
78
|
-
<
|
|
78
|
+
<AntDesign name={'info-circle'} size={16} color={Colors.Gray8} />
|
|
79
79
|
</TouchableOpacity>
|
|
80
80
|
)}
|
|
81
81
|
</View>
|
|
@@ -97,7 +97,7 @@ const FlatListItems = memo(({ data, style, title, offsetTitle }) => {
|
|
|
97
97
|
onPress={() => setViewFull(true)}
|
|
98
98
|
>
|
|
99
99
|
<Text style={styles.textSeeMore}>{t('see_more')}</Text>
|
|
100
|
-
<
|
|
100
|
+
<AntDesign name={'caretdown'} color={Colors.Gray8} size={16} />
|
|
101
101
|
</TouchableOpacity>
|
|
102
102
|
)}
|
|
103
103
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
TouchableWithoutFeedback,
|
|
6
6
|
View,
|
|
7
7
|
} from 'react-native';
|
|
8
|
-
import
|
|
8
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
9
9
|
import { useNavigation } from '@react-navigation/native';
|
|
10
10
|
|
|
11
11
|
import Text from '../../Text';
|
|
@@ -35,7 +35,7 @@ const ItemHanetDevice = memo(
|
|
|
35
35
|
return iconKit ? (
|
|
36
36
|
<FImage source={{ uri: iconKit }} style={styles.iconSensor} />
|
|
37
37
|
) : (
|
|
38
|
-
<
|
|
38
|
+
<AntDesign name={svgMain} size={32} color={Colors.Red6} />
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
41
|
|
|
@@ -58,7 +58,7 @@ const ItemHanetDevice = memo(
|
|
|
58
58
|
{title}
|
|
59
59
|
</Text>
|
|
60
60
|
<View style={styles.row}>
|
|
61
|
-
<
|
|
61
|
+
<AntDesign name="right" size={12} />
|
|
62
62
|
</View>
|
|
63
63
|
</TouchableOpacity>
|
|
64
64
|
</View>
|
|
@@ -4,6 +4,7 @@ import renderer, { act } from 'react-test-renderer';
|
|
|
4
4
|
import ItemHanetDevice from './ItemHanetDevice';
|
|
5
5
|
import { SCProvider } from '../../../context';
|
|
6
6
|
import { mockSCStore } from '../../../context/mockStore';
|
|
7
|
+
import { useNavigation } from '@react-navigation/native';
|
|
7
8
|
|
|
8
9
|
const wrapComponent = (props) => (
|
|
9
10
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -11,18 +12,9 @@ const wrapComponent = (props) => (
|
|
|
11
12
|
</SCProvider>
|
|
12
13
|
);
|
|
13
14
|
|
|
14
|
-
const mockNavigate = jest.fn();
|
|
15
|
-
jest.mock('@react-navigation/native', () => {
|
|
16
|
-
return {
|
|
17
|
-
...jest.requireActual('@react-navigation/native'),
|
|
18
|
-
useNavigation: () => ({
|
|
19
|
-
navigate: mockNavigate,
|
|
20
|
-
}),
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
|
|
24
15
|
describe('Test ItemHanetDevice', () => {
|
|
25
16
|
let tree, props;
|
|
17
|
+
const { navigate } = useNavigation();
|
|
26
18
|
|
|
27
19
|
beforeEach(() => {
|
|
28
20
|
props = {
|
|
@@ -43,7 +35,7 @@ describe('Test ItemHanetDevice', () => {
|
|
|
43
35
|
await act(async () => {
|
|
44
36
|
tree = touches[0].props.onPress();
|
|
45
37
|
});
|
|
46
|
-
expect(
|
|
38
|
+
expect(navigate).toBeCalled();
|
|
47
39
|
});
|
|
48
40
|
|
|
49
41
|
it('render ItemHanetDevice sensor has icon', async () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { TouchableWithoutFeedback, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
import Text from '../../Text';
|
|
5
5
|
|
|
6
6
|
import { Colors } from '../../../configs';
|
|
@@ -16,7 +16,7 @@ const ItemAddNew = memo(({ title, onAddNew, wrapStyle }) => {
|
|
|
16
16
|
<View style={[styles.container, wrapStyle]}>
|
|
17
17
|
<View style={styles.boxIcon}>
|
|
18
18
|
<View style={styles.buttonPlus}>
|
|
19
|
-
<
|
|
19
|
+
<AntDesign name="plus" size={22} color={Colors.Gray8} />
|
|
20
20
|
</View>
|
|
21
21
|
</View>
|
|
22
22
|
<View>
|