@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
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { View, TouchableOpacity, Image, FlatList } from 'react-native';
|
|
3
3
|
import { useNavigation } from '@react-navigation/native';
|
|
4
|
-
import
|
|
5
|
-
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
6
5
|
import { HeaderCustom } from '../../commons/Header';
|
|
7
6
|
import Text from '../../commons/Text';
|
|
8
7
|
import RequestFaceIDPopup from './components/RequestFaceIDPopup';
|
|
@@ -75,7 +74,7 @@ const HanetManageAccess = ({ route }) => {
|
|
|
75
74
|
{' '}
|
|
76
75
|
{item.name}
|
|
77
76
|
</Text>
|
|
78
|
-
<
|
|
77
|
+
<AntDesign name="right" size={20} color={Colors.Gray6} />
|
|
79
78
|
</TouchableOpacity>
|
|
80
79
|
);
|
|
81
80
|
},
|
|
@@ -90,7 +89,7 @@ const HanetManageAccess = ({ route }) => {
|
|
|
90
89
|
onPress={setShowAddMemberModal}
|
|
91
90
|
accessibilityLabel={AccessibilityLabel.HANET_MANAGE_ACCESS_ADD_BUTTON}
|
|
92
91
|
>
|
|
93
|
-
<
|
|
92
|
+
<AntDesign name={'plus'} size={27} color={Colors.Black} />
|
|
94
93
|
</TouchableOpacity>
|
|
95
94
|
</View>
|
|
96
95
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { View, TouchableOpacity, Image } from 'react-native';
|
|
3
3
|
import { useNavigation } from '@react-navigation/native';
|
|
4
|
-
import
|
|
4
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
5
5
|
|
|
6
6
|
import { HeaderCustom } from '../../commons/Header';
|
|
7
7
|
import { AlertAction, FullLoading } from '../../commons';
|
|
@@ -78,9 +78,9 @@ const HanetMemberInfo = ({ route }) => {
|
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
80
|
if (success) {
|
|
81
|
-
setMemberAvatar(data
|
|
81
|
+
setMemberAvatar(data?.avatar_uri);
|
|
82
82
|
} else {
|
|
83
|
-
setError(data
|
|
83
|
+
setError(data?.detail);
|
|
84
84
|
}
|
|
85
85
|
setLoading(false);
|
|
86
86
|
};
|
|
@@ -173,7 +173,7 @@ const HanetMemberInfo = ({ route }) => {
|
|
|
173
173
|
onPress={setShowSetFaceIDModal}
|
|
174
174
|
style={[styles.row, !!error && { borderBottomColor: Colors.Red6 }]}
|
|
175
175
|
>
|
|
176
|
-
<
|
|
176
|
+
<AntDesign name="camera" size={27} color={Colors.Primary} />
|
|
177
177
|
<Text
|
|
178
178
|
type="Body"
|
|
179
179
|
bold
|
|
@@ -17,25 +17,11 @@ const wrapComponent = (route) => (
|
|
|
17
17
|
</SCProvider>
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
-
const mockedNavigate = jest.fn();
|
|
21
|
-
const mockedGoBack = jest.fn();
|
|
22
|
-
jest.mock('@react-navigation/native', () => {
|
|
23
|
-
return {
|
|
24
|
-
...jest.requireActual('@react-navigation/native'),
|
|
25
|
-
useNavigation: () => ({
|
|
26
|
-
navigate: mockedNavigate,
|
|
27
|
-
goBack: mockedGoBack,
|
|
28
|
-
}),
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
|
|
32
20
|
const mockSetAvatar = jest.fn();
|
|
33
21
|
describe('Test HanetCaptureFaceID', () => {
|
|
34
22
|
let tree, route;
|
|
35
23
|
|
|
36
24
|
beforeEach(() => {
|
|
37
|
-
mockedNavigate.mockClear();
|
|
38
|
-
mockedGoBack.mockClear();
|
|
39
25
|
mockSetAvatar.mockClear();
|
|
40
26
|
route = {
|
|
41
27
|
params: {
|
|
@@ -100,7 +86,7 @@ describe('Test HanetCaptureFaceID', () => {
|
|
|
100
86
|
await touches[1].props.onPress();
|
|
101
87
|
});
|
|
102
88
|
expect(mockSetAvatar).toHaveBeenCalled();
|
|
103
|
-
expect(mockedGoBack).toHaveBeenCalled();
|
|
89
|
+
expect(global.mockedGoBack).toHaveBeenCalled();
|
|
104
90
|
});
|
|
105
91
|
|
|
106
92
|
it('Test set face id for new member', async () => {
|
|
@@ -117,6 +103,6 @@ describe('Test HanetCaptureFaceID', () => {
|
|
|
117
103
|
await act(async () => {
|
|
118
104
|
await touches[1].props.onPress();
|
|
119
105
|
});
|
|
120
|
-
expect(mockedNavigate).toHaveBeenCalled();
|
|
106
|
+
expect(global.mockedNavigate).toHaveBeenCalled();
|
|
121
107
|
});
|
|
122
108
|
});
|
|
@@ -22,17 +22,6 @@ const wrapComponent = (route) => (
|
|
|
22
22
|
|
|
23
23
|
const mock = new MockAdapter(api.axiosInstance);
|
|
24
24
|
|
|
25
|
-
const mockNavigate = jest.fn();
|
|
26
|
-
jest.mock('@react-navigation/native', () => {
|
|
27
|
-
return {
|
|
28
|
-
...jest.requireActual('@react-navigation/native'),
|
|
29
|
-
useRoute: jest.fn(),
|
|
30
|
-
useNavigation: () => ({
|
|
31
|
-
navigate: mockNavigate,
|
|
32
|
-
}),
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
|
|
36
25
|
describe('Test HanetCameraDetail', () => {
|
|
37
26
|
Date.now = jest.fn(() => new Date('2021-09-09T10:00:00.000Z'));
|
|
38
27
|
let tree, route, responseDisplay, responseCheckin;
|
|
@@ -114,7 +103,7 @@ describe('Test HanetCameraDetail', () => {
|
|
|
114
103
|
expect(textCountStranger.props.children).toBe(1);
|
|
115
104
|
const MenuActionMores = instance.findByType(MenuActionMore);
|
|
116
105
|
await MenuActionMores.props.onItemClick({ data: 'test' });
|
|
117
|
-
expect(
|
|
106
|
+
expect(global.mockedNavigate).toBeCalled();
|
|
118
107
|
});
|
|
119
108
|
|
|
120
109
|
it('Test change date', async () => {
|
|
@@ -21,22 +21,11 @@ const wrapComponent = (route) => (
|
|
|
21
21
|
</SCProvider>
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
-
const mockedNavigate = jest.fn();
|
|
25
|
-
jest.mock('@react-navigation/native', () => {
|
|
26
|
-
return {
|
|
27
|
-
...jest.requireActual('@react-navigation/native'),
|
|
28
|
-
useNavigation: () => ({
|
|
29
|
-
navigate: mockedNavigate,
|
|
30
|
-
}),
|
|
31
|
-
useIsFocused: () => true,
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
|
|
35
24
|
describe('Test HanetManageAccess', () => {
|
|
36
25
|
let tree, route, response;
|
|
37
26
|
|
|
38
27
|
beforeEach(() => {
|
|
39
|
-
mockedNavigate.mockClear();
|
|
28
|
+
global.mockedNavigate.mockClear();
|
|
40
29
|
route = {
|
|
41
30
|
params: {
|
|
42
31
|
hanetPlace: {
|
|
@@ -82,7 +71,7 @@ describe('Test HanetManageAccess', () => {
|
|
|
82
71
|
await act(async () => {
|
|
83
72
|
touches[0].props.onPress();
|
|
84
73
|
});
|
|
85
|
-
expect(mockedNavigate).toBeCalled();
|
|
74
|
+
expect(global.mockedNavigate).toBeCalled();
|
|
86
75
|
});
|
|
87
76
|
|
|
88
77
|
const chooseAddMemberOption = async (instance, index) => {
|
|
@@ -115,7 +104,7 @@ describe('Test HanetManageAccess', () => {
|
|
|
115
104
|
await chooseAddMemberOption(instance, 0);
|
|
116
105
|
|
|
117
106
|
expect(bottomSheet.props.isVisible).toBe(false);
|
|
118
|
-
expect(mockedNavigate).toBeCalledWith(Routes.HanetCaptureFaceID, {
|
|
107
|
+
expect(global.mockedNavigate).toBeCalledWith(Routes.HanetCaptureFaceID, {
|
|
119
108
|
title: 'Add new member',
|
|
120
109
|
hanetPlace: {
|
|
121
110
|
place_id: 1,
|
|
@@ -139,7 +128,7 @@ describe('Test HanetManageAccess', () => {
|
|
|
139
128
|
await chooseAddMemberOption(instance, 1);
|
|
140
129
|
|
|
141
130
|
expect(bottomSheet.props.isVisible).toBe(false);
|
|
142
|
-
expect(mockedNavigate).toBeCalledWith(Routes.HanetMemberInfo, {
|
|
131
|
+
expect(global.mockedNavigate).toBeCalledWith(Routes.HanetMemberInfo, {
|
|
143
132
|
hanetPlace: {
|
|
144
133
|
place_id: 1,
|
|
145
134
|
},
|
|
@@ -168,6 +157,6 @@ describe('Test HanetManageAccess', () => {
|
|
|
168
157
|
await chooseAddMemberOption(instance, 1);
|
|
169
158
|
|
|
170
159
|
expect(bottomSheet.props.isVisible).toBe(false);
|
|
171
|
-
expect(mockedNavigate).not.toBeCalled();
|
|
160
|
+
expect(global.mockedNavigate).not.toBeCalled();
|
|
172
161
|
});
|
|
173
162
|
});
|
|
@@ -13,6 +13,7 @@ import BottomSheet from '../../../commons/BottomSheet';
|
|
|
13
13
|
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
14
14
|
import api from '../../../utils/Apis/axios';
|
|
15
15
|
import { API } from '../../../configs';
|
|
16
|
+
import { useNavigation } from '@react-navigation/native';
|
|
16
17
|
|
|
17
18
|
const wrapComponent = (route) => (
|
|
18
19
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -20,27 +21,13 @@ const wrapComponent = (route) => (
|
|
|
20
21
|
</SCProvider>
|
|
21
22
|
);
|
|
22
23
|
|
|
23
|
-
const mockedNavigate = jest.fn();
|
|
24
|
-
const mockedGoBack = jest.fn();
|
|
25
|
-
jest.mock('@react-navigation/native', () => {
|
|
26
|
-
return {
|
|
27
|
-
...jest.requireActual('@react-navigation/native'),
|
|
28
|
-
useNavigation: () => ({
|
|
29
|
-
navigate: mockedNavigate,
|
|
30
|
-
goBack: mockedGoBack,
|
|
31
|
-
}),
|
|
32
|
-
useIsFocused: () => true,
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
|
|
36
24
|
const mock = new MockAdapter(api.axiosInstance);
|
|
37
25
|
|
|
38
26
|
describe('Test HanetMemberInfo', () => {
|
|
39
27
|
let tree, route;
|
|
28
|
+
const { goBack, navigate } = useNavigation();
|
|
40
29
|
|
|
41
30
|
beforeEach(() => {
|
|
42
|
-
mockedNavigate.mockClear();
|
|
43
|
-
mockedGoBack.mockClear();
|
|
44
31
|
route = {
|
|
45
32
|
params: {
|
|
46
33
|
hanetPlace: {
|
|
@@ -96,7 +83,7 @@ describe('Test HanetMemberInfo', () => {
|
|
|
96
83
|
await act(async () => {
|
|
97
84
|
await alertAction.props.rightButtonClick();
|
|
98
85
|
});
|
|
99
|
-
expect(
|
|
86
|
+
expect(goBack).toHaveBeenCalled();
|
|
100
87
|
});
|
|
101
88
|
|
|
102
89
|
const chooseSetFaceIDOption = async (instance, index) => {
|
|
@@ -126,7 +113,7 @@ describe('Test HanetMemberInfo', () => {
|
|
|
126
113
|
await chooseSetFaceIDOption(instance, 0);
|
|
127
114
|
|
|
128
115
|
expect(bottomSheet.props.isVisible).toBe(false);
|
|
129
|
-
expect(
|
|
116
|
+
expect(navigate).toBeCalled(); // navigate to HanetCaptureFaceID
|
|
130
117
|
});
|
|
131
118
|
|
|
132
119
|
it('Test set photo id choose file', async () => {
|
|
@@ -189,6 +176,6 @@ describe('Test HanetMemberInfo', () => {
|
|
|
189
176
|
await act(async () => {
|
|
190
177
|
await bottomButton.props.onPressMain();
|
|
191
178
|
});
|
|
192
|
-
expect(
|
|
179
|
+
expect(navigate).toBeCalled();
|
|
193
180
|
});
|
|
194
181
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
3
|
import ImagePicker from 'react-native-image-crop-picker';
|
|
4
|
-
import
|
|
4
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
5
5
|
import Text from '../../../commons/Text';
|
|
6
6
|
import BottomSheet from '../../../commons/BottomSheet';
|
|
7
7
|
import { Colors } from '../../../configs';
|
|
@@ -19,7 +19,7 @@ const RequestFaceIDPopup = ({
|
|
|
19
19
|
const t = useTranslations();
|
|
20
20
|
const options = [
|
|
21
21
|
{
|
|
22
|
-
icon: <
|
|
22
|
+
icon: <AntDesign name="camera" color={Colors.Gray9} size={27} />,
|
|
23
23
|
text: t('capture_image'),
|
|
24
24
|
onChoose: () => {
|
|
25
25
|
setHide();
|
|
@@ -14,21 +14,6 @@ import { API } from '../../../configs';
|
|
|
14
14
|
|
|
15
15
|
const mock = new MockAdapter(api.axiosInstance);
|
|
16
16
|
|
|
17
|
-
const mockUseIsFocused = jest.fn();
|
|
18
|
-
const mockedNavigate = jest.fn();
|
|
19
|
-
|
|
20
|
-
jest.mock('@react-navigation/native', () => {
|
|
21
|
-
return {
|
|
22
|
-
...jest.requireActual('@react-navigation/native'),
|
|
23
|
-
useRoute: jest.fn(),
|
|
24
|
-
useNavigation: () => ({
|
|
25
|
-
goBack: jest.fn(),
|
|
26
|
-
navigate: mockedNavigate,
|
|
27
|
-
}),
|
|
28
|
-
useIsFocused: () => mockUseIsFocused,
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
|
|
32
17
|
const wrapComponent = (route) => (
|
|
33
18
|
<SCProvider initState={mockSCStore({})}>
|
|
34
19
|
<ManageAccessScreen route={route} />
|
|
@@ -40,7 +25,6 @@ describe('Test Manage Access', () => {
|
|
|
40
25
|
let route;
|
|
41
26
|
|
|
42
27
|
beforeEach(() => {
|
|
43
|
-
mockedNavigate.mockClear();
|
|
44
28
|
route = {
|
|
45
29
|
params: {
|
|
46
30
|
unit: {
|
|
@@ -56,7 +40,7 @@ describe('Test Manage Access', () => {
|
|
|
56
40
|
});
|
|
57
41
|
|
|
58
42
|
it('render Manage Access', async () => {
|
|
59
|
-
|
|
43
|
+
global.mockedUseIsFocused.mockImplementation(() => true);
|
|
60
44
|
mock.onGet(API.UNIT.MANAGE_ACCESS(1)).reply(200, [
|
|
61
45
|
{
|
|
62
46
|
id: 1,
|
|
@@ -86,13 +70,13 @@ describe('Test Manage Access', () => {
|
|
|
86
70
|
await act(async () => {
|
|
87
71
|
await memberButton[0].props.onPress();
|
|
88
72
|
});
|
|
89
|
-
expect(mockedNavigate).toHaveBeenCalledWith(Routes.GuestInfo, {
|
|
73
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.GuestInfo, {
|
|
90
74
|
id: 1,
|
|
91
75
|
});
|
|
92
76
|
});
|
|
93
77
|
|
|
94
78
|
it('render Manage Access without params', async () => {
|
|
95
|
-
|
|
79
|
+
global.mockedUseIsFocused.mockImplementation(() => false);
|
|
96
80
|
await act(async () => {
|
|
97
81
|
tree = await create(wrapComponent({}));
|
|
98
82
|
});
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { useNavigation, useIsFocused } from '@react-navigation/native';
|
|
10
10
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
11
11
|
import { HeaderCustom } from '../../commons/Header';
|
|
12
|
-
import
|
|
12
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
13
13
|
import styles from './styles/ManageAccessStyles';
|
|
14
14
|
import { Colors } from '../../configs';
|
|
15
15
|
import Text from '../../commons/Text';
|
|
@@ -75,7 +75,7 @@ const ManageAccessScreen = memo(({ route }) => {
|
|
|
75
75
|
// accessibilityLabel={AccessibilityLabel.SIDE_MENU_AVATAR_USER}
|
|
76
76
|
/>
|
|
77
77
|
) : (
|
|
78
|
-
<
|
|
78
|
+
<AntDesign
|
|
79
79
|
name="user"
|
|
80
80
|
size={20}
|
|
81
81
|
color={Colors.White}
|
|
@@ -90,7 +90,7 @@ const ManageAccessScreen = memo(({ route }) => {
|
|
|
90
90
|
subtext={item.schedule}
|
|
91
91
|
onPress={() => goToGuestInfo(item.id)}
|
|
92
92
|
rightComponent={
|
|
93
|
-
<
|
|
93
|
+
<AntDesign
|
|
94
94
|
name="right"
|
|
95
95
|
size={20}
|
|
96
96
|
color={Colors.Gray6}
|
|
@@ -79,10 +79,10 @@ describe('Test Render ListSubUnit', () => {
|
|
|
79
79
|
},
|
|
80
80
|
},
|
|
81
81
|
};
|
|
82
|
-
const
|
|
82
|
+
const mockedNavigate = useNavigation().navigate;
|
|
83
83
|
|
|
84
84
|
beforeEach(() => {
|
|
85
|
-
|
|
85
|
+
mockedNavigate.mockReset();
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
it('render ListSubUnit with out params', async () => {
|
|
@@ -128,18 +128,18 @@ describe('Test Render ListSubUnit', () => {
|
|
|
128
128
|
await bottomButtonView.props.onPressMain();
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
-
expect(
|
|
132
|
-
const
|
|
131
|
+
expect(global.mockedNavigate).toBeCalled();
|
|
132
|
+
const touchableOpacities = instance.findAllByType(TouchableOpacity);
|
|
133
133
|
await act(async () => {
|
|
134
|
-
await
|
|
134
|
+
await touchableOpacities[2].props.onPress();
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
mockedNavigate.mockClear();
|
|
138
138
|
mock.onPatch(API.DEVICE.CHANGE_SUB_UNIT(200, 3, 73)).reply(400);
|
|
139
139
|
|
|
140
140
|
await act(async () => {
|
|
141
141
|
await bottomButtonView.props.onPressMain();
|
|
142
142
|
});
|
|
143
|
-
expect(
|
|
143
|
+
expect(global.mockedNavigate).not.toBeCalled();
|
|
144
144
|
});
|
|
145
145
|
});
|
|
@@ -73,9 +73,7 @@ describe('test Notification', () => {
|
|
|
73
73
|
},
|
|
74
74
|
],
|
|
75
75
|
};
|
|
76
|
-
mock
|
|
77
|
-
.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''))
|
|
78
|
-
.reply(200, response);
|
|
76
|
+
mock.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1)).reply(200, response);
|
|
79
77
|
await act(async () => {
|
|
80
78
|
tree = await create(wrapComponent());
|
|
81
79
|
});
|
|
@@ -101,9 +99,7 @@ describe('test Notification', () => {
|
|
|
101
99
|
type: 'NEWS',
|
|
102
100
|
});
|
|
103
101
|
}
|
|
104
|
-
mock
|
|
105
|
-
.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''))
|
|
106
|
-
.reply(200, response);
|
|
102
|
+
mock.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1)).reply(200, response);
|
|
107
103
|
await act(async () => {
|
|
108
104
|
tree = await create(wrapComponent());
|
|
109
105
|
});
|
|
@@ -112,9 +108,7 @@ describe('test Notification', () => {
|
|
|
112
108
|
expect(wrapHeaderScrollable.props.disableLoadMore).toEqual(false);
|
|
113
109
|
|
|
114
110
|
const scrollView = instance.findByType(Animated.ScrollView);
|
|
115
|
-
mock
|
|
116
|
-
.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(2, ''))
|
|
117
|
-
.reply(200, response);
|
|
111
|
+
mock.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(2)).reply(200, response);
|
|
118
112
|
await act(async () => {
|
|
119
113
|
scrollView.props.onMomentumScrollEnd();
|
|
120
114
|
});
|
|
@@ -144,9 +138,7 @@ describe('test Notification', () => {
|
|
|
144
138
|
},
|
|
145
139
|
],
|
|
146
140
|
};
|
|
147
|
-
mock
|
|
148
|
-
.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''))
|
|
149
|
-
.reply(200, response);
|
|
141
|
+
mock.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1)).reply(200, response);
|
|
150
142
|
await act(async () => {
|
|
151
143
|
tree = await create(wrapComponent());
|
|
152
144
|
});
|
|
@@ -179,9 +171,7 @@ describe('test Notification', () => {
|
|
|
179
171
|
},
|
|
180
172
|
],
|
|
181
173
|
};
|
|
182
|
-
mock
|
|
183
|
-
.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''))
|
|
184
|
-
.reply(200, response);
|
|
174
|
+
mock.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1)).reply(200, response);
|
|
185
175
|
await act(async () => {
|
|
186
176
|
tree = await create(wrapComponent());
|
|
187
177
|
});
|
|
@@ -20,20 +20,10 @@ const wrapComponent = (item, stateData = {}) => (
|
|
|
20
20
|
|
|
21
21
|
const mock = new MockAdapter(api.axiosInstance);
|
|
22
22
|
|
|
23
|
-
const mockNavigate = jest.fn();
|
|
24
|
-
jest.mock('@react-navigation/native', () => {
|
|
25
|
-
return {
|
|
26
|
-
...jest.requireActual('@react-navigation/native'),
|
|
27
|
-
useNavigation: () => ({
|
|
28
|
-
navigate: mockNavigate,
|
|
29
|
-
}),
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
|
|
33
23
|
describe('test NotificationItem', () => {
|
|
34
24
|
let item = {};
|
|
35
25
|
beforeEach(() => {
|
|
36
|
-
|
|
26
|
+
global.mockedNavigate.mockClear();
|
|
37
27
|
item = {
|
|
38
28
|
id: 1,
|
|
39
29
|
content_code: '',
|
|
@@ -71,7 +61,7 @@ describe('test NotificationItem', () => {
|
|
|
71
61
|
await act(async () => {
|
|
72
62
|
button.props.onPress();
|
|
73
63
|
});
|
|
74
|
-
expect(
|
|
64
|
+
expect(global.mockedNavigate).not.toHaveBeenCalled();
|
|
75
65
|
});
|
|
76
66
|
}
|
|
77
67
|
|
|
@@ -97,7 +87,7 @@ describe('test NotificationItem', () => {
|
|
|
97
87
|
await act(async () => {
|
|
98
88
|
button.props.onPress();
|
|
99
89
|
});
|
|
100
|
-
expect(
|
|
90
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
|
|
101
91
|
screen: Routes.UnitDetail,
|
|
102
92
|
params: {
|
|
103
93
|
unitId: 1,
|
|
@@ -123,7 +113,7 @@ describe('test NotificationItem', () => {
|
|
|
123
113
|
await act(async () => {
|
|
124
114
|
button.props.onPress();
|
|
125
115
|
});
|
|
126
|
-
expect(
|
|
116
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
|
|
127
117
|
screen: Routes.DeviceDetail,
|
|
128
118
|
params: {
|
|
129
119
|
unitId: 1,
|
|
@@ -155,7 +145,7 @@ describe('test NotificationItem', () => {
|
|
|
155
145
|
await act(async () => {
|
|
156
146
|
button.props.onPress();
|
|
157
147
|
});
|
|
158
|
-
expect(
|
|
148
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
|
|
159
149
|
screen: Routes.UnitSummary,
|
|
160
150
|
params: {
|
|
161
151
|
summaryId: 11,
|
|
@@ -188,7 +178,7 @@ describe('test NotificationItem', () => {
|
|
|
188
178
|
await act(async () => {
|
|
189
179
|
button.props.onPress();
|
|
190
180
|
});
|
|
191
|
-
expect(
|
|
181
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
|
|
192
182
|
screen: Routes.DeviceDetail,
|
|
193
183
|
params: {
|
|
194
184
|
unitId: 70,
|
|
@@ -214,7 +204,7 @@ describe('test NotificationItem', () => {
|
|
|
214
204
|
await act(async () => {
|
|
215
205
|
button.props.onPress();
|
|
216
206
|
});
|
|
217
|
-
expect(
|
|
207
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
|
|
218
208
|
screen: Routes.UnitSummary,
|
|
219
209
|
params: {
|
|
220
210
|
summaryId: 11,
|
|
@@ -250,7 +240,7 @@ describe('test NotificationItem', () => {
|
|
|
250
240
|
await act(async () => {
|
|
251
241
|
button.props.onPress();
|
|
252
242
|
});
|
|
253
|
-
expect(
|
|
243
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
|
|
254
244
|
screen: Routes.DeviceDetail,
|
|
255
245
|
params: {
|
|
256
246
|
unitId: 1,
|
|
@@ -275,7 +265,7 @@ describe('test NotificationItem', () => {
|
|
|
275
265
|
await act(async () => {
|
|
276
266
|
button.props.onPress();
|
|
277
267
|
});
|
|
278
|
-
expect(
|
|
268
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
|
|
279
269
|
screen: Routes.DeviceDetail,
|
|
280
270
|
params: {
|
|
281
271
|
unitId: 1,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo, useMemo, useState, useCallback, useEffect } from 'react';
|
|
2
2
|
import { View, TouchableOpacity } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
import { useFocusEffect } from '@react-navigation/native';
|
|
5
5
|
|
|
6
6
|
import styles from './styles/indexStyles';
|
|
@@ -33,7 +33,7 @@ const Notification = memo(() => {
|
|
|
33
33
|
notImplemented(t);
|
|
34
34
|
}}
|
|
35
35
|
>
|
|
36
|
-
<
|
|
36
|
+
<AntDesign name={'plus'} size={27} color={Colors.Black} />
|
|
37
37
|
</TouchableOpacity>
|
|
38
38
|
|
|
39
39
|
<TouchableOpacity
|
|
@@ -41,7 +41,7 @@ const Notification = memo(() => {
|
|
|
41
41
|
notImplemented(t);
|
|
42
42
|
}}
|
|
43
43
|
>
|
|
44
|
-
<
|
|
44
|
+
<AntDesign name={'search1'} size={27} color={Colors.Black} />
|
|
45
45
|
</TouchableOpacity>
|
|
46
46
|
</View>
|
|
47
47
|
),
|
|
@@ -51,7 +51,7 @@ const Notification = memo(() => {
|
|
|
51
51
|
|
|
52
52
|
const fetchNotifications = useCallback(async (pageParam) => {
|
|
53
53
|
const { success, data } = await axiosGet(
|
|
54
|
-
API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(pageParam
|
|
54
|
+
API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(pageParam)
|
|
55
55
|
);
|
|
56
56
|
if (success) {
|
|
57
57
|
setNotifications((preState) => preState.concat(data.results));
|
|
@@ -69,7 +69,7 @@ const Notification = memo(() => {
|
|
|
69
69
|
const onRefresh = useCallback(async () => {
|
|
70
70
|
setPage(1);
|
|
71
71
|
const { success, data } = await axiosGet(
|
|
72
|
-
API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1
|
|
72
|
+
API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1)
|
|
73
73
|
);
|
|
74
74
|
if (success) {
|
|
75
75
|
setNotifications(data.results);
|
|
@@ -12,28 +12,6 @@ import { mockSCStore } from '../../../context/mockStore';
|
|
|
12
12
|
import MediaPlayerFull from '../../../commons/MediaPlayerDetail/MediaPlayerFull';
|
|
13
13
|
import Timer from '../Timer';
|
|
14
14
|
|
|
15
|
-
jest.mock('@react-navigation/native', () => {
|
|
16
|
-
return {
|
|
17
|
-
...jest.requireActual('@react-navigation/native'),
|
|
18
|
-
useNavigation: () => ({
|
|
19
|
-
goBack: jest.fn(),
|
|
20
|
-
}),
|
|
21
|
-
useRoute: jest.fn().mockReturnValue({
|
|
22
|
-
params: {
|
|
23
|
-
item: {
|
|
24
|
-
configuration: {
|
|
25
|
-
time_zone: 0,
|
|
26
|
-
playback: '',
|
|
27
|
-
name: 'name',
|
|
28
|
-
uri: '',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
thumbnail: {},
|
|
32
|
-
},
|
|
33
|
-
}),
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
|
|
37
15
|
const wrapComponent = () => (
|
|
38
16
|
<SCProvider initState={mockSCStore({})}>
|
|
39
17
|
<PlayBackCamera />
|
|
@@ -43,6 +21,19 @@ const wrapComponent = () => (
|
|
|
43
21
|
describe('Test PlayBackCamera', () => {
|
|
44
22
|
let tree;
|
|
45
23
|
jest.useFakeTimers();
|
|
24
|
+
global.mockedUseRoute.mockReturnValue({
|
|
25
|
+
params: {
|
|
26
|
+
item: {
|
|
27
|
+
configuration: {
|
|
28
|
+
time_zone: 0,
|
|
29
|
+
playback: '',
|
|
30
|
+
name: 'name',
|
|
31
|
+
uri: '',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
thumbnail: {},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
46
37
|
|
|
47
38
|
it('Test render', async () => {
|
|
48
39
|
await act(async () => {
|
|
@@ -84,9 +84,9 @@ const PlayBackCamera = () => {
|
|
|
84
84
|
}, [selected, updateCameraPlayback]);
|
|
85
85
|
|
|
86
86
|
const getHourWithTimeZone = useCallback(
|
|
87
|
-
(
|
|
87
|
+
(_hour) => {
|
|
88
88
|
const hourWithTimezone =
|
|
89
|
-
parseInt(
|
|
89
|
+
parseInt(_hour, 10) + parseInt(time_zone || 0, 10);
|
|
90
90
|
if (hourWithTimezone < 0 || hourWithTimezone > 9) {
|
|
91
91
|
return hourWithTimezone;
|
|
92
92
|
}
|
|
@@ -6,20 +6,9 @@ import { SCProvider } from '../../../../../context';
|
|
|
6
6
|
import { mockSCStore } from '../../../../../context/mockStore';
|
|
7
7
|
import QRScan from '../index';
|
|
8
8
|
|
|
9
|
-
const mockedPop = jest.fn();
|
|
10
9
|
const mockedOnScan = jest.fn();
|
|
11
10
|
const mockedSetLoading = jest.fn();
|
|
12
11
|
|
|
13
|
-
jest.mock('@react-navigation/native', () => {
|
|
14
|
-
return {
|
|
15
|
-
...jest.requireActual('@react-navigation/native'),
|
|
16
|
-
useNavigation: () => ({
|
|
17
|
-
pop: mockedPop,
|
|
18
|
-
}),
|
|
19
|
-
useIsFocused: jest.fn(),
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
|
|
23
12
|
const wrapComponent = (data) => (
|
|
24
13
|
<SCProvider initState={mockSCStore({})}>
|
|
25
14
|
<QRScan {...data} />
|