@eohjsc/react-native-smart-city 0.6.2 → 0.7.3
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 +3 -3
- 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/AddDeviceStack.js +2 -2
- package/src/navigations/AddGatewayStack.js +2 -2
- package/src/navigations/AddLGDeviceStack.js +2 -2
- package/src/navigations/AddMemberStack.js +2 -2
- package/src/navigations/AddSubUnitStack.js +2 -2
- package/src/navigations/AddUnitStack.js +2 -2
- package/src/navigations/AllGatewayStack.js +2 -2
- package/src/navigations/AutomateStack.js +4 -4
- package/src/navigations/EmergencyContactsStack.js +4 -4
- package/src/navigations/GatewayStack.js +2 -2
- package/src/navigations/HanetCameraStack.js +2 -2
- package/src/navigations/Main.js +2 -2
- package/src/navigations/NotificationStack.js +2 -2
- package/src/navigations/SharedStack.js +8 -6
- package/src/navigations/SmartAccountStack.js +2 -2
- package/src/navigations/SmartIrStack.js +2 -2
- package/src/navigations/SmartLockStack.js +2 -2
- package/src/navigations/SmartStack.js +2 -2
- package/src/navigations/TemplateStack.js +2 -2
- package/src/navigations/UnitStack.js +4 -12
- package/src/navigations/utils.js +1 -4
- 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/Styles/indexStyles.js +6 -0
- package/src/screens/Automate/__test__/MultiUnits.test.js +7 -7
- package/src/screens/Automate/__test__/index.test.js +9 -34
- package/src/screens/Automate/index.js +50 -33
- 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/SharedUnit/index.js +5 -0
- 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/Apis/axios.js +4 -2
- 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
|
@@ -8,8 +8,8 @@ import React, {
|
|
|
8
8
|
} from 'react';
|
|
9
9
|
import { View, TouchableOpacity, Platform } from 'react-native';
|
|
10
10
|
import { useNavigation, useFocusEffect } from '@react-navigation/native';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
12
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
13
13
|
import moment from 'moment';
|
|
14
14
|
|
|
15
15
|
import { SCContext } from '../../context';
|
|
@@ -215,7 +215,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
215
215
|
|
|
216
216
|
useEffect(() => {
|
|
217
217
|
if (
|
|
218
|
-
unit
|
|
218
|
+
unit?.remote_control_options &&
|
|
219
219
|
unit.remote_control_options.googlehome?.length &&
|
|
220
220
|
isNetworkConnected
|
|
221
221
|
) {
|
|
@@ -685,9 +685,9 @@ const DeviceDetail = ({ route }) => {
|
|
|
685
685
|
>
|
|
686
686
|
<View style={styles.buttonStar}>
|
|
687
687
|
{isFavorite ? (
|
|
688
|
-
<
|
|
688
|
+
<AntDesign name="star" size={25} color={Colors.Yellow6} />
|
|
689
689
|
) : (
|
|
690
|
-
<
|
|
690
|
+
<AntDesign name="staro" size={25} />
|
|
691
691
|
)}
|
|
692
692
|
</View>
|
|
693
693
|
</TouchableOpacity>
|
|
@@ -695,7 +695,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
695
695
|
{isShowSetupEmergencyContact && (
|
|
696
696
|
<TouchableOpacity onPress={onPressSetting}>
|
|
697
697
|
<View style={styles.button}>
|
|
698
|
-
<
|
|
698
|
+
<AntDesign name="setting" size={25} color={Colors.Black} />
|
|
699
699
|
</View>
|
|
700
700
|
</TouchableOpacity>
|
|
701
701
|
)}
|
|
@@ -706,7 +706,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
706
706
|
ref={refMenuAction}
|
|
707
707
|
accessibilityLabel={AccessibilityLabel.HEADER_DEVICE_BUTTON_MORE}
|
|
708
708
|
>
|
|
709
|
-
<
|
|
709
|
+
<MaterialIcons name={'more-vert'} size={27} color={Colors.Black} />
|
|
710
710
|
</TouchableOpacity>
|
|
711
711
|
</View>
|
|
712
712
|
),
|
|
@@ -755,7 +755,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
755
755
|
>
|
|
756
756
|
{display.items.map((item, index) => {
|
|
757
757
|
return (
|
|
758
|
-
|
|
758
|
+
<View key={item?.id?.toString()}>
|
|
759
759
|
{!item.is_configuration_ready && (
|
|
760
760
|
<Text center>{t('bellow_widget_is_not_configured')}</Text>
|
|
761
761
|
)}
|
|
@@ -779,7 +779,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
779
779
|
setShowWindDirection={setShowWindDirection}
|
|
780
780
|
background={station?.background}
|
|
781
781
|
/>
|
|
782
|
-
|
|
782
|
+
</View>
|
|
783
783
|
);
|
|
784
784
|
})}
|
|
785
785
|
</SensorConnectStatusViewHeader>
|
|
@@ -791,7 +791,9 @@ const DeviceDetail = ({ route }) => {
|
|
|
791
791
|
canManageSubUnit && (
|
|
792
792
|
<BottomButtonView
|
|
793
793
|
style={styles.bottomButtonEmergencyContact}
|
|
794
|
-
mainIcon={
|
|
794
|
+
mainIcon={
|
|
795
|
+
<AntDesign name="plus" size={16} color={Colors.Primary} />
|
|
796
|
+
}
|
|
795
797
|
mainTitle={t('setup_my_emergency_contact')}
|
|
796
798
|
onPressMain={onSetupContacts}
|
|
797
799
|
typeMain="primaryBorder"
|
|
@@ -825,7 +827,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
825
827
|
{isShowEmergencyResolve && !isEmergencyPopupScreen && (
|
|
826
828
|
<BottomButtonView
|
|
827
829
|
style={styles.bottomButtonEmergencyResolve}
|
|
828
|
-
mainIcon={<
|
|
830
|
+
mainIcon={<AntDesign name="tool" size={15} color={Colors.Gray6} />}
|
|
829
831
|
mainTitle={t('resolve_situation')}
|
|
830
832
|
onPressMain={onPressResolveSituationConfirm}
|
|
831
833
|
topComponent={
|
|
@@ -865,7 +867,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
865
867
|
>
|
|
866
868
|
{unit?.name} - {sensor?.station?.name}
|
|
867
869
|
</Text>
|
|
868
|
-
<
|
|
870
|
+
<AntDesign
|
|
869
871
|
accessibilityLabel={AccessibilityLabel.BUTTON_POPUP_RESOLVED_ICON}
|
|
870
872
|
name="check-circle"
|
|
871
873
|
size={42}
|
|
@@ -4,16 +4,7 @@ import AccessibilityLabel from '../../configs/AccessibilityLabel';
|
|
|
4
4
|
import { SCProvider } from '../../context';
|
|
5
5
|
import { mockSCStore } from '../../context/mockStore';
|
|
6
6
|
import Drawer, { Row } from './index';
|
|
7
|
-
|
|
8
|
-
const mockDispatch = jest.fn();
|
|
9
|
-
jest.mock('@react-navigation/native', () => {
|
|
10
|
-
return {
|
|
11
|
-
...jest.requireActual('@react-navigation/native'),
|
|
12
|
-
useNavigation: () => ({
|
|
13
|
-
dispatch: mockDispatch,
|
|
14
|
-
}),
|
|
15
|
-
};
|
|
16
|
-
});
|
|
7
|
+
import { useNavigation } from '@react-navigation/native';
|
|
17
8
|
|
|
18
9
|
const wrapComponent = (initState = mockSCStore({})) => (
|
|
19
10
|
<SCProvider initState={initState}>
|
|
@@ -24,6 +15,7 @@ const wrapComponent = (initState = mockSCStore({})) => (
|
|
|
24
15
|
describe('Drawer', () => {
|
|
25
16
|
let tree;
|
|
26
17
|
it('test render with user', async () => {
|
|
18
|
+
const { dispatch } = useNavigation();
|
|
27
19
|
await act(async () => {
|
|
28
20
|
tree = await renderer.create(wrapComponent());
|
|
29
21
|
});
|
|
@@ -43,7 +35,7 @@ describe('Drawer', () => {
|
|
|
43
35
|
await act(async () => {
|
|
44
36
|
await rows[2].props.onPress();
|
|
45
37
|
});
|
|
46
|
-
expect(
|
|
38
|
+
expect(dispatch).toBeCalledWith({
|
|
47
39
|
payload: { index: 0, routes: [{ name: 'Main' }] },
|
|
48
40
|
type: 'RESET',
|
|
49
41
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Icon } from '@ant-design/react-native';
|
|
1
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
3
2
|
import React, { useCallback, useContext } from 'react';
|
|
4
3
|
import {
|
|
5
4
|
Image,
|
|
@@ -60,7 +59,7 @@ const DrawerContainer = () => {
|
|
|
60
59
|
style={styles.avatar}
|
|
61
60
|
accessibilityLabel={AccessibilityLabel.SIDE_MENU_AVATAR_USER}
|
|
62
61
|
>
|
|
63
|
-
<
|
|
62
|
+
<AntDesign name={'user'} size={27} />
|
|
64
63
|
</View>
|
|
65
64
|
)}
|
|
66
65
|
<View style={styles.textContainer}>
|
|
@@ -117,7 +116,7 @@ export const Row = ({
|
|
|
117
116
|
]}
|
|
118
117
|
accessibilityLabel={accessibilityLabel}
|
|
119
118
|
>
|
|
120
|
-
<
|
|
119
|
+
<AntDesign name={image} size={24} />
|
|
121
120
|
|
|
122
121
|
<View style={styles.wrapText}>
|
|
123
122
|
<Text style={[styles.text]}>{name}</Text>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from 'react';
|
|
2
2
|
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
import { useIsFocused, useNavigation } from '@react-navigation/native';
|
|
5
5
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
6
6
|
import { AlertAction, MenuActionList, Section } from '../../commons';
|
|
@@ -99,7 +99,7 @@ export const EmergencyContactsList = ({ route }) => {
|
|
|
99
99
|
: 'disable'
|
|
100
100
|
}
|
|
101
101
|
leftIcon={
|
|
102
|
-
<
|
|
102
|
+
<AntDesign name={'plus'} size={20} color={Colors.White} />
|
|
103
103
|
}
|
|
104
104
|
text={t('add_new')}
|
|
105
105
|
subtext={t('emergency_max_contacts', {
|
|
@@ -113,7 +113,7 @@ export const EmergencyContactsList = ({ route }) => {
|
|
|
113
113
|
key={contact.id}
|
|
114
114
|
index={index}
|
|
115
115
|
leftIcon={
|
|
116
|
-
<
|
|
116
|
+
<AntDesign name={'user'} size={20} color={Colors.White} />
|
|
117
117
|
}
|
|
118
118
|
text={contact.name}
|
|
119
119
|
subtext={contact.phone_number}
|
|
@@ -122,11 +122,7 @@ export const EmergencyContactsList = ({ route }) => {
|
|
|
122
122
|
style={styles.buttonRemove}
|
|
123
123
|
onPress={onPressRemoveContact(contact)}
|
|
124
124
|
>
|
|
125
|
-
<
|
|
126
|
-
name={'minus'}
|
|
127
|
-
size={20}
|
|
128
|
-
color={Colors.Gray8}
|
|
129
|
-
/>
|
|
125
|
+
<AntDesign name={'minus'} size={20} color={Colors.Gray8} />
|
|
130
126
|
</TouchableOpacity>
|
|
131
127
|
}
|
|
132
128
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
import { useNavigation } from '@react-navigation/native';
|
|
5
5
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
6
6
|
import { Section, ViewButtonBottom } from '../../commons';
|
|
@@ -81,7 +81,7 @@ export const EmergencyContactsSelectContacts = ({ route }) => {
|
|
|
81
81
|
}
|
|
82
82
|
index={index}
|
|
83
83
|
leftIcon={
|
|
84
|
-
<
|
|
84
|
+
<AntDesign name={'user'} size={20} color={Colors.White} />
|
|
85
85
|
}
|
|
86
86
|
text={contact.name}
|
|
87
87
|
subtext={contact.phone_number}
|
|
@@ -91,7 +91,7 @@ export const EmergencyContactsSelectContacts = ({ route }) => {
|
|
|
91
91
|
{currentContacts.some(
|
|
92
92
|
(item) => item?.name === contact?.name
|
|
93
93
|
) && (
|
|
94
|
-
<
|
|
94
|
+
<AntDesign
|
|
95
95
|
name={'check-circle'}
|
|
96
96
|
size={20}
|
|
97
97
|
color={Colors.Primary}
|
|
@@ -20,19 +20,8 @@ const wrapComponent = (route) => (
|
|
|
20
20
|
|
|
21
21
|
jest.mock('react-native-toast-message');
|
|
22
22
|
|
|
23
|
-
const mockedGoBack = jest.fn();
|
|
24
|
-
|
|
25
23
|
const mock = new MockAdapter(api.axiosInstance);
|
|
26
24
|
|
|
27
|
-
jest.mock('@react-navigation/native', () => {
|
|
28
|
-
return {
|
|
29
|
-
...jest.requireActual('@react-navigation/native'),
|
|
30
|
-
useNavigation: () => ({
|
|
31
|
-
goBack: mockedGoBack,
|
|
32
|
-
}),
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
|
|
36
25
|
describe('test EmergencyContactAddNew', () => {
|
|
37
26
|
let route;
|
|
38
27
|
beforeEach(() => {
|
|
@@ -44,9 +33,7 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
44
33
|
},
|
|
45
34
|
},
|
|
46
35
|
};
|
|
47
|
-
mockedGoBack.mockClear();
|
|
48
|
-
});
|
|
49
|
-
afterEach(() => {
|
|
36
|
+
global.mockedGoBack.mockClear();
|
|
50
37
|
Toast.show.mockClear();
|
|
51
38
|
});
|
|
52
39
|
|
|
@@ -105,7 +92,7 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
105
92
|
viewButtonBottom.props.onLeftClick();
|
|
106
93
|
});
|
|
107
94
|
|
|
108
|
-
expect(mockedGoBack).toHaveBeenCalledTimes(1);
|
|
95
|
+
expect(global.mockedGoBack).toHaveBeenCalledTimes(1);
|
|
109
96
|
});
|
|
110
97
|
|
|
111
98
|
it('onSave success', async () => {
|
|
@@ -129,7 +116,7 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
129
116
|
await viewButtonBottom.props.onRightClick();
|
|
130
117
|
});
|
|
131
118
|
|
|
132
|
-
expect(mockedGoBack).toHaveBeenCalledTimes(1);
|
|
119
|
+
expect(global.mockedGoBack).toHaveBeenCalledTimes(1);
|
|
133
120
|
});
|
|
134
121
|
|
|
135
122
|
it('onSave failed', async () => {
|
|
@@ -159,7 +146,7 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
159
146
|
text1: getTranslate('en', 'create_contact_failed'),
|
|
160
147
|
visibilityTime: 1000,
|
|
161
148
|
});
|
|
162
|
-
expect(mockedGoBack).not.toHaveBeenCalled();
|
|
149
|
+
expect(global.mockedGoBack).not.toHaveBeenCalled();
|
|
163
150
|
});
|
|
164
151
|
|
|
165
152
|
it('invalid phone number', async () => {
|
|
@@ -13,6 +13,7 @@ import { SCProvider } from '../../../context';
|
|
|
13
13
|
import { mockSCStore } from '../../../context/mockStore';
|
|
14
14
|
import api from '../../../utils/Apis/axios';
|
|
15
15
|
import { RowUser } from '../../../commons/RowUser';
|
|
16
|
+
import { useNavigation } from '@react-navigation/native';
|
|
16
17
|
|
|
17
18
|
const mock = new MockAdapter(api.axiosInstance);
|
|
18
19
|
|
|
@@ -22,18 +23,6 @@ const wrapComponent = (route) => (
|
|
|
22
23
|
</SCProvider>
|
|
23
24
|
);
|
|
24
25
|
|
|
25
|
-
const mockedNavigate = jest.fn();
|
|
26
|
-
|
|
27
|
-
jest.mock('@react-navigation/native', () => {
|
|
28
|
-
return {
|
|
29
|
-
...jest.requireActual('@react-navigation/native'),
|
|
30
|
-
useNavigation: () => ({
|
|
31
|
-
navigate: mockedNavigate,
|
|
32
|
-
}),
|
|
33
|
-
useIsFocused: () => true,
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
|
|
37
26
|
describe('test EmergencyContactList', () => {
|
|
38
27
|
let route;
|
|
39
28
|
|
|
@@ -44,7 +33,6 @@ describe('test EmergencyContactList', () => {
|
|
|
44
33
|
group: 1,
|
|
45
34
|
},
|
|
46
35
|
};
|
|
47
|
-
mockedNavigate.mockClear();
|
|
48
36
|
mock.reset();
|
|
49
37
|
});
|
|
50
38
|
let tree;
|
|
@@ -137,6 +125,7 @@ describe('test EmergencyContactList', () => {
|
|
|
137
125
|
});
|
|
138
126
|
|
|
139
127
|
it('onItemAddClick select unit members', async () => {
|
|
128
|
+
const { navigate } = useNavigation();
|
|
140
129
|
await act(async () => {
|
|
141
130
|
tree = await create(wrapComponent(route));
|
|
142
131
|
});
|
|
@@ -159,7 +148,7 @@ describe('test EmergencyContactList', () => {
|
|
|
159
148
|
buttonsMenuActionList[1].props.onPress();
|
|
160
149
|
});
|
|
161
150
|
|
|
162
|
-
expect(
|
|
151
|
+
expect(navigate).toHaveBeenCalledWith(
|
|
163
152
|
Routes.EmergencyContactsSelectContacts,
|
|
164
153
|
{
|
|
165
154
|
unitId: route.params.unitId,
|
|
@@ -14,16 +14,6 @@ import { getTranslate } from '../../../utils/I18n';
|
|
|
14
14
|
|
|
15
15
|
const mock = new MockAdapter(api.axiosInstance);
|
|
16
16
|
|
|
17
|
-
const mockedNavigate = jest.fn();
|
|
18
|
-
jest.mock('@react-navigation/native', () => {
|
|
19
|
-
return {
|
|
20
|
-
...jest.requireActual('@react-navigation/native'),
|
|
21
|
-
useNavigation: () => ({
|
|
22
|
-
navigate: mockedNavigate,
|
|
23
|
-
}),
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
|
|
27
17
|
const wrapComponent = (route) => (
|
|
28
18
|
<SCProvider initState={mockSCStore({})}>
|
|
29
19
|
<EmergencyContactsSelectContacts route={route} />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useState } from 'react';
|
|
2
2
|
import { View, TouchableOpacity } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
|
|
5
5
|
import Text from '../../../commons/Text';
|
|
6
6
|
import styles from '../styles/DropDownItem';
|
|
@@ -29,7 +29,7 @@ const DropDownItem = ({ label, data, onSelectItem, isOpen, onOpen, index }) => {
|
|
|
29
29
|
<View style={styles.dropDownContainer}>
|
|
30
30
|
<TouchableOpacity style={styles.dropDownStyle} onPress={handleOnOpen}>
|
|
31
31
|
<Text>{selecteValue?.label}</Text>
|
|
32
|
-
<
|
|
32
|
+
<AntDesign name="caretdown" size={18} color={Colors.Gray8} />
|
|
33
33
|
</TouchableOpacity>
|
|
34
34
|
|
|
35
35
|
{isOpen && (
|
|
@@ -9,6 +9,7 @@ import EnterPassword from '../index';
|
|
|
9
9
|
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
10
10
|
import { API } from '../../../configs';
|
|
11
11
|
import api from '../../../utils/Apis/axios';
|
|
12
|
+
import { useNavigation } from '@react-navigation/native';
|
|
12
13
|
|
|
13
14
|
const mock = new MockAdapter(api.axiosInstance);
|
|
14
15
|
|
|
@@ -18,19 +19,9 @@ const wrapComponent = (route) => (
|
|
|
18
19
|
</SCProvider>
|
|
19
20
|
);
|
|
20
21
|
|
|
21
|
-
const mockNavigate = jest.fn();
|
|
22
|
-
jest.mock('@react-navigation/native', () => {
|
|
23
|
-
return {
|
|
24
|
-
...jest.requireActual('@react-navigation/native'),
|
|
25
|
-
useNavigation: () => ({
|
|
26
|
-
navigate: mockNavigate,
|
|
27
|
-
}),
|
|
28
|
-
useIsFocused: jest.fn(),
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
|
|
32
22
|
describe('Test EnterPassword', () => {
|
|
33
23
|
let tree;
|
|
24
|
+
const { navigate } = useNavigation();
|
|
34
25
|
const buttonDone = (instance) => {
|
|
35
26
|
return instance.findAll(
|
|
36
27
|
(el) =>
|
|
@@ -40,10 +31,6 @@ describe('Test EnterPassword', () => {
|
|
|
40
31
|
);
|
|
41
32
|
};
|
|
42
33
|
|
|
43
|
-
beforeEach(() => {
|
|
44
|
-
mockNavigate.mockClear();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
34
|
it('test render EnterPassword button done', async () => {
|
|
48
35
|
const route = {
|
|
49
36
|
params: { dataParams: {}, type: '' },
|
|
@@ -116,7 +103,7 @@ describe('Test EnterPassword', () => {
|
|
|
116
103
|
await act(async () => {
|
|
117
104
|
await button[0].props.onPress();
|
|
118
105
|
});
|
|
119
|
-
expect(
|
|
106
|
+
expect(navigate).toBeCalled();
|
|
120
107
|
});
|
|
121
108
|
|
|
122
109
|
it('test EnterPassword button failure', async () => {
|
|
@@ -138,6 +125,6 @@ describe('Test EnterPassword', () => {
|
|
|
138
125
|
await act(async () => {
|
|
139
126
|
await button[0].props.onPress();
|
|
140
127
|
});
|
|
141
|
-
expect(
|
|
128
|
+
expect(navigate).not.toBeCalled();
|
|
142
129
|
});
|
|
143
130
|
});
|
|
@@ -20,16 +20,6 @@ const wrapComponent = (route) => (
|
|
|
20
20
|
</SCProvider>
|
|
21
21
|
);
|
|
22
22
|
|
|
23
|
-
const mockGoBack = jest.fn();
|
|
24
|
-
jest.mock('@react-navigation/native', () => {
|
|
25
|
-
return {
|
|
26
|
-
...jest.requireActual('@react-navigation/native'),
|
|
27
|
-
useNavigation: () => ({
|
|
28
|
-
goBack: mockGoBack,
|
|
29
|
-
}),
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
|
|
33
23
|
const mock = new MockAdapter(api.axiosInstance);
|
|
34
24
|
|
|
35
25
|
const getButton = (instance, accessibilityLabel, many = false) => {
|
|
@@ -53,7 +43,6 @@ describe('Test GuestInfo', () => {
|
|
|
53
43
|
let data;
|
|
54
44
|
|
|
55
45
|
beforeEach(() => {
|
|
56
|
-
mockGoBack.mockClear();
|
|
57
46
|
route = {
|
|
58
47
|
params: { id: 1 },
|
|
59
48
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, TouchableOpacity } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
import Text from '../../../commons/Text';
|
|
5
5
|
import styles from '../styles/indexStyles';
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@ const RowGuestInfo = ({
|
|
|
19
19
|
<View style={styles.rowRight}>
|
|
20
20
|
<Text type="Body">{textRight}</Text>
|
|
21
21
|
{rightArrow && (
|
|
22
|
-
<
|
|
22
|
+
<AntDesign name="right" size={20} style={styles.icon} />
|
|
23
23
|
)}
|
|
24
24
|
</View>
|
|
25
25
|
</View>
|
|
@@ -7,7 +7,7 @@ import RowGuestInfo from './components/RowGuestInfo';
|
|
|
7
7
|
import HeaderGuestInfo from './components/HeaderGuestInfo';
|
|
8
8
|
import AccessScheduleSheet from './components/AccessScheduleSheet';
|
|
9
9
|
import { CircleView } from '../../commons/CircleView';
|
|
10
|
-
import
|
|
10
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
11
11
|
import Text from '../../commons/Text';
|
|
12
12
|
import { useBoolean } from '../../hooks/Common';
|
|
13
13
|
import { axiosGet, axiosPut } from '../../utils/Apis/axios';
|
|
@@ -113,7 +113,7 @@ const GuestInfo = ({ route }) => {
|
|
|
113
113
|
/>
|
|
114
114
|
) : (
|
|
115
115
|
<CircleView size={88} center style={styles.avatar}>
|
|
116
|
-
<
|
|
116
|
+
<AntDesign name="user" size={44} color={Colors.Pink1} />
|
|
117
117
|
</CircleView>
|
|
118
118
|
)}
|
|
119
119
|
<Text type="H3" bold>
|
|
@@ -7,7 +7,7 @@ import React, {
|
|
|
7
7
|
} from 'react';
|
|
8
8
|
import { View, TouchableOpacity, FlatList, Image } from 'react-native';
|
|
9
9
|
import { useNavigation } from '@react-navigation/native';
|
|
10
|
-
import
|
|
10
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
11
11
|
import moment from 'moment';
|
|
12
12
|
import styles from './styles/detailStyles';
|
|
13
13
|
import { HeaderCustom } from '../../commons/Header';
|
|
@@ -184,7 +184,11 @@ const HanetCameraDetail = ({ route }) => {
|
|
|
184
184
|
onPress={handleShowMenuAction}
|
|
185
185
|
ref={refMenuAction}
|
|
186
186
|
>
|
|
187
|
-
<
|
|
187
|
+
<MaterialIcons
|
|
188
|
+
name={'more-vert'}
|
|
189
|
+
size={27}
|
|
190
|
+
color={Colors.Black}
|
|
191
|
+
/>
|
|
188
192
|
</TouchableOpacity>
|
|
189
193
|
</View>
|
|
190
194
|
);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { View, TouchableOpacity, Image, FlatList } from 'react-native';
|
|
3
3
|
import { useNavigation } from '@react-navigation/native';
|
|
4
|
-
import
|
|
5
|
-
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
6
5
|
import { HeaderCustom } from '../../commons/Header';
|
|
7
6
|
import Text from '../../commons/Text';
|
|
8
7
|
import RequestFaceIDPopup from './components/RequestFaceIDPopup';
|
|
@@ -75,7 +74,7 @@ const HanetManageAccess = ({ route }) => {
|
|
|
75
74
|
{' '}
|
|
76
75
|
{item.name}
|
|
77
76
|
</Text>
|
|
78
|
-
<
|
|
77
|
+
<AntDesign name="right" size={20} color={Colors.Gray6} />
|
|
79
78
|
</TouchableOpacity>
|
|
80
79
|
);
|
|
81
80
|
},
|
|
@@ -90,7 +89,7 @@ const HanetManageAccess = ({ route }) => {
|
|
|
90
89
|
onPress={setShowAddMemberModal}
|
|
91
90
|
accessibilityLabel={AccessibilityLabel.HANET_MANAGE_ACCESS_ADD_BUTTON}
|
|
92
91
|
>
|
|
93
|
-
<
|
|
92
|
+
<AntDesign name={'plus'} size={27} color={Colors.Black} />
|
|
94
93
|
</TouchableOpacity>
|
|
95
94
|
</View>
|
|
96
95
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { View, TouchableOpacity, Image } from 'react-native';
|
|
3
3
|
import { useNavigation } from '@react-navigation/native';
|
|
4
|
-
import
|
|
4
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
5
5
|
|
|
6
6
|
import { HeaderCustom } from '../../commons/Header';
|
|
7
7
|
import { AlertAction, FullLoading } from '../../commons';
|
|
@@ -78,9 +78,9 @@ const HanetMemberInfo = ({ route }) => {
|
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
80
|
if (success) {
|
|
81
|
-
setMemberAvatar(data
|
|
81
|
+
setMemberAvatar(data?.avatar_uri);
|
|
82
82
|
} else {
|
|
83
|
-
setError(data
|
|
83
|
+
setError(data?.detail);
|
|
84
84
|
}
|
|
85
85
|
setLoading(false);
|
|
86
86
|
};
|
|
@@ -173,7 +173,7 @@ const HanetMemberInfo = ({ route }) => {
|
|
|
173
173
|
onPress={setShowSetFaceIDModal}
|
|
174
174
|
style={[styles.row, !!error && { borderBottomColor: Colors.Red6 }]}
|
|
175
175
|
>
|
|
176
|
-
<
|
|
176
|
+
<AntDesign name="camera" size={27} color={Colors.Primary} />
|
|
177
177
|
<Text
|
|
178
178
|
type="Body"
|
|
179
179
|
bold
|
|
@@ -17,25 +17,11 @@ const wrapComponent = (route) => (
|
|
|
17
17
|
</SCProvider>
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
-
const mockedNavigate = jest.fn();
|
|
21
|
-
const mockedGoBack = jest.fn();
|
|
22
|
-
jest.mock('@react-navigation/native', () => {
|
|
23
|
-
return {
|
|
24
|
-
...jest.requireActual('@react-navigation/native'),
|
|
25
|
-
useNavigation: () => ({
|
|
26
|
-
navigate: mockedNavigate,
|
|
27
|
-
goBack: mockedGoBack,
|
|
28
|
-
}),
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
|
|
32
20
|
const mockSetAvatar = jest.fn();
|
|
33
21
|
describe('Test HanetCaptureFaceID', () => {
|
|
34
22
|
let tree, route;
|
|
35
23
|
|
|
36
24
|
beforeEach(() => {
|
|
37
|
-
mockedNavigate.mockClear();
|
|
38
|
-
mockedGoBack.mockClear();
|
|
39
25
|
mockSetAvatar.mockClear();
|
|
40
26
|
route = {
|
|
41
27
|
params: {
|
|
@@ -100,7 +86,7 @@ describe('Test HanetCaptureFaceID', () => {
|
|
|
100
86
|
await touches[1].props.onPress();
|
|
101
87
|
});
|
|
102
88
|
expect(mockSetAvatar).toHaveBeenCalled();
|
|
103
|
-
expect(mockedGoBack).toHaveBeenCalled();
|
|
89
|
+
expect(global.mockedGoBack).toHaveBeenCalled();
|
|
104
90
|
});
|
|
105
91
|
|
|
106
92
|
it('Test set face id for new member', async () => {
|
|
@@ -117,6 +103,6 @@ describe('Test HanetCaptureFaceID', () => {
|
|
|
117
103
|
await act(async () => {
|
|
118
104
|
await touches[1].props.onPress();
|
|
119
105
|
});
|
|
120
|
-
expect(mockedNavigate).toHaveBeenCalled();
|
|
106
|
+
expect(global.mockedNavigate).toHaveBeenCalled();
|
|
121
107
|
});
|
|
122
108
|
});
|
|
@@ -22,17 +22,6 @@ const wrapComponent = (route) => (
|
|
|
22
22
|
|
|
23
23
|
const mock = new MockAdapter(api.axiosInstance);
|
|
24
24
|
|
|
25
|
-
const mockNavigate = jest.fn();
|
|
26
|
-
jest.mock('@react-navigation/native', () => {
|
|
27
|
-
return {
|
|
28
|
-
...jest.requireActual('@react-navigation/native'),
|
|
29
|
-
useRoute: jest.fn(),
|
|
30
|
-
useNavigation: () => ({
|
|
31
|
-
navigate: mockNavigate,
|
|
32
|
-
}),
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
|
|
36
25
|
describe('Test HanetCameraDetail', () => {
|
|
37
26
|
Date.now = jest.fn(() => new Date('2021-09-09T10:00:00.000Z'));
|
|
38
27
|
let tree, route, responseDisplay, responseCheckin;
|
|
@@ -114,7 +103,7 @@ describe('Test HanetCameraDetail', () => {
|
|
|
114
103
|
expect(textCountStranger.props.children).toBe(1);
|
|
115
104
|
const MenuActionMores = instance.findByType(MenuActionMore);
|
|
116
105
|
await MenuActionMores.props.onItemClick({ data: 'test' });
|
|
117
|
-
expect(
|
|
106
|
+
expect(global.mockedNavigate).toBeCalled();
|
|
118
107
|
});
|
|
119
108
|
|
|
120
109
|
it('Test change date', async () => {
|