@eohjsc/react-native-smart-city 0.3.36 → 0.3.38
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/package.json +1 -1
- package/src/commons/Action/__test__/ItemQuickAction.test.js +36 -32
- package/src/commons/ActionGroup/ColorPickerTemplate.js +61 -23
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/ItemPasscode.test.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +2 -2
- package/src/commons/ActionGroup/SliderRangeTemplate.js +35 -20
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/CircleButton.test.js +12 -12
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/ControlPlay.test.js +10 -10
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/RectangleButton.test.js +7 -7
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/SmartTiviActionTemplate.test.js +23 -23
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +1 -3
- package/src/commons/ActionGroup/__test__/ColorPickerTemplate.test.js +1 -1
- package/src/commons/ActionGroup/__test__/CurtainButtonTemplate.test.js +4 -4
- package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +14 -14
- package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +12 -12
- package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +2 -2
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +10 -10
- package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +2 -2
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +7 -7
- package/src/commons/ActionGroup/__test__/SliderRangeTemplate.test.js +1 -1
- package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +2 -2
- package/src/commons/ActionGroup/__test__/ThreeButtonTemplate.test.js +2 -2
- package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +3 -3
- package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +2 -2
- package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +14 -14
- package/src/commons/ActionGroup/__test__/index.test.js +41 -41
- package/src/commons/ActionTemplate/OnOffButtonAction.js +6 -4
- package/src/commons/ActionTemplate/OnOffSimpleAction.js +9 -3
- package/src/commons/ActionTemplate/OnOffSmartLockAction.js +12 -10
- package/src/commons/ActionTemplate/__test__/OnOffButtonAction.test.js +3 -3
- package/src/commons/ActionTemplate/__test__/OnOffSimpleAction.test.js +3 -3
- package/src/commons/ActionTemplate/__test__/OneButtonAction.test.js +3 -3
- package/src/commons/ActionTemplate/__test__/ThreeButtonAction.test.js +3 -3
- package/src/commons/ActionTemplate/__test__/index.test.js +6 -6
- package/src/commons/ActionTemplate/index.js +15 -3
- package/src/commons/Alert/__test__/Alert.test.js +2 -2
- package/src/commons/AlertAction/__test__/AlertAction.test.js +2 -2
- package/src/commons/Auth/__test__/AccountItem.test.js +4 -4
- package/src/commons/Auth/__test__/AccountList.test.js +4 -4
- package/src/commons/Auth/__test__/OtpInputList.test.js +20 -16
- package/src/commons/Auth/__test__/SocialButton.test.js +6 -6
- package/src/commons/Automate/__test__/ItemAutomate.test.js +2 -2
- package/src/commons/Automate/__test__/ItemScriptAction.test.js +2 -2
- package/src/commons/BackDefault/__test__/BackDefault.test.js +2 -2
- package/src/commons/Button/__test__/Button.test.js +3 -3
- package/src/commons/ButtonPopup/__test__/ButtonPopup.test.js +2 -2
- package/src/commons/Calendar/__test__/Calendar.test.js +2 -2
- package/src/commons/ChartLoading/__test__/ChartLoading.test.js +2 -2
- package/src/commons/CircleButton/__test__/CircleButton.test.js +2 -2
- package/src/commons/CircleView/__test__/CircleView.test.js +2 -2
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +3 -3
- package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +2 -2
- package/src/commons/DateTimeRangeChange/__test__/DateTimeButton.test.js +4 -4
- package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +5 -5
- package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +2 -2
- package/src/commons/Device/Hanet/ItemHanetDevice.test.js +5 -5
- package/src/commons/Device/LinearChart/LinearChart.test.js +2 -2
- package/src/commons/Device/RainningSensor/__test__/CurrentRainSensor.test.js +6 -6
- package/src/commons/Device/SonosSpeaker/__test__/SonosSpeaker.test.js +8 -8
- package/src/commons/Device/WindDirection/Compass/Compass.test.js +4 -4
- package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +2 -2
- package/src/commons/Device/WindSpeed/LinearChart/__test__/ValueBalloon.test.js +2 -2
- package/src/commons/Device/WindSpeed/__test__/Anemometer.test.js +4 -4
- package/src/commons/Device/WindSpeed/__test__/ChartInfo.test.js +5 -5
- package/src/commons/Device/__test__/ConnectedViewHeader.test.js +6 -6
- package/src/commons/Device/__test__/DeviceAlertStatus.test.js +6 -6
- package/src/commons/Device/__test__/DisconnectedView.test.js +12 -12
- package/src/commons/Device/__test__/FlatListItems.test.js +2 -2
- package/src/commons/Device/__test__/FooterInfo.test.js +2 -2
- package/src/commons/Device/__test__/SensorConnectedStatus.test.js +2 -2
- package/src/commons/DisplayChecking/__test__/DisplayChecking.test.js +2 -2
- package/src/commons/Explore/SearchBox/__test__/SearchBox.test.js +6 -6
- package/src/commons/Explore/__test__/CityItem.test.js +6 -6
- package/src/commons/Explore/__test__/HeaderExplore.test.js +2 -2
- package/src/commons/Explore/__test__/HeaderLabel.test.js +3 -3
- package/src/commons/Explore/__test__/LocationItem.test.js +3 -3
- package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +4 -4
- package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +2 -2
- package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +1 -1
- package/src/commons/Form/__test__/CurrencyInput.test.js +12 -12
- package/src/commons/Form/__test__/TextInput.test.js +4 -4
- package/src/commons/Form/__test__/TextInputPassword.test.js +5 -5
- package/src/commons/FourButtonFilterHistory/__test__/FourButtonFilterHistory.test.js +1 -1
- package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +12 -10
- package/src/commons/Header/__test__/HeaderCT.test.js +11 -11
- package/src/commons/ImageButton/__test__/ImageButton.test.js +2 -2
- package/src/commons/ImagePicker/__test__/ImagePicker.test.js +8 -8
- package/src/commons/MediaPlayerDetail/__test__/MediaPlayerDetail.test.js +1 -1
- package/src/commons/MediaPlayerDetail/__test__/MediaPlayerFull.test.js +8 -8
- package/src/commons/MenuActionAddnew/__test__/MenuActionAddNew.test.js +3 -3
- package/src/commons/MenuActionList/__test__/MenuActionList.test.js +3 -3
- package/src/commons/MenuActionMore/__test__/MenuActionMore.test.js +2 -2
- package/src/commons/Modal/__test__/ModalBottom.test.js +4 -4
- package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +39 -13
- package/src/commons/OneTapTemplate/OptionsDropdownActionTemplate.js +33 -14
- package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +9 -4
- package/src/commons/OneTapTemplate/__test__/NumberUpDownActionTemplate.test.js +25 -12
- package/src/commons/OneTapTemplate/__test__/OptionsDropdownActionTemplate.test.js +13 -13
- package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +7 -7
- package/src/commons/PreventAccess/__test__/PreventAccess.test.js +7 -5
- package/src/commons/Processing/__test__/Connecting.test.js +61 -25
- package/src/commons/Processing/index.js +21 -7
- package/src/commons/RowItem/__test__/RowItem.test.js +2 -2
- package/src/commons/RowUser/__test__/RowUser.test.js +2 -2
- package/src/commons/SearchLocation/__test__/RowLocation.test.js +4 -4
- package/src/commons/Section/Section.test.js +4 -4
- package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +3 -3
- package/src/commons/SelectSubUnit/index.js +1 -1
- package/src/commons/SelectUnit/__test__/SelectUnit.test.js +3 -3
- package/src/commons/SelectUnit/index.js +3 -4
- package/src/commons/Sharing/__test__/BtnRemoveMember.test.js +3 -3
- package/src/commons/Sharing/__test__/ButtonRemoveMember.test.js +2 -2
- package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +3 -3
- package/src/commons/Sharing/__test__/MemberList.test.js +8 -8
- package/src/commons/Sharing/__test__/RowMember.test.js +4 -4
- package/src/commons/Sharing/__test__/StationDevicePermission.test.js +7 -7
- package/src/commons/Sharing/__test__/WrapHeaderScrollable.test.js +6 -6
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +6 -6
- package/src/commons/SubUnit/__test__/Favorites.test.js +3 -3
- package/src/commons/SubUnit/__test__/Item.test.js +4 -4
- package/src/commons/SubUnit/__test__/ShortDetail.test.js +16 -16
- package/src/commons/SummaryItem/__test__/SummaryItem.test.js +7 -7
- package/src/commons/Tabbar/__test__/index.test.js +1 -1
- package/src/commons/TextButton/__test__/TextButton.test.js +6 -6
- package/src/commons/Today/__test__/Today.test.js +2 -2
- package/src/commons/TouchableScale/__test__/TouchableScale.test.js +5 -5
- package/src/commons/Unit/__test__/HeaderUnit.test.js +3 -3
- package/src/commons/Unit/__test__/SharedUnit.test.js +13 -13
- package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +25 -25
- package/src/commons/UnitSummary/ConfigHistoryChart/__test__/ConfigHistoryChart.test.js +258 -25
- package/src/commons/UnitSummary/ConfigHistoryChart/index.js +96 -4
- package/src/commons/UnitSummary/__test__/TotalPowerBox.test.js +2 -2
- package/src/commons/UnitSummary/__test__/TotalPowerConsumption.test.js +2 -2
- package/src/commons/ViewButtonBottom/__test__/ViewButtonBottom.test.js +3 -3
- package/src/commons/WheelDateTimePicker/__test__/index.test.js +2 -2
- package/src/commons/WrapParallaxScrollView/index.js +2 -1
- package/src/configs/API.js +6 -2
- package/src/configs/AccessibilityLabel.js +13 -1
- package/src/configs/Constants.js +9 -12
- package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +2 -2
- package/src/hooks/Common/__test__/useStatusbar.test.js +4 -4
- package/src/hooks/Common/__test__/useTranslations.test.js +1 -1
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +7 -7
- package/src/hooks/IoT/useRemoteControl.js +0 -1
- package/src/iot/RemoteControl/__test__/Bluetooth.test.js +17 -17
- package/src/iot/RemoteControl/__test__/Internet.test.js +4 -4
- package/src/screens/AQIGuide/__test__/AQIGuide.test.js +3 -3
- package/src/screens/ActivityLog/__test__/FilterPopup.test.js +2 -2
- package/src/screens/ActivityLog/__test__/ItemLog.test.js +21 -21
- package/src/screens/ActivityLog/hooks/__test__/index.test.js +1 -1
- package/src/screens/AddCommon/SelectSubUnit.js +3 -0
- package/src/screens/AddCommon/SelectUnit.js +1 -1
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +4 -4
- package/src/screens/AddCommon/__test__/SelectUnit.test.js +11 -6
- package/src/screens/AddLocationMaps/__test__/index.test.js +6 -6
- package/src/screens/AddNewAction/Device/__test__/index.test.js +3 -3
- package/src/screens/AddNewAction/SelectAction.js +6 -1
- package/src/screens/AddNewAction/__test__/SelectAction.test.js +128 -20
- package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +10 -10
- package/src/screens/AddNewAction/__test__/SetupSensor.test.js +8 -8
- package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +2 -2
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +8 -8
- package/src/screens/AddNewDevice/__test__/ConnectingDevices.test.js +8 -8
- package/src/screens/AddNewGateway/ConnectingDevice.js +29 -7
- package/src/screens/AddNewGateway/ConnectingWifiDevice.js +4 -2
- package/src/screens/AddNewGateway/ConnectingWifiGuide.js +7 -6
- package/src/screens/AddNewGateway/ConnectingZigbeeDevice.js +3 -2
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +5 -5
- package/src/screens/AddNewGateway/ScanWifiDeviceQR.js +1 -4
- package/src/screens/AddNewGateway/ShareWifiPassword.js +4 -2
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +6 -6
- package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +2 -1
- package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +23 -18
- package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +30 -2
- package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +4 -4
- package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +4 -4
- package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +4 -4
- package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +5 -5
- package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +2 -2
- package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +6 -6
- package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +2 -2
- package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +2 -2
- package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +6 -6
- package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +4 -4
- package/src/screens/AllCamera/__test__/index.test.js +2 -2
- package/src/screens/Automate/__test__/Loading.test.js +2 -2
- package/src/screens/Automate/__test__/MultiUnits.test.js +10 -10
- package/src/screens/Automate/__test__/index.test.js +3 -3
- package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +2 -2
- package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +4 -4
- package/src/screens/Device/__test__/DetailHistoryChart.test.js +2 -2
- package/src/screens/Device/__test__/detail.test.js +14 -14
- package/src/screens/Device/detail.js +10 -3
- package/src/screens/Device/utils/index.test.js +4 -4
- package/src/screens/Drawer/Drawer.test.js +1 -1
- package/src/screens/EditActionsList/__tests__/index.test.js +5 -5
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +15 -15
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +19 -19
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +12 -12
- package/src/screens/EmergencySetting/__test__/DropDownItem.test.js +7 -7
- package/src/screens/EmergencySetting/__test__/index.test.js +3 -3
- package/src/screens/EnterPassword/__test__/EnterPassword.test.js +12 -12
- package/src/screens/Explore/__test__/Explore.test.js +3 -3
- package/src/screens/GuestInfo/__test__/index.test.js +3 -3
- package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +2 -2
- package/src/screens/HanetCamera/__test__/Detail.test.js +2 -2
- package/src/screens/HanetCamera/__test__/ManageAccess.test.js +5 -5
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +5 -5
- package/src/screens/HanetCamera/hooks/__test__/useHanetCheckinData.test.js +6 -6
- package/src/screens/HanetCamera/hooks/__test__/useHanetPlaceMembers.test.js +3 -3
- package/src/screens/ManageAccess/hooks/__test__/useManageAccess.test.js +11 -7
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +1 -1
- package/src/screens/Notification/__test__/Notification.test.js +5 -5
- package/src/screens/Notification/__test__/NotificationItem.test.js +79 -75
- package/src/screens/Notification/components/NotificationItem.js +134 -141
- package/src/screens/PlayBackCamera/__test__/Timer.test.js +3 -3
- package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +7 -7
- package/src/screens/ScriptDetail/__test__/index.test.js +31 -31
- package/src/screens/SetSchedule/__test__/SelectWeekday.test.js +1 -1
- package/src/screens/SetSchedule/__test__/index.test.js +4 -4
- package/src/screens/SharedUnit/__test__/ShareUnit.test.js +2 -2
- package/src/screens/SharedUnit/__test__/TabHeader.test.js +3 -3
- package/src/screens/Sharing/Components/__test__/DeviceItem.test.js +4 -4
- package/src/screens/Sharing/Components/__test__/ItemChangeRole.test.js +4 -4
- package/src/screens/Sharing/Components/__test__/TitleCheckBox.test.js +4 -4
- package/src/screens/Sharing/__test__/MemberList.test.js +1 -1
- package/src/screens/Sharing/__test__/MemberList2.test.js +1 -1
- package/src/screens/Sharing/__test__/SelectPermission.test.js +41 -41
- package/src/screens/Sharing/__test__/SelectUser.test.js +14 -14
- package/src/screens/SideMenuDetail/__test__/index.test.js +25 -4
- package/src/screens/SideMenuDetail/index.js +32 -19
- package/src/screens/SmartAccount/Connecting/index.js +3 -0
- package/src/screens/SmartAccount/ListDevice/__test__/DeviceItem.test.js +3 -3
- package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +17 -21
- package/src/screens/SmartAccount/ListDevice/index.js +17 -11
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +66 -11
- package/src/screens/SmartAccount/SuccessfullyConnected/index.js +102 -26
- package/src/screens/SmartAccount/SuccessfullyConnected/styles.js +58 -1
- package/src/screens/SmartAccount/__test__/Connecting.test.js +7 -4
- package/src/screens/SmartAccount/__test__/SmartAccount.test.js +17 -17
- package/src/screens/SmartIr/__test__/ButtonsBottom.test.js +2 -2
- package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +12 -12
- package/src/screens/SmartIr/__test__/SelectBrand.test.js +5 -5
- package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +5 -5
- package/src/screens/SmartIr/__test__/SmartIr.test.js +5 -5
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +12 -12
- package/src/screens/SubUnit/__test__/Detail.test.js +6 -6
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +44 -44
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +6 -6
- package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +5 -5
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +10 -10
- package/src/screens/TDSGuide/__test__/TDSGuide.test.js +3 -3
- package/src/screens/UVIndexGuide/__test__/UVIndexGuide.test.js +3 -3
- package/src/screens/Unit/ManageUnit.js +4 -45
- package/src/screens/Unit/ManageUnitStyles.js +5 -35
- package/src/screens/Unit/Station/__test__/index.test.js +1 -1
- package/src/screens/Unit/Summaries.js +11 -20
- package/src/screens/Unit/__test__/AddMenu.test.js +8 -8
- package/src/screens/Unit/__test__/CheckSendEmail.test.js +3 -3
- package/src/screens/Unit/__test__/ChooseLocation.test.js +2 -2
- package/src/screens/Unit/__test__/Detail.test.js +17 -17
- package/src/screens/Unit/__test__/ManageUnit.test.js +17 -17
- package/src/screens/Unit/__test__/MyAllUnit.test.js +5 -5
- package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +4 -4
- package/src/screens/Unit/__test__/SelectAddress.test.js +10 -10
- package/src/screens/Unit/__test__/SmartAccount.test.js +4 -4
- package/src/screens/Unit/__test__/SmartAccountItem.test.js +1 -1
- package/src/screens/Unit/__test__/Summaries.test.js +2 -2
- package/src/screens/Unit/components/ButtonWrapper/index.js +60 -0
- package/src/screens/Unit/components/ButtonWrapper/styles.js +37 -0
- package/src/screens/Unit/components/MyAllUnit/__test__/Header.test.js +19 -19
- package/src/screens/Unit/components/MyAllUnit/__test__/MyAllUnit.test.js +3 -3
- package/src/screens/Unit/components/MyAllUnit/__test__/index.test.js +4 -4
- package/src/screens/Unit/components/__test__/Header.test.js +12 -12
- package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
- package/src/screens/Unit/components/__test__/SharedUnit.test.js +6 -6
- package/src/screens/UnitSummary/__test__/index.test.js +61 -25
- package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +3 -3
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/ItemPower.test.js +3 -3
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +5 -5
- package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +3 -3
- package/src/screens/UnitSummary/components/Temperature/__test__/ChartAverage.test.js +3 -3
- package/src/screens/UnitSummary/components/Temperature/__test__/ItemAverage.test.js +3 -3
- package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +18 -18
- package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +12 -12
- package/src/screens/UnitSummary/components/__test__/TotalPowerBox.test.js +2 -2
- package/src/screens/UnitSummary/components/__test__/TotalPowerConsumption.test.js +2 -2
- package/src/screens/UnitSummary/components/__test__/UnitSummary.test.js +8 -8
- package/src/screens/UnitSummary/components/__test__/index.test.js +5 -5
- package/src/screens/UnitSummary/index.js +6 -1
- package/src/screens/WaterQualityGuide/__test__/index.test.js +12 -12
- package/src/utils/Apis/axios.js +23 -0
- package/src/utils/Converter/__test__/array.test.js +1 -1
- package/src/utils/Converter/__test__/url.test.js +1 -1
- package/src/utils/Functions/__test__/Search.test.js +1 -1
- package/src/utils/Functions/__test__/ShortEmail.test.js +1 -1
- package/src/utils/I18n/translations/en.json +3 -1
- package/src/utils/I18n/translations/vi.json +3 -1
- package/src/utils/__test__/InitData.test.js +2 -2
- package/src/utils/__test__/Utils.test.js +21 -3
- package/src/commons/UnitSummary/ConfigHistoryChart.js +0 -105
- package/src/screens/AddNewDevice/hooks/ConnectDevices.js +0 -67
- package/src/screens/AddNewDevice/hooks/useStateAlertRename.js +0 -32
- package/src/screens/SmartAccount/SuccessfullyConnected/DeviceItem.js +0 -37
- package/src/screens/SmartAccount/SuccessfullyConnected/DeviceItemStyles.js +0 -49
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/DeviceItem.test.js +0 -65
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/__test__/index.test.js +0 -63
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/index.js +0 -53
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import React, { memo, useCallback } from 'react';
|
|
1
|
+
import React, { memo, useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import { View, SafeAreaView, ScrollView } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { useNavigation } from '@react-navigation/native';
|
|
4
4
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
5
|
+
import { ActivityIndicator } from '@ant-design/react-native';
|
|
5
6
|
|
|
6
|
-
import
|
|
7
|
-
import Routes from '../../../utils/Route';
|
|
7
|
+
import _TextInput from '../../../commons/Form/TextInput';
|
|
8
8
|
import Text from '../../../commons/Text';
|
|
9
9
|
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
10
10
|
import { ViewButtonBottom } from '../../../commons';
|
|
11
|
-
import { Colors } from '../../../configs';
|
|
12
|
-
import
|
|
11
|
+
import { API, Colors } from '../../../configs';
|
|
12
|
+
import { axiosGet, axiosPost } from '../../../utils/Apis/axios';
|
|
13
|
+
import Routes from '../../../utils/Route';
|
|
14
|
+
import FImage from '../../../commons/FImage';
|
|
13
15
|
import styles from './styles';
|
|
16
|
+
import AccessibilityLabel from '../../../configs/AccessibilityLabel';
|
|
14
17
|
|
|
15
18
|
const SuccessfullyConnected = memo(({ route }) => {
|
|
16
19
|
const {
|
|
@@ -22,19 +25,27 @@ const SuccessfullyConnected = memo(({ route }) => {
|
|
|
22
25
|
smart_account_id_from_backend,
|
|
23
26
|
username,
|
|
24
27
|
brand,
|
|
28
|
+
chipId,
|
|
25
29
|
} = route.params;
|
|
26
30
|
const t = useTranslations();
|
|
27
|
-
const { navigate
|
|
31
|
+
const { navigate } = useNavigation();
|
|
32
|
+
const [info, setInfo] = useState({});
|
|
33
|
+
const [loadingFilterInfo, setLoadingFilterInfo] = useState(false);
|
|
34
|
+
const [loading, setLoading] = useState(true);
|
|
28
35
|
|
|
29
|
-
const handleContinue = useCallback(() => {
|
|
36
|
+
const handleContinue = useCallback(async () => {
|
|
37
|
+
await axiosPost(API.CHIP.RENAME_DEVICES(info.id), info);
|
|
30
38
|
navigate(Routes.ListDeviceSmartAccount, {
|
|
31
39
|
smart_account_id: smart_account_id || smart_account_id_from_backend,
|
|
32
40
|
username,
|
|
33
41
|
brand,
|
|
34
42
|
unit_id,
|
|
43
|
+
chipId,
|
|
35
44
|
});
|
|
36
45
|
}, [
|
|
37
46
|
brand,
|
|
47
|
+
chipId,
|
|
48
|
+
info,
|
|
38
49
|
navigate,
|
|
39
50
|
smart_account_id,
|
|
40
51
|
smart_account_id_from_backend,
|
|
@@ -42,7 +53,8 @@ const SuccessfullyConnected = memo(({ route }) => {
|
|
|
42
53
|
username,
|
|
43
54
|
]);
|
|
44
55
|
|
|
45
|
-
const handleFinish = useCallback(() => {
|
|
56
|
+
const handleFinish = useCallback(async () => {
|
|
57
|
+
await axiosPost(API.CHIP.RENAME_DEVICES(info.id), info);
|
|
46
58
|
navigate(Routes.UnitStack, {
|
|
47
59
|
screen: Routes.UnitDetail,
|
|
48
60
|
params: {
|
|
@@ -51,15 +63,52 @@ const SuccessfullyConnected = memo(({ route }) => {
|
|
|
51
63
|
isSuccessfullyConnected: true,
|
|
52
64
|
},
|
|
53
65
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
}, [info, navigate, stationId, unit_id]);
|
|
67
|
+
|
|
68
|
+
const handleFilterNewInfo = useCallback(async () => {
|
|
69
|
+
let newInfo = [];
|
|
70
|
+
if (loadingFilterInfo && Object.keys(info || {}).length !== 0) {
|
|
71
|
+
for (let i = 0; i < listSelectDevice?.length; i++) {
|
|
72
|
+
await info?.sensors?.filter((item) => {
|
|
73
|
+
if (item?.end_devices[0]?.id === listSelectDevice[i]?.id) {
|
|
74
|
+
newInfo.push(item);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
setLoading(false);
|
|
79
|
+
}
|
|
80
|
+
setInfo({ ...info, sensors: [...newInfo] });
|
|
81
|
+
}, [info, listSelectDevice, loadingFilterInfo]);
|
|
82
|
+
|
|
83
|
+
const updateItemName = (type, sensor_index, end_device_index) => (value) => {
|
|
84
|
+
setInfo((currentInfo) => {
|
|
85
|
+
if (type === 'end_device') {
|
|
86
|
+
currentInfo.sensors[sensor_index].end_devices[end_device_index] = {
|
|
87
|
+
...currentInfo.sensors[sensor_index].end_devices[end_device_index],
|
|
88
|
+
name: value,
|
|
89
|
+
};
|
|
90
|
+
currentInfo.sensors[sensor_index] = {
|
|
91
|
+
...currentInfo.sensors[sensor_index],
|
|
92
|
+
};
|
|
93
|
+
return { ...currentInfo };
|
|
94
|
+
}
|
|
61
95
|
});
|
|
62
|
-
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
(async () => {
|
|
100
|
+
const { success, data } = await axiosGet(API.CHIP.RENAME_DEVICES(chipId));
|
|
101
|
+
if (success) {
|
|
102
|
+
setInfo(data);
|
|
103
|
+
setLoadingFilterInfo(true);
|
|
104
|
+
}
|
|
105
|
+
})();
|
|
106
|
+
}, [chipId]);
|
|
107
|
+
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
handleFilterNewInfo();
|
|
110
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
|
+
}, [loadingFilterInfo]);
|
|
63
112
|
|
|
64
113
|
return (
|
|
65
114
|
<>
|
|
@@ -71,15 +120,42 @@ const SuccessfullyConnected = memo(({ route }) => {
|
|
|
71
120
|
{t('successfully_connected')}
|
|
72
121
|
</Text>
|
|
73
122
|
<Text size={14} style={styles.textHome}>
|
|
74
|
-
Home - {nameSubUnit}
|
|
123
|
+
{`Home - ${nameSubUnit}`}
|
|
75
124
|
</Text>
|
|
76
|
-
{
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
125
|
+
{!loading && info?.sensors?.length !== 0 ? (
|
|
126
|
+
<View>
|
|
127
|
+
{info?.sensors?.map((sensor, sensor_index) => (
|
|
128
|
+
<View style={styles.wrapItem}>
|
|
129
|
+
{sensor?.end_devices?.length &&
|
|
130
|
+
sensor?.end_devices?.map(
|
|
131
|
+
(end_device, end_device_index) => (
|
|
132
|
+
<View style={styles.device} key={`${end_device?.id}`}>
|
|
133
|
+
<FImage
|
|
134
|
+
source={{
|
|
135
|
+
uri: listSelectDevice[sensor_index]?.icon_kit,
|
|
136
|
+
}}
|
|
137
|
+
style={styles.iconSensor}
|
|
138
|
+
/>
|
|
139
|
+
<_TextInput
|
|
140
|
+
value={end_device.name}
|
|
141
|
+
textInputStyle={styles.textItem}
|
|
142
|
+
onChange={updateItemName(
|
|
143
|
+
'end_device',
|
|
144
|
+
sensor_index,
|
|
145
|
+
end_device_index
|
|
146
|
+
)}
|
|
147
|
+
/>
|
|
148
|
+
</View>
|
|
149
|
+
)
|
|
150
|
+
)}
|
|
151
|
+
</View>
|
|
152
|
+
))}
|
|
153
|
+
</View>
|
|
154
|
+
) : (
|
|
155
|
+
<View style={styles.bottomLoading}>
|
|
156
|
+
<ActivityIndicator size="small" color={Colors.Black} />
|
|
157
|
+
</View>
|
|
158
|
+
)}
|
|
83
159
|
</View>
|
|
84
160
|
</ScrollView>
|
|
85
161
|
</SafeAreaView>
|
|
@@ -90,7 +166,7 @@ const SuccessfullyConnected = memo(({ route }) => {
|
|
|
90
166
|
rightTitle={t('finish')}
|
|
91
167
|
onRightClick={handleFinish}
|
|
92
168
|
accessibilityLabelPrefix={
|
|
93
|
-
AccessibilityLabel.PREFIX.
|
|
169
|
+
AccessibilityLabel.PREFIX.BUTTON_BOTTOM_SMART_ACCOUNT
|
|
94
170
|
}
|
|
95
171
|
/>
|
|
96
172
|
</View>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
2
|
import { getStatusBarHeight } from 'react-native-iphone-x-helper';
|
|
3
|
-
import { Colors } from '../../../configs';
|
|
3
|
+
import { Colors, Constants } from '../../../configs';
|
|
4
|
+
|
|
5
|
+
const marginItem = 12;
|
|
6
|
+
const marginHorizontal = 5;
|
|
7
|
+
const widthItem = (Constants.width - marginHorizontal * 2 - marginItem) / 2;
|
|
8
|
+
const heightItem = (widthItem / 166) * 60;
|
|
4
9
|
|
|
5
10
|
export default StyleSheet.create({
|
|
6
11
|
wrap: {
|
|
@@ -39,4 +44,56 @@ export default StyleSheet.create({
|
|
|
39
44
|
borderTopColor: Colors.Gray4,
|
|
40
45
|
backgroundColor: Colors.White,
|
|
41
46
|
},
|
|
47
|
+
device: {
|
|
48
|
+
flexDirection: 'row',
|
|
49
|
+
justifyContent: 'center',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
width: 250,
|
|
52
|
+
},
|
|
53
|
+
wrapItem: {
|
|
54
|
+
paddingHorizontal: 15,
|
|
55
|
+
borderRadius: 10,
|
|
56
|
+
height: heightItem,
|
|
57
|
+
width: 250,
|
|
58
|
+
borderWidth: 1,
|
|
59
|
+
borderColor: Colors.Gray4,
|
|
60
|
+
backgroundColor: Colors.White,
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
marginBottom: 16,
|
|
64
|
+
flexDirection: 'row',
|
|
65
|
+
shadowColor: Colors.Shadow,
|
|
66
|
+
shadowOffset: {
|
|
67
|
+
width: 0,
|
|
68
|
+
height: 2,
|
|
69
|
+
},
|
|
70
|
+
shadowOpacity: 0.1,
|
|
71
|
+
shadowRadius: 3,
|
|
72
|
+
elevation: 6,
|
|
73
|
+
paddingLeft: 30,
|
|
74
|
+
paddingRight: 30,
|
|
75
|
+
},
|
|
76
|
+
textItem: {
|
|
77
|
+
display: 'flex',
|
|
78
|
+
justifyContent: 'center',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
borderWidth: 0,
|
|
81
|
+
borderBottomWidth: 1,
|
|
82
|
+
borderBottomColor: Colors.Primary,
|
|
83
|
+
textAlign: 'center',
|
|
84
|
+
marginTop: -10,
|
|
85
|
+
fontSize: 16,
|
|
86
|
+
maxWidth: 170,
|
|
87
|
+
},
|
|
88
|
+
bottomLoading: {
|
|
89
|
+
height: 32,
|
|
90
|
+
justifyContent: 'center',
|
|
91
|
+
alignItems: 'center',
|
|
92
|
+
},
|
|
93
|
+
iconSensor: {
|
|
94
|
+
width: 32,
|
|
95
|
+
height: 32,
|
|
96
|
+
resizeMode: 'contain',
|
|
97
|
+
marginRight: 10,
|
|
98
|
+
},
|
|
42
99
|
});
|
|
@@ -32,23 +32,24 @@ describe('Test Connecting', () => {
|
|
|
32
32
|
afterEach(() => {
|
|
33
33
|
mockedNavigate.mockClear();
|
|
34
34
|
});
|
|
35
|
-
|
|
35
|
+
it('render Connecting', async () => {
|
|
36
36
|
const route = {
|
|
37
37
|
params: {
|
|
38
38
|
unit_id: 1,
|
|
39
39
|
username: 'abc',
|
|
40
40
|
password: '123456',
|
|
41
41
|
brand: '',
|
|
42
|
+
chipId: 1,
|
|
42
43
|
},
|
|
43
44
|
};
|
|
44
|
-
act(() => {
|
|
45
|
+
await act(async () => {
|
|
45
46
|
tree = renderer.create(wrapComponent(route));
|
|
46
47
|
});
|
|
47
48
|
const instance = tree.root;
|
|
48
49
|
const texts = instance.findAllByType(Text);
|
|
49
50
|
expect(texts).toHaveLength(6);
|
|
50
51
|
});
|
|
51
|
-
|
|
52
|
+
it('render connecting sync smartAccount fail', async () => {
|
|
52
53
|
const route = {
|
|
53
54
|
params: {
|
|
54
55
|
unit_id: 1,
|
|
@@ -56,6 +57,7 @@ describe('Test Connecting', () => {
|
|
|
56
57
|
password: '123456',
|
|
57
58
|
brand: '',
|
|
58
59
|
listDeviceIds: false,
|
|
60
|
+
chipId: 1,
|
|
59
61
|
},
|
|
60
62
|
};
|
|
61
63
|
mock.onPost(API.SMART_ACCOUNT.SYNC).reply(400, {});
|
|
@@ -67,7 +69,7 @@ describe('Test Connecting', () => {
|
|
|
67
69
|
});
|
|
68
70
|
});
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
it('render add device to station fail', async () => {
|
|
71
73
|
const route = {
|
|
72
74
|
params: {
|
|
73
75
|
unit_id: 1,
|
|
@@ -75,6 +77,7 @@ describe('Test Connecting', () => {
|
|
|
75
77
|
password: '123456',
|
|
76
78
|
brand: '',
|
|
77
79
|
listDeviceIds: true,
|
|
80
|
+
chipId: 1,
|
|
78
81
|
},
|
|
79
82
|
};
|
|
80
83
|
mock.onPost(API.SMART_ACCOUNT.ADD_DEVICE_TO_STATION).reply(400, {});
|
|
@@ -31,19 +31,19 @@ describe('Test SmartAccount', () => {
|
|
|
31
31
|
afterEach(() => {
|
|
32
32
|
mockedNavigate.mockClear();
|
|
33
33
|
});
|
|
34
|
-
|
|
34
|
+
it('render SmartAccount', async () => {
|
|
35
35
|
const route = {
|
|
36
36
|
params: {
|
|
37
37
|
unit_id: 1,
|
|
38
38
|
},
|
|
39
39
|
};
|
|
40
|
-
act(() => {
|
|
40
|
+
await act(async () => {
|
|
41
41
|
tree = renderer.create(wrapComponent(route));
|
|
42
42
|
});
|
|
43
43
|
const instance = tree.root;
|
|
44
44
|
const scrollView = instance.findAllByType(ScrollView);
|
|
45
45
|
const touchDienQuang = instance.findAllByType(TouchableOpacity);
|
|
46
|
-
act(async () => {
|
|
46
|
+
await act(async () => {
|
|
47
47
|
touchDienQuang[1].props.onPress();
|
|
48
48
|
});
|
|
49
49
|
expect(scrollView[0]).toBeDefined();
|
|
@@ -51,13 +51,13 @@ describe('Test SmartAccount', () => {
|
|
|
51
51
|
expect(touchDienQuang).toBeDefined();
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
it('render login SmartAccount', async () => {
|
|
55
55
|
const route = {
|
|
56
56
|
params: {
|
|
57
57
|
unit_id: 1,
|
|
58
58
|
},
|
|
59
59
|
};
|
|
60
|
-
act(() => {
|
|
60
|
+
await act(async () => {
|
|
61
61
|
tree = renderer.create(wrapComponent(route));
|
|
62
62
|
});
|
|
63
63
|
const instance = tree.root;
|
|
@@ -66,13 +66,13 @@ describe('Test SmartAccount', () => {
|
|
|
66
66
|
el.props.accessibilityLabel ===
|
|
67
67
|
AccessibilityLabel.LOGIN_SMART_ACCOUNT && el.type === TouchableOpacity
|
|
68
68
|
);
|
|
69
|
-
act(async () => {
|
|
69
|
+
await act(async () => {
|
|
70
70
|
touchableOpacity.props.onPress();
|
|
71
71
|
});
|
|
72
72
|
expect(touchableOpacity).toBeDefined();
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
it('render handle onpress save but not select supplier item ', async () => {
|
|
76
76
|
const route = {
|
|
77
77
|
params: {
|
|
78
78
|
unitId: 1,
|
|
@@ -105,7 +105,7 @@ describe('Test SmartAccount', () => {
|
|
|
105
105
|
el.props.accessibilityLabel ===
|
|
106
106
|
AccessibilityLabel.LOGIN_SMART_ACCOUNT && el.type === TouchableOpacity
|
|
107
107
|
);
|
|
108
|
-
act(async () => {
|
|
108
|
+
await act(async () => {
|
|
109
109
|
await touchableOpacity.props.onPress();
|
|
110
110
|
});
|
|
111
111
|
expect(Toast.show).toBeCalledWith({
|
|
@@ -117,7 +117,7 @@ describe('Test SmartAccount', () => {
|
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
it('render handle sync item DienQuang from screen unitDetail', async () => {
|
|
121
121
|
const route = {
|
|
122
122
|
params: {
|
|
123
123
|
unitId: 1,
|
|
@@ -150,7 +150,7 @@ describe('Test SmartAccount', () => {
|
|
|
150
150
|
el.props.accessibilityLabel ===
|
|
151
151
|
AccessibilityLabel.TOUCH_SUPPLIER_ITEM && el.type === TouchableOpacity
|
|
152
152
|
);
|
|
153
|
-
act(async () => {
|
|
153
|
+
await act(async () => {
|
|
154
154
|
await touchSupplierItem[0].props.onPress();
|
|
155
155
|
});
|
|
156
156
|
const touchableOpacity = instance.find(
|
|
@@ -158,7 +158,7 @@ describe('Test SmartAccount', () => {
|
|
|
158
158
|
el.props.accessibilityLabel ===
|
|
159
159
|
AccessibilityLabel.LOGIN_SMART_ACCOUNT && el.type === TouchableOpacity
|
|
160
160
|
);
|
|
161
|
-
act(async () => {
|
|
161
|
+
await act(async () => {
|
|
162
162
|
await touchableOpacity.props.onPress();
|
|
163
163
|
});
|
|
164
164
|
expect(mockedNavigate).toBeCalledWith(Routes.SmartAccountConnecting, {
|
|
@@ -169,7 +169,7 @@ describe('Test SmartAccount', () => {
|
|
|
169
169
|
});
|
|
170
170
|
});
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
it('render handle sync item DienQuang from screen dashboard', async () => {
|
|
173
173
|
const route = {
|
|
174
174
|
params: {},
|
|
175
175
|
};
|
|
@@ -200,7 +200,7 @@ describe('Test SmartAccount', () => {
|
|
|
200
200
|
el.props.accessibilityLabel ===
|
|
201
201
|
AccessibilityLabel.TOUCH_SUPPLIER_ITEM && el.type === TouchableOpacity
|
|
202
202
|
);
|
|
203
|
-
act(async () => {
|
|
203
|
+
await act(async () => {
|
|
204
204
|
await touchSupplierItem[0].props.onPress();
|
|
205
205
|
});
|
|
206
206
|
const touchableOpacity = instance.find(
|
|
@@ -208,7 +208,7 @@ describe('Test SmartAccount', () => {
|
|
|
208
208
|
el.props.accessibilityLabel ===
|
|
209
209
|
AccessibilityLabel.LOGIN_SMART_ACCOUNT && el.type === TouchableOpacity
|
|
210
210
|
);
|
|
211
|
-
act(async () => {
|
|
211
|
+
await act(async () => {
|
|
212
212
|
await touchableOpacity.props.onPress();
|
|
213
213
|
});
|
|
214
214
|
expect(mockedNavigate).toBeCalledWith(Routes.AddDeviceStack, {
|
|
@@ -222,13 +222,13 @@ describe('Test SmartAccount', () => {
|
|
|
222
222
|
});
|
|
223
223
|
});
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
it('render handle sync Lg', async () => {
|
|
226
226
|
const route = {
|
|
227
227
|
params: {
|
|
228
228
|
unit_id: 1,
|
|
229
229
|
},
|
|
230
230
|
};
|
|
231
|
-
act(() => {
|
|
231
|
+
await act(async () => {
|
|
232
232
|
tree = renderer.create(wrapComponent(route));
|
|
233
233
|
});
|
|
234
234
|
const instance = tree.root;
|
|
@@ -237,7 +237,7 @@ describe('Test SmartAccount', () => {
|
|
|
237
237
|
el.props.accessibilityLabel ===
|
|
238
238
|
AccessibilityLabel.TOUCH_SUPPLIER_ITEM && el.type === TouchableOpacity
|
|
239
239
|
);
|
|
240
|
-
act(async () => {
|
|
240
|
+
await act(async () => {
|
|
241
241
|
await touchSupplierItem[1].props.onPress();
|
|
242
242
|
});
|
|
243
243
|
expect(touchSupplierItem).toBeDefined();
|
|
@@ -20,8 +20,8 @@ jest.mock('react', () => {
|
|
|
20
20
|
describe('Test ButtonsBottom', () => {
|
|
21
21
|
let tree;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
act(() => {
|
|
23
|
+
it('render ButtonsBottom', async () => {
|
|
24
|
+
await act(async () => {
|
|
25
25
|
tree = renderer.create(wrapComponent());
|
|
26
26
|
});
|
|
27
27
|
const instance = tree.root;
|
|
@@ -31,14 +31,14 @@ jest.mock('react', () => {
|
|
|
31
31
|
});
|
|
32
32
|
describe('Test GroupButtonByType', () => {
|
|
33
33
|
let tree;
|
|
34
|
-
|
|
34
|
+
it('render GroupButtonByType', async () => {
|
|
35
35
|
const route = {
|
|
36
36
|
params: {
|
|
37
37
|
device_type: { id: 1, name: '', icon: '' },
|
|
38
38
|
brand: { id: 1, name: '' },
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
|
-
act(() => {
|
|
41
|
+
await act(async () => {
|
|
42
42
|
tree = renderer.create(wrapComponent(route));
|
|
43
43
|
});
|
|
44
44
|
const instance = tree.root;
|
|
@@ -51,57 +51,57 @@ describe('Test GroupButtonByType', () => {
|
|
|
51
51
|
AccessibilityLabel.GROUP_BUTTON_TYPE.BUTTON_BOTTOM
|
|
52
52
|
);
|
|
53
53
|
|
|
54
|
-
act(() => {
|
|
54
|
+
await act(async () => {
|
|
55
55
|
ButtonBottom.props.onPressLeft();
|
|
56
56
|
});
|
|
57
|
-
act(() => {
|
|
57
|
+
await act(async () => {
|
|
58
58
|
ButtonBottom.props.onPressRight();
|
|
59
59
|
});
|
|
60
60
|
expect(ButtonBottom).toBeDefined();
|
|
61
61
|
});
|
|
62
|
-
|
|
62
|
+
it('onPressLeft ButtonsBottom', async () => {
|
|
63
63
|
const route = {
|
|
64
64
|
params: {
|
|
65
65
|
device_type: { id: 1, name: '', icon: '' },
|
|
66
66
|
brand: { id: 1, name: '' },
|
|
67
67
|
},
|
|
68
68
|
};
|
|
69
|
-
act(() => {
|
|
69
|
+
await act(async () => {
|
|
70
70
|
tree = renderer.create(wrapComponent(route));
|
|
71
71
|
});
|
|
72
72
|
const instance = tree.root;
|
|
73
73
|
const buttonsBottom = instance.findAllByType(ButtonsBottom);
|
|
74
74
|
expect(buttonsBottom).toHaveLength(2);
|
|
75
|
-
act(() => {
|
|
75
|
+
await act(async () => {
|
|
76
76
|
buttonsBottom[0].props.onPressLeft();
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
|
-
|
|
79
|
+
it('onPressRight ButtonsBottom', async () => {
|
|
80
80
|
const route = {
|
|
81
81
|
params: {
|
|
82
82
|
device_type: { id: 1, name: '', icon: '' },
|
|
83
83
|
brand: { id: 1, name: '' },
|
|
84
84
|
},
|
|
85
85
|
};
|
|
86
|
-
act(() => {
|
|
86
|
+
await act(async () => {
|
|
87
87
|
tree = renderer.create(wrapComponent(route));
|
|
88
88
|
});
|
|
89
89
|
const instance = tree.root;
|
|
90
90
|
const buttonsBottom = instance.findAllByType(ButtonsBottom);
|
|
91
91
|
expect(buttonsBottom).toHaveLength(2);
|
|
92
|
-
act(() => {
|
|
92
|
+
await act(async () => {
|
|
93
93
|
buttonsBottom[0].props.onPressRight();
|
|
94
94
|
});
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
it('onChange TextInputPassword', async () => {
|
|
98
98
|
const route = {
|
|
99
99
|
params: {
|
|
100
100
|
device_type: { id: 1, name: '', icon: '' },
|
|
101
101
|
brand: { id: 1, name: '' },
|
|
102
102
|
},
|
|
103
103
|
};
|
|
104
|
-
act(() => {
|
|
104
|
+
await act(async () => {
|
|
105
105
|
tree = renderer.create(wrapComponent(route));
|
|
106
106
|
});
|
|
107
107
|
|
|
@@ -29,13 +29,13 @@ jest.mock('react', () => {
|
|
|
29
29
|
});
|
|
30
30
|
describe('Test SelectBrand', () => {
|
|
31
31
|
let tree;
|
|
32
|
-
|
|
32
|
+
it('render SelectBrand', async () => {
|
|
33
33
|
const route = {
|
|
34
34
|
params: {
|
|
35
35
|
device_type: { id: 1, name: '' },
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
|
-
act(() => {
|
|
38
|
+
await act(async () => {
|
|
39
39
|
tree = renderer.create(wrapComponent(route));
|
|
40
40
|
});
|
|
41
41
|
const instance = tree.root;
|
|
@@ -43,13 +43,13 @@ describe('Test SelectBrand', () => {
|
|
|
43
43
|
expect(scrollView).toHaveLength(1);
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
it('Row SmartIr onPress', async () => {
|
|
47
47
|
const route = {
|
|
48
48
|
params: {
|
|
49
49
|
device_type: { id: 1, name: '' },
|
|
50
50
|
},
|
|
51
51
|
};
|
|
52
|
-
act(() => {
|
|
52
|
+
await act(async () => {
|
|
53
53
|
tree = renderer.create(wrapComponent(route));
|
|
54
54
|
});
|
|
55
55
|
const instance = tree.root;
|
|
@@ -57,7 +57,7 @@ describe('Test SelectBrand', () => {
|
|
|
57
57
|
expect(scrollView).toHaveLength(1);
|
|
58
58
|
const rowItem = instance.findAllByType(RowItem);
|
|
59
59
|
expect(rowItem).toHaveLength(3);
|
|
60
|
-
act(() => {
|
|
60
|
+
await act(async () => {
|
|
61
61
|
rowItem[0].props.onPress();
|
|
62
62
|
});
|
|
63
63
|
expect(mockNavigate).toHaveBeenCalled();
|
|
@@ -30,8 +30,8 @@ jest.mock('react', () => {
|
|
|
30
30
|
describe('Test SelectIrDeviceType', () => {
|
|
31
31
|
let tree;
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
act(() => {
|
|
33
|
+
it('render SelectIrDeviceType', async () => {
|
|
34
|
+
await act(async () => {
|
|
35
35
|
tree = renderer.create(wrapComponent());
|
|
36
36
|
});
|
|
37
37
|
const instance = tree.root;
|
|
@@ -39,8 +39,8 @@ describe('Test SelectIrDeviceType', () => {
|
|
|
39
39
|
expect(scrollView).toHaveLength(1);
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
act(() => {
|
|
42
|
+
it('itemDevice SelectIrDeviceType onPress', async () => {
|
|
43
|
+
await act(async () => {
|
|
44
44
|
tree = renderer.create(wrapComponent());
|
|
45
45
|
});
|
|
46
46
|
const instance = tree.root;
|
|
@@ -49,7 +49,7 @@ describe('Test SelectIrDeviceType', () => {
|
|
|
49
49
|
const touchableOpacity = instance.findAllByType(TouchableOpacity);
|
|
50
50
|
expect(touchableOpacity).toHaveLength(7);
|
|
51
51
|
const itemDevice = touchableOpacity[1];
|
|
52
|
-
act(() => {
|
|
52
|
+
await act(async () => {
|
|
53
53
|
itemDevice.props.onPress();
|
|
54
54
|
});
|
|
55
55
|
expect(mockNavigate).toHaveBeenCalled();
|
|
@@ -25,7 +25,7 @@ describe('Test SmartIr', () => {
|
|
|
25
25
|
beforeEach(() => {
|
|
26
26
|
mockNavigate.mockClear();
|
|
27
27
|
});
|
|
28
|
-
|
|
28
|
+
it('render SmartIr', async () => {
|
|
29
29
|
const item = {
|
|
30
30
|
configuration: { devices: [] },
|
|
31
31
|
id: 11,
|
|
@@ -33,7 +33,7 @@ describe('Test SmartIr', () => {
|
|
|
33
33
|
template: 'smart_ir',
|
|
34
34
|
type: 'smart_ir',
|
|
35
35
|
};
|
|
36
|
-
act(() => {
|
|
36
|
+
await act(async () => {
|
|
37
37
|
tree = renderer.create(wrapComponent(item));
|
|
38
38
|
});
|
|
39
39
|
const instance = tree.root;
|
|
@@ -46,7 +46,7 @@ describe('Test SmartIr', () => {
|
|
|
46
46
|
expect(itemAddNewList).toHaveLength(1);
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
it('render SmartIr on AddNew', async () => {
|
|
50
50
|
const item = {
|
|
51
51
|
configuration: { devices: [] },
|
|
52
52
|
id: 11,
|
|
@@ -54,7 +54,7 @@ describe('Test SmartIr', () => {
|
|
|
54
54
|
template: 'smart_ir',
|
|
55
55
|
type: 'smart_ir',
|
|
56
56
|
};
|
|
57
|
-
act(() => {
|
|
57
|
+
await act(async () => {
|
|
58
58
|
tree = renderer.create(wrapComponent(item));
|
|
59
59
|
});
|
|
60
60
|
const instance = tree.root;
|
|
@@ -62,7 +62,7 @@ describe('Test SmartIr', () => {
|
|
|
62
62
|
(el) =>
|
|
63
63
|
el.props.accessibilityLabel === AccessibilityLabel.SUB_UNIT_ADD_DEVICE
|
|
64
64
|
);
|
|
65
|
-
act(() => {
|
|
65
|
+
await act(async () => {
|
|
66
66
|
itemAddNew.props.onPress();
|
|
67
67
|
});
|
|
68
68
|
expect(mockNavigate).toHaveBeenCalled();
|