@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
|
@@ -144,6 +144,11 @@ const Shared = () => {
|
|
|
144
144
|
ItemSeparatorComponent={() => <View style={styles.seperator} />}
|
|
145
145
|
contentContainerStyle={styles.scrollView}
|
|
146
146
|
scrollIndicatorInsets={{ right: 1 }}
|
|
147
|
+
getItemLayout={(data, index) => ({
|
|
148
|
+
length: 52,
|
|
149
|
+
offset: 52 * index,
|
|
150
|
+
index,
|
|
151
|
+
})}
|
|
147
152
|
/>
|
|
148
153
|
) : (
|
|
149
154
|
<FlatList
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo, useMemo, useState } from 'react';
|
|
2
2
|
import { View, Text, TouchableOpacity } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
import { Colors } from '../../../configs';
|
|
5
5
|
import styles from './Styles/DeviceItemStyles';
|
|
6
6
|
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
@@ -71,11 +71,11 @@ const EndDevice = ({
|
|
|
71
71
|
{name}
|
|
72
72
|
</Text>
|
|
73
73
|
{checked && (
|
|
74
|
-
<
|
|
74
|
+
<AntDesign name={'check'} color={Colors.Primary} size={20} />
|
|
75
75
|
)}
|
|
76
76
|
|
|
77
77
|
{dataConfig.length > 0 && (
|
|
78
|
-
<
|
|
78
|
+
<AntDesign
|
|
79
79
|
onPress={() => toggleExpandEndDevice()}
|
|
80
80
|
name={isItemExpanded ? 'up' : 'down'}
|
|
81
81
|
size={20}
|
|
@@ -21,10 +21,11 @@ import { axiosPost } from '../../utils/Apis/axios';
|
|
|
21
21
|
import { AccessibilityLabel } from '../../configs/Constants';
|
|
22
22
|
import Text from '../../commons/Text';
|
|
23
23
|
import { ToastBottomHelper } from '../../utils/Utils';
|
|
24
|
+
import Routes from '../../utils/Route';
|
|
24
25
|
|
|
25
26
|
const SharingInviteMembers = ({ route }) => {
|
|
26
27
|
const t = useTranslations();
|
|
27
|
-
const
|
|
28
|
+
const { goBack, navigate } = useNavigation();
|
|
28
29
|
const { unit, permissions } = route?.params || {};
|
|
29
30
|
const [errorText, setErrorText] = useState('');
|
|
30
31
|
const [content, setContent] = useState('');
|
|
@@ -70,8 +71,8 @@ const SharingInviteMembers = ({ route }) => {
|
|
|
70
71
|
}, [content, sharePermissions, t]);
|
|
71
72
|
|
|
72
73
|
const onPressNext = useCallback(() => {
|
|
73
|
-
|
|
74
|
-
}, [
|
|
74
|
+
navigate(Routes.UnitDetail, { unitId: unit.id });
|
|
75
|
+
}, [navigate, unit?.id]);
|
|
75
76
|
|
|
76
77
|
return (
|
|
77
78
|
<View style={styles.wrapContainer}>
|
|
@@ -150,7 +151,7 @@ const SharingInviteMembers = ({ route }) => {
|
|
|
150
151
|
<ViewButtonBottom
|
|
151
152
|
disableKeyBoardAnimated={true}
|
|
152
153
|
leftTitle={t('back')}
|
|
153
|
-
onLeftClick={
|
|
154
|
+
onLeftClick={goBack}
|
|
154
155
|
rightTitle={t('done')}
|
|
155
156
|
rightDisabled={false}
|
|
156
157
|
onRightClick={onPressNext}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
3
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
3
4
|
import { useNavigation, useIsFocused } from '@react-navigation/native';
|
|
4
5
|
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
5
6
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
@@ -81,11 +82,11 @@ const UnitMemberList = ({ route }) => {
|
|
|
81
82
|
onPress={onPressRightHeader}
|
|
82
83
|
style={styles.rightHeader}
|
|
83
84
|
>
|
|
84
|
-
|
|
85
|
-
name={
|
|
86
|
-
|
|
87
|
-
color={Colors.Black}
|
|
88
|
-
|
|
85
|
+
{isOwner ? (
|
|
86
|
+
<AntDesign name={'plus'} size={27} color={Colors.Black} />
|
|
87
|
+
) : (
|
|
88
|
+
<MaterialIcons name={'more-vert'} size={27} color={Colors.Black} />
|
|
89
|
+
)}
|
|
89
90
|
</TouchableOpacity>
|
|
90
91
|
);
|
|
91
92
|
|
|
@@ -15,6 +15,7 @@ import ItemChangeRole from '../Components/ItemChangeRole';
|
|
|
15
15
|
import ModalPopupCT from '../../../commons/ModalPopupCT';
|
|
16
16
|
import Routes from '../../../utils/Route';
|
|
17
17
|
import { useNavigation } from '@react-navigation/native';
|
|
18
|
+
import RowGuestInfo from '../../GuestInfo/components/RowGuestInfo';
|
|
18
19
|
|
|
19
20
|
const mock = new MockAdapter(api.axiosInstance);
|
|
20
21
|
|
|
@@ -164,7 +165,11 @@ describe('Test InfoMemberUnit', () => {
|
|
|
164
165
|
await act(async () => {
|
|
165
166
|
await alertAction.props.rightButtonClick();
|
|
166
167
|
});
|
|
167
|
-
|
|
168
|
+
|
|
169
|
+
await act(async () => {
|
|
170
|
+
jest.runAllTimers();
|
|
171
|
+
});
|
|
172
|
+
|
|
168
173
|
expect(alertAction.props.visible).toEqual(false);
|
|
169
174
|
expect(modalPopupCT.props.isVisible).toEqual(true);
|
|
170
175
|
|
|
@@ -175,7 +180,7 @@ describe('Test InfoMemberUnit', () => {
|
|
|
175
180
|
await viewButtonBottom[1].props.onRightClick();
|
|
176
181
|
});
|
|
177
182
|
expect(modalPopupCT.props.isVisible).toEqual(false);
|
|
178
|
-
expect(mockedNavigate).toHaveBeenCalledWith(Routes.EnterPassword, {
|
|
183
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.EnterPassword, {
|
|
179
184
|
dataParams: {
|
|
180
185
|
unit_id: 1,
|
|
181
186
|
member: {
|
|
@@ -200,11 +205,11 @@ describe('Test InfoMemberUnit', () => {
|
|
|
200
205
|
tree = await create(wrapComponent(route));
|
|
201
206
|
});
|
|
202
207
|
const instance = tree.root;
|
|
203
|
-
const rows = instance.findAllByType(
|
|
208
|
+
const rows = instance.findAllByType(RowGuestInfo);
|
|
204
209
|
|
|
205
210
|
await act(async () => {
|
|
206
211
|
await rows[rows.length - 1].props.onPress();
|
|
207
212
|
});
|
|
208
|
-
expect(mockedNavigate).
|
|
213
|
+
expect(global.mockedNavigate).toHaveBeenCalledTimes(1);
|
|
209
214
|
});
|
|
210
215
|
});
|
|
@@ -14,17 +14,6 @@ import Routes from '../../../utils/Route';
|
|
|
14
14
|
|
|
15
15
|
const mock = new MockAdapter(api.axiosInstance);
|
|
16
16
|
jest.spyOn(Alert, 'alert').mockImplementation(() => {});
|
|
17
|
-
const mockNavigate = jest.fn();
|
|
18
|
-
const mockGoBack = jest.fn();
|
|
19
|
-
jest.mock('@react-navigation/native', () => {
|
|
20
|
-
return {
|
|
21
|
-
...jest.requireActual('@react-navigation/native'),
|
|
22
|
-
useNavigation: () => ({
|
|
23
|
-
navigate: mockNavigate,
|
|
24
|
-
goBack: mockGoBack,
|
|
25
|
-
}),
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
17
|
|
|
29
18
|
const wrapComponent = (route) => (
|
|
30
19
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -69,8 +58,6 @@ describe('Test SelectShareDevice', () => {
|
|
|
69
58
|
afterEach(() => {
|
|
70
59
|
Alert.alert.mockReset();
|
|
71
60
|
mock.resetHistory();
|
|
72
|
-
mockNavigate.mockClear();
|
|
73
|
-
mockGoBack.mockClear();
|
|
74
61
|
});
|
|
75
62
|
|
|
76
63
|
const clickCheckBoxAllDevice = async (instance, statusCheckbox) => {
|
|
@@ -157,7 +144,7 @@ describe('Test SelectShareDevice', () => {
|
|
|
157
144
|
await act(async () => {
|
|
158
145
|
ViewButtonBottomElement[0].props.onRightClick();
|
|
159
146
|
});
|
|
160
|
-
expect(
|
|
147
|
+
expect(global.mockedNavigate).toBeCalledWith(Routes.SharingInviteMembers, {
|
|
161
148
|
unit: { id: 1, name: 'unit 1' },
|
|
162
149
|
permissions: {
|
|
163
150
|
read_permissions: [
|
|
@@ -195,7 +182,7 @@ describe('Test SelectShareDevice', () => {
|
|
|
195
182
|
await act(async () => {
|
|
196
183
|
ViewButtonBottomElement[0].props.onLeftClick();
|
|
197
184
|
});
|
|
198
|
-
expect(
|
|
185
|
+
expect(global.mockedGoBack).toBeCalled();
|
|
199
186
|
});
|
|
200
187
|
|
|
201
188
|
it('user not choose device click button next', async () => {
|
|
@@ -22,26 +22,6 @@ const wrapComponent = (route) => (
|
|
|
22
22
|
|
|
23
23
|
const mock = new MockAdapter(api.axiosInstance);
|
|
24
24
|
|
|
25
|
-
const mockedNavigate = jest.fn();
|
|
26
|
-
const mockedGoBack = jest.fn();
|
|
27
|
-
const mockedDangerouslyGetState = jest.fn();
|
|
28
|
-
const mockedDangerouslyGetParentGoBack = jest.fn();
|
|
29
|
-
|
|
30
|
-
jest.mock('@react-navigation/native', () => {
|
|
31
|
-
return {
|
|
32
|
-
...jest.requireActual('@react-navigation/native'),
|
|
33
|
-
useNavigation: () => ({
|
|
34
|
-
navigate: mockedNavigate,
|
|
35
|
-
goBack: mockedGoBack,
|
|
36
|
-
dangerouslyGetParent: () => ({
|
|
37
|
-
dangerouslyGetState: mockedDangerouslyGetState,
|
|
38
|
-
goBack: mockedDangerouslyGetParentGoBack,
|
|
39
|
-
}),
|
|
40
|
-
}),
|
|
41
|
-
useIsFocused: jest.fn(),
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
|
|
45
25
|
describe('test SharingInviteMembers container', () => {
|
|
46
26
|
let tree;
|
|
47
27
|
let route;
|
|
@@ -100,7 +80,7 @@ describe('test SharingInviteMembers container', () => {
|
|
|
100
80
|
await act(async () => {
|
|
101
81
|
viewButtonBottom.props.onLeftClick();
|
|
102
82
|
});
|
|
103
|
-
expect(mockedGoBack).toHaveBeenCalled();
|
|
83
|
+
expect(global.mockedGoBack).toHaveBeenCalled();
|
|
104
84
|
});
|
|
105
85
|
|
|
106
86
|
it('viewButtonBottom onRightClick', async () => {
|
|
@@ -112,7 +92,7 @@ describe('test SharingInviteMembers container', () => {
|
|
|
112
92
|
await act(async () => {
|
|
113
93
|
viewButtonBottom.props.onRightClick();
|
|
114
94
|
});
|
|
115
|
-
expect(
|
|
95
|
+
expect(global.mockedNavigate).toHaveBeenCalled();
|
|
116
96
|
});
|
|
117
97
|
|
|
118
98
|
it('_TextInput onChange phone, invalidate and not call api sharedPermission', async () => {
|
|
@@ -70,7 +70,7 @@ describe('test MemberList', () => {
|
|
|
70
70
|
await act(async () => {
|
|
71
71
|
await memberListButtons[1].props.onPress();
|
|
72
72
|
});
|
|
73
|
-
expect(mockedNavigate).toBeCalledWith(Routes.AddMemberStack, {
|
|
73
|
+
expect(global.mockedNavigate).toBeCalledWith(Routes.AddMemberStack, {
|
|
74
74
|
screen: Routes.SelectShareDevice,
|
|
75
75
|
params: { unit: { id: 1 } },
|
|
76
76
|
});
|
|
@@ -99,7 +99,7 @@ describe('test MemberList', () => {
|
|
|
99
99
|
await act(async () => {
|
|
100
100
|
await memberListButtons[1].props.onPress();
|
|
101
101
|
});
|
|
102
|
-
expect(mockedNavigate).not.toBeCalled();
|
|
102
|
+
expect(global.mockedNavigate).not.toBeCalled();
|
|
103
103
|
expect(spyToastError).toBeCalledWith(
|
|
104
104
|
getTranslate('en', 'reach_max_members_per_unit', { length: 0 }),
|
|
105
105
|
'',
|
|
@@ -13,17 +13,6 @@ import AccessibilityLabel from '../../../configs/AccessibilityLabel';
|
|
|
13
13
|
|
|
14
14
|
const mock = new MockAdapter(api.axiosInstance);
|
|
15
15
|
jest.spyOn(Alert, 'alert').mockImplementation(() => {});
|
|
16
|
-
const mockNavigate = jest.fn();
|
|
17
|
-
const mockGoBack = jest.fn();
|
|
18
|
-
jest.mock('@react-navigation/native', () => {
|
|
19
|
-
return {
|
|
20
|
-
...jest.requireActual('@react-navigation/native'),
|
|
21
|
-
useNavigation: () => ({
|
|
22
|
-
navigate: mockNavigate,
|
|
23
|
-
goBack: mockGoBack,
|
|
24
|
-
}),
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
16
|
|
|
28
17
|
const wrapComponent = (route) => (
|
|
29
18
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -74,8 +63,6 @@ describe('Test UpdateShareDevice', () => {
|
|
|
74
63
|
afterEach(() => {
|
|
75
64
|
Alert.alert.mockReset();
|
|
76
65
|
mock.resetHistory();
|
|
77
|
-
mockNavigate.mockClear();
|
|
78
|
-
mockGoBack.mockClear();
|
|
79
66
|
});
|
|
80
67
|
|
|
81
68
|
const clickCheckBoxAllDevice = async (instance, statusCheckbox) => {
|
|
@@ -164,7 +151,7 @@ describe('Test UpdateShareDevice', () => {
|
|
|
164
151
|
await act(async () => {
|
|
165
152
|
ViewButtonBottomElement[0].props.onRightClick();
|
|
166
153
|
});
|
|
167
|
-
expect(
|
|
154
|
+
expect(global.mockedGoBack).toBeCalled();
|
|
168
155
|
expect(mock.history.post[0].data).toEqual(
|
|
169
156
|
JSON.stringify({
|
|
170
157
|
phone: '0901234567',
|
|
@@ -198,7 +185,7 @@ describe('Test UpdateShareDevice', () => {
|
|
|
198
185
|
await act(async () => {
|
|
199
186
|
ViewButtonBottomElement[0].props.onRightClick();
|
|
200
187
|
});
|
|
201
|
-
expect(
|
|
188
|
+
expect(global.mockedGoBack).toBeCalled();
|
|
202
189
|
expect(mock.history.post[0].data).toEqual(
|
|
203
190
|
JSON.stringify({
|
|
204
191
|
phone: '',
|
|
@@ -230,7 +217,7 @@ describe('Test UpdateShareDevice', () => {
|
|
|
230
217
|
await act(async () => {
|
|
231
218
|
ViewButtonBottomElement[0].props.onRightClick();
|
|
232
219
|
});
|
|
233
|
-
expect(
|
|
220
|
+
expect(global.mockedGoBack).not.toBeCalled();
|
|
234
221
|
expect(mock.history.post[0].data).toEqual(
|
|
235
222
|
JSON.stringify({
|
|
236
223
|
phone: '',
|
|
@@ -287,7 +274,7 @@ describe('Test UpdateShareDevice', () => {
|
|
|
287
274
|
await act(async () => {
|
|
288
275
|
ViewButtonBottomElement[0].props.onLeftClick();
|
|
289
276
|
});
|
|
290
|
-
expect(
|
|
277
|
+
expect(global.mockedGoBack).toBeCalled();
|
|
291
278
|
});
|
|
292
279
|
|
|
293
280
|
it('user not choose device click button next', async () => {
|
|
@@ -18,19 +18,8 @@ const mockUseContext = jest.fn().mockImplementation(() => ({
|
|
|
18
18
|
stateData: mockSCStore({}),
|
|
19
19
|
setAction: mockedSetAction,
|
|
20
20
|
}));
|
|
21
|
-
const mockNavigate = jest.fn();
|
|
22
|
-
const mockGoBack = jest.fn();
|
|
23
21
|
|
|
24
22
|
React.useContext = mockUseContext;
|
|
25
|
-
jest.mock('@react-navigation/native', () => {
|
|
26
|
-
return {
|
|
27
|
-
...jest.requireActual('@react-navigation/native'),
|
|
28
|
-
useNavigation: () => ({
|
|
29
|
-
goBack: mockGoBack,
|
|
30
|
-
navigate: mockNavigate,
|
|
31
|
-
}),
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
23
|
|
|
35
24
|
describe('Test useDataMember', () => {
|
|
36
25
|
it('render useDataMember', async () => {
|
|
@@ -44,7 +33,7 @@ describe('Test useDataMember', () => {
|
|
|
44
33
|
await act(async () => {
|
|
45
34
|
result.current.leaveUnit(1);
|
|
46
35
|
});
|
|
47
|
-
expect(
|
|
36
|
+
expect(global.mockedNavigate).toBeCalledWith(Routes.Dashboard);
|
|
48
37
|
});
|
|
49
38
|
|
|
50
39
|
it('render useDataMember loadMembers', async () => {
|
|
@@ -75,6 +64,6 @@ describe('Test useDataMember', () => {
|
|
|
75
64
|
await act(async () => {
|
|
76
65
|
result.current.removeMember(1, 'json');
|
|
77
66
|
});
|
|
78
|
-
expect(
|
|
67
|
+
expect(global.mockedGoBack).toBeCalled();
|
|
79
68
|
});
|
|
80
69
|
});
|
|
@@ -10,7 +10,6 @@ import { SCContext, useSCContextSelector } from '../../../context';
|
|
|
10
10
|
import { axiosPost } from '../../../utils/Apis/axios';
|
|
11
11
|
import { API, Colors, Constants } from '../../../configs';
|
|
12
12
|
import Routes from '../../../utils/Route';
|
|
13
|
-
import { ToastBottomHelper } from '../../../utils/Utils';
|
|
14
13
|
import styles from './style';
|
|
15
14
|
|
|
16
15
|
const SmartAccountConnecting = ({ route }) => {
|
|
@@ -69,7 +68,6 @@ const SmartAccountConnecting = ({ route }) => {
|
|
|
69
68
|
navigate(Routes.SmartAccount, {
|
|
70
69
|
params: {},
|
|
71
70
|
});
|
|
72
|
-
ToastBottomHelper.error(data[Object.keys(data)[0]][0]);
|
|
73
71
|
}
|
|
74
72
|
handleRefreshPercent();
|
|
75
73
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -11,25 +11,10 @@ import { API } from '../../../../configs';
|
|
|
11
11
|
import Routes from '../../../../utils/Route';
|
|
12
12
|
import MockAdapter from 'axios-mock-adapter';
|
|
13
13
|
import AccessibilityLabel from '../../../../configs/AccessibilityLabel';
|
|
14
|
+
import { useNavigation } from '@react-navigation/native';
|
|
14
15
|
|
|
15
16
|
const mock = new MockAdapter(api.axiosInstance);
|
|
16
17
|
|
|
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
|
-
useIsFocused: () => true,
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
jest.mock('react', () => ({
|
|
29
|
-
...jest.requireActual('react'),
|
|
30
|
-
memo: (x) => x,
|
|
31
|
-
}));
|
|
32
|
-
|
|
33
18
|
const wrapComponent = (route) => (
|
|
34
19
|
<SCProvider initState={mockSCStore({})}>
|
|
35
20
|
<ListDevice route={route} />
|
|
@@ -38,8 +23,8 @@ const wrapComponent = (route) => (
|
|
|
38
23
|
|
|
39
24
|
describe('Test ListDeviceSmartAccount', () => {
|
|
40
25
|
let tree;
|
|
26
|
+
const { navigate } = useNavigation();
|
|
41
27
|
beforeEach(() => {
|
|
42
|
-
mockedNavigate.mockClear();
|
|
43
28
|
mock.reset();
|
|
44
29
|
});
|
|
45
30
|
it('render ListDeviceSmartAccount', async () => {
|
|
@@ -93,7 +78,7 @@ describe('Test ListDeviceSmartAccount', () => {
|
|
|
93
78
|
await touchs[touchs.length - 1].props.onPress();
|
|
94
79
|
});
|
|
95
80
|
|
|
96
|
-
expect(
|
|
81
|
+
expect(navigate).toBeCalledWith(Routes.AddDeviceStack, {
|
|
97
82
|
screen: Routes.AddCommonSelectSubUnit,
|
|
98
83
|
params: {
|
|
99
84
|
addType: 'AddHassiDevice',
|
package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js
CHANGED
|
@@ -13,18 +13,6 @@ import _TextInput from '../../../../commons/Form/TextInput';
|
|
|
13
13
|
import { flushPromises } from '../../../AllGateway/test-utils';
|
|
14
14
|
|
|
15
15
|
const mock = new MockAdapter(api.axiosInstance);
|
|
16
|
-
const mockedNavigate = jest.fn();
|
|
17
|
-
const mockedDispatch = jest.fn();
|
|
18
|
-
jest.mock('@react-navigation/native', () => {
|
|
19
|
-
return {
|
|
20
|
-
...jest.requireActual('@react-navigation/native'),
|
|
21
|
-
useNavigation: () => ({
|
|
22
|
-
navigate: mockedNavigate,
|
|
23
|
-
dispatch: mockedDispatch,
|
|
24
|
-
}),
|
|
25
|
-
useIsFocused: () => true,
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
16
|
|
|
29
17
|
const wrapComponent = (route) => (
|
|
30
18
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -57,7 +45,6 @@ describe('Test SuccessfullyConnected', () => {
|
|
|
57
45
|
};
|
|
58
46
|
beforeEach(() => {
|
|
59
47
|
mock.reset();
|
|
60
|
-
mockedNavigate.mockClear();
|
|
61
48
|
});
|
|
62
49
|
it('render SuccessfullyConnected', async () => {
|
|
63
50
|
mock.onGet(API.CHIP.RENAME_DEVICES(1)).reply(200, {
|
|
@@ -113,13 +100,16 @@ describe('Test SuccessfullyConnected', () => {
|
|
|
113
100
|
await act(async () => {
|
|
114
101
|
handleContinue.props.onPress();
|
|
115
102
|
});
|
|
116
|
-
expect(mockedNavigate).toBeCalledWith(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
103
|
+
expect(global.mockedNavigate).toBeCalledWith(
|
|
104
|
+
Routes.ListDeviceSmartAccount,
|
|
105
|
+
{
|
|
106
|
+
smart_account_id: 1,
|
|
107
|
+
username: 'textEoh@gmail.com',
|
|
108
|
+
brand: 'test brand',
|
|
109
|
+
unit_id: 1,
|
|
110
|
+
chipId: 1,
|
|
111
|
+
}
|
|
112
|
+
);
|
|
123
113
|
});
|
|
124
114
|
it('render function handleFinish ', async () => {
|
|
125
115
|
await act(async () => {
|
|
@@ -135,7 +125,7 @@ describe('Test SuccessfullyConnected', () => {
|
|
|
135
125
|
await act(async () => {
|
|
136
126
|
handleFinish.props.onPress();
|
|
137
127
|
});
|
|
138
|
-
expect(mockedDispatch).toBeCalledWith({
|
|
128
|
+
expect(global.mockedDispatch).toBeCalledWith({
|
|
139
129
|
payload: {
|
|
140
130
|
index: 0,
|
|
141
131
|
routes: [
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { memo, useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { View, ScrollView } from 'react-native';
|
|
2
|
+
import { View, ScrollView, ActivityIndicator } from 'react-native';
|
|
3
3
|
import { useNavigation, CommonActions } from '@react-navigation/native';
|
|
4
|
-
import
|
|
5
|
-
import { ActivityIndicator } from '@ant-design/react-native';
|
|
4
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
6
5
|
|
|
7
6
|
import _TextInput from '../../../commons/Form/TextInput';
|
|
8
7
|
import Text from '../../../commons/Text';
|
|
@@ -135,7 +134,7 @@ const SuccessfullyConnected = memo(({ route }) => {
|
|
|
135
134
|
<View style={styles.wrap}>
|
|
136
135
|
<ScrollView>
|
|
137
136
|
<View style={styles.body}>
|
|
138
|
-
<
|
|
137
|
+
<AntDesign name="check-circle" size={28} color={Colors.Green6} />
|
|
139
138
|
<Text bold style={styles.connectingText}>
|
|
140
139
|
{t('successfully_connected')}
|
|
141
140
|
</Text>
|
|
@@ -17,22 +17,10 @@ const wrapComponent = (route) => (
|
|
|
17
17
|
<SmartAccountConnecting route={route} />
|
|
18
18
|
</SCProvider>
|
|
19
19
|
);
|
|
20
|
-
const mockedNavigate = jest.fn();
|
|
21
|
-
|
|
22
|
-
jest.mock('@react-navigation/native', () => {
|
|
23
|
-
return {
|
|
24
|
-
...jest.requireActual('@react-navigation/native'),
|
|
25
|
-
useNavigation: () => ({
|
|
26
|
-
navigate: mockedNavigate,
|
|
27
|
-
}),
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
20
|
|
|
31
21
|
describe('Test Connecting', () => {
|
|
32
22
|
let tree;
|
|
33
|
-
|
|
34
|
-
mockedNavigate.mockClear();
|
|
35
|
-
});
|
|
23
|
+
|
|
36
24
|
it('render Connecting', async () => {
|
|
37
25
|
const route = {
|
|
38
26
|
params: {
|
|
@@ -65,7 +53,7 @@ describe('Test Connecting', () => {
|
|
|
65
53
|
await act(async () => {
|
|
66
54
|
tree = await renderer.create(wrapComponent(route));
|
|
67
55
|
});
|
|
68
|
-
expect(mockedNavigate).toBeCalledWith(Routes.SmartAccount, {
|
|
56
|
+
expect(global.mockedNavigate).toBeCalledWith(Routes.SmartAccount, {
|
|
69
57
|
params: {},
|
|
70
58
|
});
|
|
71
59
|
});
|
|
@@ -85,7 +73,7 @@ describe('Test Connecting', () => {
|
|
|
85
73
|
await act(async () => {
|
|
86
74
|
tree = await renderer.create(wrapComponent(route));
|
|
87
75
|
});
|
|
88
|
-
expect(mockedNavigate).not.toHaveBeenCalled();
|
|
76
|
+
expect(global.mockedNavigate).not.toHaveBeenCalled();
|
|
89
77
|
});
|
|
90
78
|
|
|
91
79
|
it('render connecting sync smartAccount success', async () => {
|
|
@@ -120,14 +108,17 @@ describe('Test Connecting', () => {
|
|
|
120
108
|
await jest.advanceTimersByTime(1000);
|
|
121
109
|
});
|
|
122
110
|
|
|
123
|
-
expect(mockedNavigate).toHaveBeenCalledWith(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
111
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(
|
|
112
|
+
Routes.ListDeviceSmartAccount,
|
|
113
|
+
{
|
|
114
|
+
username: 'abc',
|
|
115
|
+
brand: '',
|
|
116
|
+
device_data: undefined,
|
|
117
|
+
unit_id: 1,
|
|
118
|
+
smart_account_id_from_backend: undefined,
|
|
119
|
+
chipId: undefined,
|
|
120
|
+
}
|
|
121
|
+
);
|
|
131
122
|
|
|
132
123
|
// Clear the timers
|
|
133
124
|
jest.useRealTimers();
|
|
@@ -162,19 +153,22 @@ describe('Test Connecting', () => {
|
|
|
162
153
|
await jest.advanceTimersByTime(1000);
|
|
163
154
|
});
|
|
164
155
|
|
|
165
|
-
expect(mockedNavigate).toHaveBeenCalledWith(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
156
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(
|
|
157
|
+
Routes.SuccessfullyConnected,
|
|
158
|
+
{
|
|
159
|
+
nameSubUnit: undefined,
|
|
160
|
+
listDeviceIds: true,
|
|
161
|
+
listSelectDevice: undefined,
|
|
162
|
+
smart_account_id: undefined,
|
|
163
|
+
smart_account_id_from_backend: undefined,
|
|
164
|
+
unit_id: 1,
|
|
165
|
+
unitName: undefined,
|
|
166
|
+
stationId: undefined,
|
|
167
|
+
username: 'abc',
|
|
168
|
+
brand: '',
|
|
169
|
+
chipId: 1,
|
|
170
|
+
}
|
|
171
|
+
);
|
|
178
172
|
|
|
179
173
|
// Clear the timers
|
|
180
174
|
jest.useRealTimers();
|
|
@@ -15,22 +15,10 @@ const wrapComponent = (route) => (
|
|
|
15
15
|
<SmartAccount route={route} />
|
|
16
16
|
</SCProvider>
|
|
17
17
|
);
|
|
18
|
-
const mockedNavigate = jest.fn();
|
|
19
|
-
|
|
20
|
-
jest.mock('@react-navigation/native', () => {
|
|
21
|
-
return {
|
|
22
|
-
...jest.requireActual('@react-navigation/native'),
|
|
23
|
-
useNavigation: () => ({
|
|
24
|
-
navigate: mockedNavigate,
|
|
25
|
-
}),
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
18
|
|
|
29
19
|
describe('Test SmartAccount', () => {
|
|
30
20
|
let tree;
|
|
31
|
-
|
|
32
|
-
mockedNavigate.mockClear();
|
|
33
|
-
});
|
|
21
|
+
|
|
34
22
|
it('render SmartAccount', async () => {
|
|
35
23
|
const route = {
|
|
36
24
|
params: {
|
|
@@ -164,12 +152,15 @@ describe('Test SmartAccount', () => {
|
|
|
164
152
|
await act(async () => {
|
|
165
153
|
await touchableOpacity.props.onPress();
|
|
166
154
|
});
|
|
167
|
-
expect(mockedNavigate).toBeCalledWith(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
155
|
+
expect(global.mockedNavigate).toBeCalledWith(
|
|
156
|
+
Routes.SmartAccountConnecting,
|
|
157
|
+
{
|
|
158
|
+
brand: 'google_home',
|
|
159
|
+
password: '1234567',
|
|
160
|
+
unit_id: 1,
|
|
161
|
+
username: 'eoh.dienquang@gmail.com',
|
|
162
|
+
}
|
|
163
|
+
);
|
|
173
164
|
});
|
|
174
165
|
|
|
175
166
|
it('render handle sync item DienQuang from screen dashboard', async () => {
|
|
@@ -215,7 +206,7 @@ describe('Test SmartAccount', () => {
|
|
|
215
206
|
await act(async () => {
|
|
216
207
|
await touchableOpacity.props.onPress();
|
|
217
208
|
});
|
|
218
|
-
expect(mockedNavigate).toBeCalledWith(Routes.AddDeviceStack, {
|
|
209
|
+
expect(global.mockedNavigate).toBeCalledWith(Routes.AddDeviceStack, {
|
|
219
210
|
screen: 'AddCommonSelectUnit',
|
|
220
211
|
params: {
|
|
221
212
|
addType: 'AddHassioDevice',
|
|
@@ -245,7 +236,7 @@ describe('Test SmartAccount', () => {
|
|
|
245
236
|
await touchSupplierItem[1].props.onPress();
|
|
246
237
|
});
|
|
247
238
|
expect(touchSupplierItem).toBeDefined();
|
|
248
|
-
expect(mockedNavigate).toBeCalledWith(Routes.Browser, {
|
|
239
|
+
expect(global.mockedNavigate).toBeCalledWith(Routes.Browser, {
|
|
249
240
|
// eslint-disable-next-line max-len
|
|
250
241
|
link: 'https://qt-vn.m.lgaccount.com/emp/v2/authorize?client_id=2b85aee334f046848341547894bb7c4e&redirect_uri=app://eoh/sync-lg-device&response_type=code&state=1',
|
|
251
242
|
});
|