@eohjsc/react-native-smart-city 0.6.2 → 0.7.3-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/android/build.gradle +7 -10
- package/assets/images/Automation-fill.svg +85 -0
- package/assets/images/Scenario-filled.svg +22 -0
- package/assets/images/schedule-fill.svg +48 -0
- package/package.json +53 -70
- package/src/commons/Action/ItemQuickAction.js +1 -1
- 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 +3 -3
- 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 +5 -21
- 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/MenuActionMore/MenuActionMoreStyles.js +2 -1
- package/src/commons/MenuActionMore/index.js +1 -1
- package/src/commons/NavBar/NavBarStyles.js +1 -1
- 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 +5 -5
- 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 +93 -85
- 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/Widgets/IFrameWithConfig/IFrameWithConfig.js +44 -1
- package/src/commons/Widgets/IFrameWithConfig/__tests__/IFrameWithConfig.test.js +69 -0
- package/src/commons/WrapParallaxScrollView/index.js +20 -50
- package/src/configs/API.js +1 -2
- package/src/configs/Constants.js +3 -3
- 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 +10 -55
- package/src/screens/Unit/MoreMenu.js +6 -5
- 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 +6 -12
- 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 +5 -5
- 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 +3 -3
- 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 +6 -6
- 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/assets/images/OneTap.svg +0 -14
- package/assets/images/Schedule.svg +0 -39
- package/assets/images/ValueChange.svg +0 -49
- 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
|
@@ -34,18 +34,6 @@ jest.mock('react-native-onesignal', () => {
|
|
|
34
34
|
};
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
jest.mock('@react-navigation/native', () => {
|
|
38
|
-
return {
|
|
39
|
-
...jest.requireActual('@react-navigation/native'),
|
|
40
|
-
useNavigation: () => ({
|
|
41
|
-
navigate: jest.fn(),
|
|
42
|
-
goBack: jest.fn(),
|
|
43
|
-
}),
|
|
44
|
-
useFocusEffect: jest.fn(),
|
|
45
|
-
useIsFocused: () => true,
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
|
|
49
37
|
const wrapComponent = (route, unitData, account) => (
|
|
50
38
|
<SCProvider initState={mockSCStore({})}>
|
|
51
39
|
<UnitDetail
|
|
@@ -9,7 +9,6 @@ import ChooseLocation from '../ChooseLocation';
|
|
|
9
9
|
import { API } from '../../../configs';
|
|
10
10
|
import BottomButtonView from '../../../commons/BottomButtonView';
|
|
11
11
|
import api from '../../../utils/Apis/axios';
|
|
12
|
-
import { useNavigation } from '@react-navigation/native';
|
|
13
12
|
|
|
14
13
|
const wrapComponent = (route) => (
|
|
15
14
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -72,8 +71,6 @@ describe('Test ChooseLocation', () => {
|
|
|
72
71
|
});
|
|
73
72
|
|
|
74
73
|
it('test done choose location', async () => {
|
|
75
|
-
const mockGoBack = useNavigation().goBack;
|
|
76
|
-
|
|
77
74
|
await act(async () => {
|
|
78
75
|
tree = await create(wrapComponent(route));
|
|
79
76
|
});
|
|
@@ -108,6 +105,6 @@ describe('Test ChooseLocation', () => {
|
|
|
108
105
|
latitude: 20,
|
|
109
106
|
longitude: 20,
|
|
110
107
|
});
|
|
111
|
-
expect(
|
|
108
|
+
expect(global.mockedGoBack).toBeCalled();
|
|
112
109
|
});
|
|
113
110
|
});
|
|
@@ -8,8 +8,9 @@ import {
|
|
|
8
8
|
useIsFocused,
|
|
9
9
|
useNavigation,
|
|
10
10
|
useFocusEffect,
|
|
11
|
+
useRoute,
|
|
11
12
|
} from '@react-navigation/native';
|
|
12
|
-
import AsyncStorage from '@react-native-
|
|
13
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
13
14
|
import UnitDetail from '../Detail';
|
|
14
15
|
import { API } from '../../../configs';
|
|
15
16
|
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
@@ -108,7 +109,7 @@ describe('Test UnitDetail', () => {
|
|
|
108
109
|
await act(async () => {
|
|
109
110
|
CameraDeviceViews[0].props.goToPlayBack();
|
|
110
111
|
});
|
|
111
|
-
expect(mockedNavigate).toBeCalledWith(Routes.PlaybackCamera, {
|
|
112
|
+
expect(global.mockedNavigate).toBeCalledWith(Routes.PlaybackCamera, {
|
|
112
113
|
item: undefined,
|
|
113
114
|
thumbnail: undefined,
|
|
114
115
|
});
|
|
@@ -430,7 +431,7 @@ describe('Test UnitDetail', () => {
|
|
|
430
431
|
await act(async () => {
|
|
431
432
|
await goDetailButton[1].props.onPress();
|
|
432
433
|
});
|
|
433
|
-
expect(mockedNavigate).toHaveBeenCalled();
|
|
434
|
+
expect(global.mockedNavigate).toHaveBeenCalled();
|
|
434
435
|
});
|
|
435
436
|
|
|
436
437
|
it('render subunit favorites', async () => {
|
|
@@ -497,8 +498,9 @@ describe('Test UnitDetail', () => {
|
|
|
497
498
|
|
|
498
499
|
it('test get automate onPress goBack', async () => {
|
|
499
500
|
Platform.OS = 'ios';
|
|
500
|
-
route.params.
|
|
501
|
+
route.params.routeName = Routes.Dashboard;
|
|
501
502
|
jest.useFakeTimers();
|
|
503
|
+
|
|
502
504
|
mock.onGet(getAutomates).reply(200, [{}]);
|
|
503
505
|
await act(async () => {
|
|
504
506
|
tree = await renderer.create(wrapComponent(route, account));
|
|
@@ -509,24 +511,24 @@ describe('Test UnitDetail', () => {
|
|
|
509
511
|
const instance = tree.root;
|
|
510
512
|
const preventAccess = instance.findByType(PreventAccess);
|
|
511
513
|
expect(preventAccess).toBeDefined();
|
|
512
|
-
|
|
514
|
+
|
|
515
|
+
const touchableOpacities = instance.findAllByType(TouchableOpacity);
|
|
513
516
|
await act(async () => {
|
|
514
|
-
await
|
|
517
|
+
await touchableOpacities[0].props.onPress();
|
|
515
518
|
});
|
|
516
|
-
expect(
|
|
519
|
+
expect(global.mockedGoBack).toBeCalled();
|
|
517
520
|
});
|
|
518
521
|
|
|
519
522
|
it('test onPress goBack with routeName', async () => {
|
|
520
|
-
|
|
521
|
-
route.params.isSuccessfullyConnected = false;
|
|
523
|
+
useRoute.mockReturnValue({ params: { routeName: Routes.Dashboard } });
|
|
522
524
|
await act(async () => {
|
|
523
525
|
tree = await renderer.create(wrapComponent(route, account));
|
|
524
526
|
});
|
|
525
527
|
const instance = tree.root;
|
|
526
|
-
const
|
|
528
|
+
const touchableOpacities = instance.findAllByType(TouchableOpacity);
|
|
527
529
|
await act(async () => {
|
|
528
|
-
await
|
|
530
|
+
await touchableOpacities[0].props.onPress();
|
|
529
531
|
});
|
|
530
|
-
expect(mockedNavigate).toBeCalled();
|
|
532
|
+
expect(global.mockedNavigate).toBeCalled();
|
|
531
533
|
});
|
|
532
534
|
});
|
|
@@ -16,17 +16,6 @@ import { AlertAction } from '../../../commons';
|
|
|
16
16
|
|
|
17
17
|
const mock = new MockAdapter(api.axiosInstance);
|
|
18
18
|
|
|
19
|
-
const mockNavigate = jest.fn();
|
|
20
|
-
jest.mock('@react-navigation/native', () => {
|
|
21
|
-
return {
|
|
22
|
-
...jest.requireActual('@react-navigation/native'),
|
|
23
|
-
useRoute: jest.fn(),
|
|
24
|
-
useNavigation: () => ({
|
|
25
|
-
navigate: mockNavigate,
|
|
26
|
-
}),
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
|
|
30
19
|
jest.mock('../../../hooks/Common', () => {
|
|
31
20
|
return {
|
|
32
21
|
useIsOwnerOfUnit: () => ({ isOwner: true }),
|
|
@@ -52,10 +41,6 @@ describe('Test Manage Unit', () => {
|
|
|
52
41
|
},
|
|
53
42
|
};
|
|
54
43
|
|
|
55
|
-
beforeEach(() => {
|
|
56
|
-
mockNavigate.mockClear();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
44
|
const getElement = async (instance) => {
|
|
60
45
|
const changeName = instance.findAll(
|
|
61
46
|
(item) =>
|
|
@@ -241,7 +226,7 @@ describe('Test Manage Unit', () => {
|
|
|
241
226
|
await act(async () => {
|
|
242
227
|
buttonWrapper.props.onPress();
|
|
243
228
|
});
|
|
244
|
-
expect(
|
|
229
|
+
expect(global.mockedNavigate).toBeCalled();
|
|
245
230
|
});
|
|
246
231
|
|
|
247
232
|
it('test onPress goToManageSubUnit', async () => {
|
|
@@ -259,6 +244,6 @@ describe('Test Manage Unit', () => {
|
|
|
259
244
|
await act(async () => {
|
|
260
245
|
buttonWrapper.props.onPress();
|
|
261
246
|
});
|
|
262
|
-
expect(
|
|
247
|
+
expect(global.mockedNavigate).toBeCalled();
|
|
263
248
|
});
|
|
264
249
|
});
|
|
@@ -7,19 +7,13 @@ import MoreMenu from '../MoreMenu';
|
|
|
7
7
|
|
|
8
8
|
const mockHidePopover = jest.fn();
|
|
9
9
|
|
|
10
|
-
const mockNavigate = jest.fn();
|
|
11
|
-
jest.mock('@react-navigation/native', () => {
|
|
12
|
-
return {
|
|
13
|
-
...jest.requireActual('@react-navigation/native'),
|
|
14
|
-
useNavigation: () => ({
|
|
15
|
-
navigate: mockNavigate,
|
|
16
|
-
}),
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
|
|
20
10
|
const wrapComponent = (showingPopover) => (
|
|
21
11
|
<SCProvider initState={mockSCStore({})}>
|
|
22
|
-
<MoreMenu
|
|
12
|
+
<MoreMenu
|
|
13
|
+
showingPopover={showingPopover}
|
|
14
|
+
hidePopover={mockHidePopover}
|
|
15
|
+
unit={{ id: 1 }}
|
|
16
|
+
/>
|
|
23
17
|
</SCProvider>
|
|
24
18
|
);
|
|
25
19
|
|
|
@@ -54,6 +48,6 @@ describe('Test MoreMenu', () => {
|
|
|
54
48
|
await menuActionMore.props.onItemClick({ route: 'DeviceDetail' });
|
|
55
49
|
});
|
|
56
50
|
expect(mockHidePopover).toBeCalled();
|
|
57
|
-
expect(
|
|
51
|
+
expect(global.mockedNavigate).toBeCalledWith('DeviceDetail', undefined);
|
|
58
52
|
});
|
|
59
53
|
});
|
|
@@ -20,16 +20,6 @@ const wrapComponent = (route) => (
|
|
|
20
20
|
|
|
21
21
|
const mock = new MockAdapter(api.axiosInstance);
|
|
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
|
describe('Test SelectAddToFavorites', () => {
|
|
34
24
|
let tree, route;
|
|
35
25
|
let dataDevice = [
|
|
@@ -101,7 +91,6 @@ describe('Test SelectAddToFavorites', () => {
|
|
|
101
91
|
];
|
|
102
92
|
|
|
103
93
|
beforeEach(() => {
|
|
104
|
-
mockGoBack.mockClear();
|
|
105
94
|
mock.resetHistory();
|
|
106
95
|
route = {
|
|
107
96
|
params: {
|
|
@@ -165,7 +154,7 @@ describe('Test SelectAddToFavorites', () => {
|
|
|
165
154
|
await bottomButton.props.onPressMain();
|
|
166
155
|
});
|
|
167
156
|
expect(mock.history.post).toHaveLength(2);
|
|
168
|
-
expect(
|
|
157
|
+
expect(global.mockedGoBack).toBeCalled();
|
|
169
158
|
});
|
|
170
159
|
|
|
171
160
|
it('test select only devices then click done', async () => {
|
|
@@ -198,7 +187,7 @@ describe('Test SelectAddToFavorites', () => {
|
|
|
198
187
|
await bottomButton.props.onPressMain();
|
|
199
188
|
});
|
|
200
189
|
expect(mock.history.post).toHaveLength(1);
|
|
201
|
-
expect(
|
|
190
|
+
expect(global.mockedGoBack).toBeCalled();
|
|
202
191
|
});
|
|
203
192
|
|
|
204
193
|
it('test select only scripts then click done', async () => {
|
|
@@ -227,7 +216,7 @@ describe('Test SelectAddToFavorites', () => {
|
|
|
227
216
|
await bottomButton.props.onPressMain();
|
|
228
217
|
});
|
|
229
218
|
expect(mock.history.post).toHaveLength(1);
|
|
230
|
-
expect(
|
|
219
|
+
expect(global.mockedGoBack).toBeCalled();
|
|
231
220
|
});
|
|
232
221
|
|
|
233
222
|
it('test click done call api fail not goBack', async () => {
|
|
@@ -28,18 +28,6 @@ const wrapComponent = (route) => (
|
|
|
28
28
|
|
|
29
29
|
const mock = new MockAdapter(api.axiosInstance);
|
|
30
30
|
|
|
31
|
-
const mockNavigate = jest.fn();
|
|
32
|
-
const mockGoBack = jest.fn();
|
|
33
|
-
jest.mock('@react-navigation/native', () => {
|
|
34
|
-
return {
|
|
35
|
-
...jest.requireActual('@react-navigation/native'),
|
|
36
|
-
useNavigation: () => ({
|
|
37
|
-
navigate: mockNavigate,
|
|
38
|
-
goBack: mockGoBack,
|
|
39
|
-
}),
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
|
|
43
31
|
jest.mock('react-native-maps', () => {
|
|
44
32
|
const { forwardRef } = require('react');
|
|
45
33
|
const { View } = require('react-native');
|
|
@@ -105,7 +93,6 @@ describe('Test SelectAddress', () => {
|
|
|
105
93
|
},
|
|
106
94
|
};
|
|
107
95
|
mockUpdateLocation.mockClear();
|
|
108
|
-
mockGoBack.mockClear();
|
|
109
96
|
mock.resetHistory();
|
|
110
97
|
});
|
|
111
98
|
|
|
@@ -119,7 +106,7 @@ describe('Test SelectAddress', () => {
|
|
|
119
106
|
await bottomButton.props.onPressMain();
|
|
120
107
|
});
|
|
121
108
|
expect(mockUpdateLocation).not.toBeCalled();
|
|
122
|
-
expect(
|
|
109
|
+
expect(global.mockedGoBack).not.toBeCalled();
|
|
123
110
|
});
|
|
124
111
|
|
|
125
112
|
it('test search location', async () => {
|
|
@@ -176,7 +163,7 @@ describe('Test SelectAddress', () => {
|
|
|
176
163
|
await bottomButton.props.onPressMain();
|
|
177
164
|
});
|
|
178
165
|
expect(mockUpdateLocation).toBeCalledWith('1');
|
|
179
|
-
expect(
|
|
166
|
+
expect(global.mockedGoBack).toBeCalled();
|
|
180
167
|
});
|
|
181
168
|
|
|
182
169
|
it('test chose search result will center map', async () => {
|
|
@@ -336,7 +323,7 @@ describe('Test SelectAddress', () => {
|
|
|
336
323
|
await act(async () => {
|
|
337
324
|
await bottomButton.props.onPressMain();
|
|
338
325
|
});
|
|
339
|
-
expect(
|
|
326
|
+
expect(global.mockedGoBack).not.toBeCalled();
|
|
340
327
|
});
|
|
341
328
|
|
|
342
329
|
it('test get current location failed permission denied', async () => {
|
|
@@ -469,6 +456,6 @@ describe('Test SelectAddress', () => {
|
|
|
469
456
|
await act(async () => {
|
|
470
457
|
await button.props.onPress();
|
|
471
458
|
});
|
|
472
|
-
expect(
|
|
459
|
+
expect(global.mockedNavigate).toBeCalled();
|
|
473
460
|
});
|
|
474
461
|
});
|
|
@@ -50,9 +50,9 @@ describe('Test SmartAccount', () => {
|
|
|
50
50
|
},
|
|
51
51
|
],
|
|
52
52
|
};
|
|
53
|
-
const
|
|
53
|
+
const mockedNavigate = useNavigation().navigate;
|
|
54
54
|
beforeEach(() => {
|
|
55
|
-
|
|
55
|
+
mockedNavigate.mockReset();
|
|
56
56
|
mock.resetHistory();
|
|
57
57
|
});
|
|
58
58
|
|
|
@@ -79,15 +79,18 @@ describe('Test SmartAccount', () => {
|
|
|
79
79
|
await act(async () => {
|
|
80
80
|
await alertAction[0].props.leftButtonClick();
|
|
81
81
|
});
|
|
82
|
-
expect(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
82
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(
|
|
83
|
+
Routes.SmartAccountStack,
|
|
84
|
+
{
|
|
85
|
+
screen: Routes.ListDeviceSmartAccount,
|
|
86
|
+
params: {
|
|
87
|
+
username: response.data[0].username,
|
|
88
|
+
brand: response.data[0].brand,
|
|
89
|
+
smart_account_id: response.data[0].id,
|
|
90
|
+
unit_id: route.params.unitId,
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
);
|
|
91
94
|
const menuActionMore = instance.findByType(MenuActionMore);
|
|
92
95
|
await act(async () => {
|
|
93
96
|
menuActionMore.props.onItemClick({ action: 'remove' });
|
|
@@ -19,17 +19,6 @@ const wrapComponent = (route) => (
|
|
|
19
19
|
</SCProvider>
|
|
20
20
|
);
|
|
21
21
|
|
|
22
|
-
const mockedNavigate = jest.fn();
|
|
23
|
-
|
|
24
|
-
jest.mock('@react-navigation/native', () => {
|
|
25
|
-
return {
|
|
26
|
-
...jest.requireActual('@react-navigation/native'),
|
|
27
|
-
useNavigation: () => ({
|
|
28
|
-
goBack: mockedNavigate,
|
|
29
|
-
}),
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
|
|
33
22
|
describe('Test SmartAccountItem', () => {
|
|
34
23
|
let tree;
|
|
35
24
|
it('test render SmartAccountItem', async () => {
|
|
@@ -19,17 +19,6 @@ const wrapComponent = (props) => (
|
|
|
19
19
|
</SCProvider>
|
|
20
20
|
);
|
|
21
21
|
|
|
22
|
-
const mockedNavigate = jest.fn();
|
|
23
|
-
jest.mock('@react-navigation/native', () => {
|
|
24
|
-
return {
|
|
25
|
-
...jest.requireActual('@react-navigation/native'),
|
|
26
|
-
useIsFocused: jest.fn(),
|
|
27
|
-
useNavigation: () => ({
|
|
28
|
-
navigate: mockedNavigate,
|
|
29
|
-
}),
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
|
|
33
22
|
jest.mock('react-native-onesignal', () => {
|
|
34
23
|
return {
|
|
35
24
|
setNotificationWillShowInForegroundHandler: jest.fn(),
|
|
@@ -52,7 +41,6 @@ describe('Test Summaries', () => {
|
|
|
52
41
|
id: 1,
|
|
53
42
|
},
|
|
54
43
|
};
|
|
55
|
-
mockedNavigate.mockReset();
|
|
56
44
|
mock.reset();
|
|
57
45
|
});
|
|
58
46
|
|
|
@@ -76,7 +64,7 @@ describe('Test Summaries', () => {
|
|
|
76
64
|
await act(async () => {
|
|
77
65
|
items[0].props.goToSummary({ id: 1 });
|
|
78
66
|
});
|
|
79
|
-
expect(mockedNavigate).toBeCalled();
|
|
67
|
+
expect(global.mockedNavigate).toBeCalled();
|
|
80
68
|
});
|
|
81
69
|
|
|
82
70
|
it('render Summaries receive noti with summary_id then not reload', async () => {
|
|
@@ -92,7 +80,7 @@ describe('Test Summaries', () => {
|
|
|
92
80
|
await act(async () => {
|
|
93
81
|
tree = await renderer.create(wrapComponent(props));
|
|
94
82
|
});
|
|
95
|
-
expect(mockedNavigate).not.toBeCalled();
|
|
83
|
+
expect(global.mockedNavigate).not.toBeCalled();
|
|
96
84
|
});
|
|
97
85
|
|
|
98
86
|
it('fetch data non-stop', async () => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, TouchableWithoutFeedback } 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 Text from '../../../../commons/Text';
|
|
6
6
|
import FImage from '../../../../commons/FImage';
|
|
7
|
-
import OneTap from '../../../../../assets/images/
|
|
8
|
-
import ValueChange from '../../../../../assets/images/
|
|
9
|
-
import Schedule from '../../../../../assets/images/
|
|
7
|
+
import OneTap from '../../../../../assets/images/Scenario-filled.svg';
|
|
8
|
+
import ValueChange from '../../../../../assets/images/Automation-fill.svg';
|
|
9
|
+
import Schedule from '../../../../../assets/images/schedule-fill.svg';
|
|
10
10
|
import Event from '../../../../../assets/images/Event.svg';
|
|
11
11
|
import styles from './styles';
|
|
12
12
|
import {
|
|
@@ -61,7 +61,7 @@ const AutomateScript = ({ automate, onPress, isSelected }) => {
|
|
|
61
61
|
<Text numberOfLines={1} type={'Label'} color={Colors.Gray7}>
|
|
62
62
|
{t('created_by', { name: author })}
|
|
63
63
|
</Text>
|
|
64
|
-
<
|
|
64
|
+
<AntDesign name="right" size={12} />
|
|
65
65
|
</View>
|
|
66
66
|
</View>
|
|
67
67
|
</View>
|
|
@@ -2,8 +2,7 @@ import React, { memo } from 'react';
|
|
|
2
2
|
import { View, TouchableOpacity, Image } from 'react-native';
|
|
3
3
|
import Text from '../../../../commons/Text';
|
|
4
4
|
import { Colors } from '../../../../configs';
|
|
5
|
-
import
|
|
6
|
-
import { IconOutline } from '@ant-design/icons-react-native';
|
|
5
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
7
6
|
import { AccessibilityLabel } from '../../../../configs/Constants';
|
|
8
7
|
import styles from './styles';
|
|
9
8
|
|
|
@@ -47,10 +46,10 @@ const ButtonWrapper = ({
|
|
|
47
46
|
<Image source={{ uri: value }} style={styles.avatar} />
|
|
48
47
|
) : (
|
|
49
48
|
<View style={styles.avatar}>
|
|
50
|
-
<
|
|
49
|
+
<AntDesign name={'user'} size={27} />
|
|
51
50
|
</View>
|
|
52
51
|
)}
|
|
53
|
-
<
|
|
52
|
+
<AntDesign name="right" size={20} color={Colors.Gray7} />
|
|
54
53
|
</View>
|
|
55
54
|
</View>
|
|
56
55
|
{children}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useCallback, useRef, useState } from 'react';
|
|
2
2
|
import { Dimensions, View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
3
|
import Popover from '../../../../commons/Popover';
|
|
4
|
-
import
|
|
4
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
5
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
5
6
|
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
6
7
|
|
|
7
8
|
import { Colors } from '../../../../configs';
|
|
@@ -97,7 +98,7 @@ const HeaderComponent = ({ title, goBack, dark, hideRight, style }) => {
|
|
|
97
98
|
onPress={() => setShowModal(true)}
|
|
98
99
|
style={styles.rightHeader}
|
|
99
100
|
>
|
|
100
|
-
<
|
|
101
|
+
<AntDesign
|
|
101
102
|
name="plus"
|
|
102
103
|
size={32}
|
|
103
104
|
color={dark ? Colors.Black : Colors.White}
|
|
@@ -107,8 +108,8 @@ const HeaderComponent = ({ title, goBack, dark, hideRight, style }) => {
|
|
|
107
108
|
onPress={() => setMenu(true)}
|
|
108
109
|
style={styles.rightHeader}
|
|
109
110
|
>
|
|
110
|
-
<
|
|
111
|
-
name="more"
|
|
111
|
+
<MaterialIcons
|
|
112
|
+
name="more-vert"
|
|
112
113
|
size={30}
|
|
113
114
|
color={dark ? Colors.Black : Colors.White}
|
|
114
115
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Fragment, useCallback } from 'react';
|
|
2
2
|
import { View, Image, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
4
|
-
import
|
|
4
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
5
5
|
|
|
6
6
|
import { API, Colors, Images } from '../../../../configs';
|
|
7
7
|
import Text from '../../../../commons/Text';
|
|
@@ -88,7 +88,7 @@ const SharedUnit = ({
|
|
|
88
88
|
{isOptions && (
|
|
89
89
|
<Fragment>
|
|
90
90
|
{item.is_pin ? (
|
|
91
|
-
<
|
|
91
|
+
<AntDesign
|
|
92
92
|
name="pushpin"
|
|
93
93
|
size={20}
|
|
94
94
|
color={Colors.Blue10}
|
|
@@ -98,7 +98,7 @@ const SharedUnit = ({
|
|
|
98
98
|
}
|
|
99
99
|
/>
|
|
100
100
|
) : (
|
|
101
|
-
<
|
|
101
|
+
<AntDesign
|
|
102
102
|
name="pushpin"
|
|
103
103
|
size={20}
|
|
104
104
|
onPress={addPinSharedUnit}
|
|
@@ -106,7 +106,7 @@ const SharedUnit = ({
|
|
|
106
106
|
/>
|
|
107
107
|
)}
|
|
108
108
|
{item.is_star ? (
|
|
109
|
-
<
|
|
109
|
+
<AntDesign
|
|
110
110
|
name="star"
|
|
111
111
|
size={20}
|
|
112
112
|
color={Colors.Yellow6}
|
|
@@ -116,7 +116,7 @@ const SharedUnit = ({
|
|
|
116
116
|
}
|
|
117
117
|
/>
|
|
118
118
|
) : (
|
|
119
|
-
<
|
|
119
|
+
<AntDesign
|
|
120
120
|
name="star"
|
|
121
121
|
size={20}
|
|
122
122
|
onPress={addStarSharedUnit}
|
|
@@ -17,19 +17,6 @@ const wrapComponent = (title, goBack, dark, hideRight) => (
|
|
|
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
|
-
useIsFocused: () => true,
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
|
|
33
20
|
describe('Test Header', () => {
|
|
34
21
|
let tree;
|
|
35
22
|
it('test hideModal', async () => {
|
|
@@ -97,6 +84,6 @@ describe('Test Header', () => {
|
|
|
97
84
|
await act(async () => {
|
|
98
85
|
touchableOpacity[0].props.onPress();
|
|
99
86
|
});
|
|
100
|
-
expect(mockedGoBack).toHaveBeenCalled();
|
|
87
|
+
expect(global.mockedGoBack).toHaveBeenCalled();
|
|
101
88
|
});
|
|
102
89
|
});
|
|
@@ -7,16 +7,6 @@ import MyUnitDevice from '../MyUnitDevice';
|
|
|
7
7
|
import ItemQuickAction from '../../../../commons/Action/ItemQuickAction';
|
|
8
8
|
import Text from '../../../../commons/Text';
|
|
9
9
|
|
|
10
|
-
const mockNavigate = jest.fn();
|
|
11
|
-
jest.mock('@react-navigation/native', () => {
|
|
12
|
-
return {
|
|
13
|
-
...jest.requireActual('@react-navigation/native'),
|
|
14
|
-
useNavigation: () => ({
|
|
15
|
-
navigate: mockNavigate,
|
|
16
|
-
}),
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
|
|
20
10
|
jest.mock('react', () => {
|
|
21
11
|
return {
|
|
22
12
|
...jest.requireActual('react'),
|
|
@@ -57,7 +47,7 @@ describe('Test MyUnitDevice', () => {
|
|
|
57
47
|
await act(async () => {
|
|
58
48
|
await touches[0].props.onPress();
|
|
59
49
|
});
|
|
60
|
-
expect(
|
|
50
|
+
expect(global.mockedNavigate).toHaveBeenCalled();
|
|
61
51
|
});
|
|
62
52
|
|
|
63
53
|
it('Test render without status', async () => {
|
|
@@ -25,16 +25,6 @@ const wrapComponent = (item, navigation) => (
|
|
|
25
25
|
</SCProvider>
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
const mockNavigate = jest.fn();
|
|
29
|
-
jest.mock('@react-navigation/native', () => {
|
|
30
|
-
return {
|
|
31
|
-
...jest.requireActual('@react-navigation/native'),
|
|
32
|
-
useNavigation: () => ({
|
|
33
|
-
navigate: mockNavigate,
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
|
|
38
28
|
describe('Test SharedUnit', () => {
|
|
39
29
|
let tree;
|
|
40
30
|
|
|
@@ -70,7 +60,7 @@ describe('Test SharedUnit', () => {
|
|
|
70
60
|
await act(async () => {
|
|
71
61
|
touchSharedUnit.props.onPress();
|
|
72
62
|
});
|
|
73
|
-
expect(
|
|
63
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
|
|
74
64
|
screen: Routes.UnitDetail,
|
|
75
65
|
params: {
|
|
76
66
|
unitId: 3,
|