@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
|
@@ -75,7 +75,7 @@ describe('Test AddSubUnit', () => {
|
|
|
75
75
|
});
|
|
76
76
|
let tree;
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
it('onChoosePhoto show image picker', async () => {
|
|
79
79
|
await act(async () => {
|
|
80
80
|
tree = await create(wrapComponent(route));
|
|
81
81
|
});
|
|
@@ -94,7 +94,7 @@ describe('Test AddSubUnit', () => {
|
|
|
94
94
|
expect(imagePicker.props.showImagePicker).toEqual(true);
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
it('ImagePicker setImageUrl show wallpaper', async () => {
|
|
98
98
|
await act(async () => {
|
|
99
99
|
tree = await create(wrapComponent(route));
|
|
100
100
|
});
|
|
@@ -127,7 +127,7 @@ describe('Test AddSubUnit', () => {
|
|
|
127
127
|
return viewButtonBottom;
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
it('onChangeRoomName and setImageUrl for validateData', async () => {
|
|
131
131
|
await act(async () => {
|
|
132
132
|
tree = await create(wrapComponent(route));
|
|
133
133
|
});
|
|
@@ -135,7 +135,7 @@ describe('Test AddSubUnit', () => {
|
|
|
135
135
|
await makeValidateData(instance);
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
it('ViewButtonBottom onLeftClick', async () => {
|
|
139
139
|
await act(async () => {
|
|
140
140
|
tree = await create(wrapComponent(route));
|
|
141
141
|
});
|
|
@@ -149,7 +149,7 @@ describe('Test AddSubUnit', () => {
|
|
|
149
149
|
expect(mockedGoBack).toHaveBeenCalled();
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
it('validateData then send api success', async () => {
|
|
153
153
|
mock.onPost(API.UNIT.CREATE_UNIT()).reply(200, {});
|
|
154
154
|
await act(async () => {
|
|
155
155
|
tree = await create(wrapComponent(route));
|
|
@@ -167,7 +167,7 @@ describe('Test AddSubUnit', () => {
|
|
|
167
167
|
});
|
|
168
168
|
});
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
it('validateData then send api fail', async () => {
|
|
171
171
|
mock.onPost(API.UNIT.CREATE_UNIT()).reply(400);
|
|
172
172
|
await act(async () => {
|
|
173
173
|
tree = await create(wrapComponent(route));
|
|
@@ -185,7 +185,7 @@ describe('Test AddSubUnit', () => {
|
|
|
185
185
|
});
|
|
186
186
|
});
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
it('test create Unit', async () => {
|
|
189
189
|
route.params = {
|
|
190
190
|
...route.params,
|
|
191
191
|
location: 'Unit address',
|
|
@@ -207,7 +207,7 @@ describe('Test AddSubUnit', () => {
|
|
|
207
207
|
expect(mockNavigationDispatch).toBeCalledWith(mockReplace);
|
|
208
208
|
});
|
|
209
209
|
|
|
210
|
-
|
|
210
|
+
it('test choose Location', async () => {
|
|
211
211
|
route.params = {
|
|
212
212
|
...route.params,
|
|
213
213
|
location: '',
|
|
@@ -223,13 +223,13 @@ describe('Test AddSubUnit', () => {
|
|
|
223
223
|
el.props.accessibilityLabel ===
|
|
224
224
|
AccessibilityLabel.ADD_SUB_UNIT_BUTTON_CHOOSE_LOCATION
|
|
225
225
|
);
|
|
226
|
-
act(() => {
|
|
226
|
+
await act(async () => {
|
|
227
227
|
buttonChooseLocation.props.onPress();
|
|
228
228
|
});
|
|
229
229
|
expect(mockedNavigate).toHaveBeenCalledWith(Routes.AddLocationMaps);
|
|
230
230
|
});
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
it('test create Unit Fail', async () => {
|
|
233
233
|
route.params = {
|
|
234
234
|
...route.params,
|
|
235
235
|
location: 'Unit address',
|
|
@@ -252,7 +252,7 @@ describe('Test AddSubUnit', () => {
|
|
|
252
252
|
});
|
|
253
253
|
});
|
|
254
254
|
|
|
255
|
-
|
|
255
|
+
it('test create sub-unit type AddHassiDevice', async () => {
|
|
256
256
|
route.params = {
|
|
257
257
|
...route.params,
|
|
258
258
|
addType: 'AddHassiDevice',
|
|
@@ -269,7 +269,7 @@ describe('Test AddSubUnit', () => {
|
|
|
269
269
|
expect(mockedGoBack).toHaveBeenCalled();
|
|
270
270
|
});
|
|
271
271
|
|
|
272
|
-
|
|
272
|
+
it('test create sub-unit type AddNewGateway', async () => {
|
|
273
273
|
route.params = {
|
|
274
274
|
...route.params,
|
|
275
275
|
addType: 'AddNewGateway',
|
|
@@ -109,16 +109,16 @@ describe('Test SubUnitDetail', () => {
|
|
|
109
109
|
});
|
|
110
110
|
let tree;
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
act(() => {
|
|
114
|
-
tree = create(wrapComponent(route));
|
|
112
|
+
it('ItemDevice', async () => {
|
|
113
|
+
await act(async () => {
|
|
114
|
+
tree = await create(wrapComponent(route));
|
|
115
115
|
});
|
|
116
116
|
const instance = tree.root;
|
|
117
117
|
const itemDevices = instance.findAllByType(ItemDevice);
|
|
118
118
|
expect(itemDevices).toHaveLength(0);
|
|
119
119
|
});
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
it('onBack', async () => {
|
|
122
122
|
mockedDangerouslyGetState.mockImplementation(() => ({
|
|
123
123
|
routes: [
|
|
124
124
|
{ name: 'route 1' },
|
|
@@ -138,7 +138,7 @@ describe('Test SubUnitDetail', () => {
|
|
|
138
138
|
expect(mockedDangerouslyGetStatePop).toHaveBeenCalledWith(2);
|
|
139
139
|
});
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
it('click Menu ActionMore', async () => {
|
|
142
142
|
mockedDangerouslyGetState.mockImplementation(() => ({
|
|
143
143
|
routes: [
|
|
144
144
|
{ name: 'route 1' },
|
|
@@ -157,7 +157,7 @@ describe('Test SubUnitDetail', () => {
|
|
|
157
157
|
AccessibilityLabel.HEADER_UNIT_BUTTON_BACK &&
|
|
158
158
|
el.type === TouchableOpacity
|
|
159
159
|
);
|
|
160
|
-
act(() => {
|
|
160
|
+
await act(async () => {
|
|
161
161
|
button.props.onPress();
|
|
162
162
|
});
|
|
163
163
|
const buttonOnActionPress = instance.findAll(
|
|
@@ -95,9 +95,9 @@ describe('Test EditSubUnit', () => {
|
|
|
95
95
|
});
|
|
96
96
|
let tree;
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
act(() => {
|
|
100
|
-
tree = create(wrapComponent(route));
|
|
98
|
+
it('alertAction', async () => {
|
|
99
|
+
await act(async () => {
|
|
100
|
+
tree = await create(wrapComponent(route));
|
|
101
101
|
});
|
|
102
102
|
const instance = tree.root;
|
|
103
103
|
const alertAction = instance.findByType(AlertAction);
|
|
@@ -109,7 +109,7 @@ describe('Test EditSubUnit', () => {
|
|
|
109
109
|
);
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
it('alertAction rightButtonClick success, previous screen Routes.UnitDetail', async () => {
|
|
113
113
|
mock
|
|
114
114
|
.onDelete('https://backend.eoh.io/api/property_manager/1/sub_units/2/')
|
|
115
115
|
.reply(200);
|
|
@@ -122,8 +122,8 @@ describe('Test EditSubUnit', () => {
|
|
|
122
122
|
],
|
|
123
123
|
}));
|
|
124
124
|
|
|
125
|
-
act(() => {
|
|
126
|
-
tree = create(wrapComponent(route));
|
|
125
|
+
await act(async () => {
|
|
126
|
+
tree = await create(wrapComponent(route));
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
const instance = tree.root;
|
|
@@ -134,7 +134,7 @@ describe('Test EditSubUnit', () => {
|
|
|
134
134
|
expect(alertAction.props.visible).toEqual(false);
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
it('alertAction rightButtonClick success', async () => {
|
|
138
138
|
mock
|
|
139
139
|
.onDelete('https://backend.eoh.io/api/property_manager/1/sub_units/2/')
|
|
140
140
|
.reply(200);
|
|
@@ -142,8 +142,8 @@ describe('Test EditSubUnit', () => {
|
|
|
142
142
|
routes: [{ name: 'route 1' }, { name: 'route 2' }, { name: 'route 3' }],
|
|
143
143
|
}));
|
|
144
144
|
|
|
145
|
-
act(() => {
|
|
146
|
-
tree = create(wrapComponent(route));
|
|
145
|
+
await act(async () => {
|
|
146
|
+
tree = await create(wrapComponent(route));
|
|
147
147
|
});
|
|
148
148
|
const instance = tree.root;
|
|
149
149
|
const alertAction = instance.findByType(AlertAction);
|
|
@@ -153,7 +153,7 @@ describe('Test EditSubUnit', () => {
|
|
|
153
153
|
expect(mockedPop).not.toBeCalled();
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
it('alertAction rightButtonClick fail', async () => {
|
|
157
157
|
mock
|
|
158
158
|
.onDelete('https://backend.eoh.io/api/property_manager/1/sub_units/2/')
|
|
159
159
|
.reply(400);
|
|
@@ -162,8 +162,8 @@ describe('Test EditSubUnit', () => {
|
|
|
162
162
|
routes: [{ name: 'route 1' }, { name: 'route 2' }, { name: 'route 3' }],
|
|
163
163
|
}));
|
|
164
164
|
|
|
165
|
-
act(() => {
|
|
166
|
-
tree = create(wrapComponent(route));
|
|
165
|
+
await act(async () => {
|
|
166
|
+
tree = await create(wrapComponent(route));
|
|
167
167
|
});
|
|
168
168
|
const instance = tree.root;
|
|
169
169
|
const alertAction = instance.findByType(AlertAction);
|
|
@@ -179,9 +179,9 @@ describe('Test EditSubUnit', () => {
|
|
|
179
179
|
});
|
|
180
180
|
});
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
act(() => {
|
|
184
|
-
tree = create(wrapComponent(route));
|
|
182
|
+
it('alertAction leftButtonClick', async () => {
|
|
183
|
+
await act(async () => {
|
|
184
|
+
tree = await create(wrapComponent(route));
|
|
185
185
|
});
|
|
186
186
|
const instance = tree.root;
|
|
187
187
|
const alertAction = instance.findByType(AlertAction);
|
|
@@ -191,9 +191,9 @@ describe('Test EditSubUnit', () => {
|
|
|
191
191
|
expect(alertAction.props.visible).toEqual(false);
|
|
192
192
|
});
|
|
193
193
|
|
|
194
|
-
|
|
195
|
-
act(() => {
|
|
196
|
-
tree = create(wrapComponent(route));
|
|
194
|
+
it('alertAction hideModal', async () => {
|
|
195
|
+
await act(async () => {
|
|
196
|
+
tree = await create(wrapComponent(route));
|
|
197
197
|
});
|
|
198
198
|
const instance = tree.root;
|
|
199
199
|
const alertAction = instance.findByType(AlertAction);
|
|
@@ -203,9 +203,9 @@ describe('Test EditSubUnit', () => {
|
|
|
203
203
|
expect(alertAction.props.visible).toEqual(false);
|
|
204
204
|
});
|
|
205
205
|
|
|
206
|
-
|
|
207
|
-
act(() => {
|
|
208
|
-
tree = create(wrapComponent(route));
|
|
206
|
+
it('viewBottomButton onLeftClick', async () => {
|
|
207
|
+
await act(async () => {
|
|
208
|
+
tree = await create(wrapComponent(route));
|
|
209
209
|
});
|
|
210
210
|
const instance = tree.root;
|
|
211
211
|
const modal = instance.find(
|
|
@@ -229,13 +229,13 @@ describe('Test EditSubUnit', () => {
|
|
|
229
229
|
expect(modal.props.isVisible).toEqual(false);
|
|
230
230
|
});
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
it('viewBottomButton onRightClick success', async () => {
|
|
233
233
|
mock
|
|
234
234
|
.onPatch(API.SUB_UNIT.MANAGE_SUB_UNIT(1, 1))
|
|
235
235
|
.reply(200, { name: 'Station name' });
|
|
236
236
|
|
|
237
|
-
act(() => {
|
|
238
|
-
tree = create(wrapComponent(route));
|
|
237
|
+
await act(async () => {
|
|
238
|
+
tree = await create(wrapComponent(route));
|
|
239
239
|
});
|
|
240
240
|
const instance = tree.root;
|
|
241
241
|
const text = instance.find(
|
|
@@ -252,10 +252,10 @@ describe('Test EditSubUnit', () => {
|
|
|
252
252
|
expect(text.props.children).toEqual('Station name');
|
|
253
253
|
});
|
|
254
254
|
|
|
255
|
-
|
|
255
|
+
it('viewBottomButton onRightClick fail', async () => {
|
|
256
256
|
mock.onPatch(API.SUB_UNIT.MANAGE_SUB_UNIT(1, 2)).reply(200);
|
|
257
257
|
await act(async () => {
|
|
258
|
-
tree = create(wrapComponent(route));
|
|
258
|
+
tree = await create(wrapComponent(route));
|
|
259
259
|
});
|
|
260
260
|
const instance = tree.root;
|
|
261
261
|
const viewBottomButtons = instance.findAllByType(ViewButtonBottom);
|
|
@@ -268,9 +268,9 @@ describe('Test EditSubUnit', () => {
|
|
|
268
268
|
expect(Toast.show).not.toHaveBeenCalled();
|
|
269
269
|
});
|
|
270
270
|
|
|
271
|
-
|
|
272
|
-
act(() => {
|
|
273
|
-
tree = create(wrapComponent(route));
|
|
271
|
+
it('onPressRemove', async () => {
|
|
272
|
+
await act(async () => {
|
|
273
|
+
tree = await create(wrapComponent(route));
|
|
274
274
|
});
|
|
275
275
|
const instance = tree.root;
|
|
276
276
|
const button = instance.find(
|
|
@@ -282,28 +282,28 @@ describe('Test EditSubUnit', () => {
|
|
|
282
282
|
const alertAction = instance.findByType(AlertAction);
|
|
283
283
|
expect(alertAction.props.visible).toEqual(false);
|
|
284
284
|
|
|
285
|
-
act(() => {
|
|
285
|
+
await act(async () => {
|
|
286
286
|
button.props.onPress();
|
|
287
287
|
});
|
|
288
288
|
|
|
289
289
|
expect(alertAction.props.visible).toEqual(true);
|
|
290
290
|
});
|
|
291
291
|
|
|
292
|
-
|
|
293
|
-
act(() => {
|
|
294
|
-
tree = create(wrapComponent(route));
|
|
292
|
+
it('onChangeName', async () => {
|
|
293
|
+
await act(async () => {
|
|
294
|
+
tree = await create(wrapComponent(route));
|
|
295
295
|
});
|
|
296
296
|
const instance = tree.root;
|
|
297
297
|
const textInput = instance.findByType(_TextInput);
|
|
298
|
-
act(() => {
|
|
298
|
+
await act(async () => {
|
|
299
299
|
textInput.props.onChange('New sub-unit name');
|
|
300
300
|
});
|
|
301
301
|
// This dont have expect
|
|
302
302
|
});
|
|
303
303
|
|
|
304
|
-
|
|
305
|
-
act(() => {
|
|
306
|
-
tree = create(wrapComponent(route));
|
|
304
|
+
it('selectFile', async () => {
|
|
305
|
+
await act(async () => {
|
|
306
|
+
tree = await create(wrapComponent(route));
|
|
307
307
|
});
|
|
308
308
|
const instance = tree.root;
|
|
309
309
|
const button = instance.find(
|
|
@@ -314,19 +314,19 @@ describe('Test EditSubUnit', () => {
|
|
|
314
314
|
);
|
|
315
315
|
const imagePicker = instance.findByType(ImagePicker);
|
|
316
316
|
expect(imagePicker.props.showImagePicker).toEqual(false);
|
|
317
|
-
act(() => {
|
|
317
|
+
await act(async () => {
|
|
318
318
|
button.props.onPress();
|
|
319
319
|
});
|
|
320
320
|
expect(imagePicker.props.showImagePicker).toEqual(true);
|
|
321
321
|
});
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
it('setImage and updateBackground success', async () => {
|
|
324
324
|
mock
|
|
325
325
|
.onPatch(API.SUB_UNIT.MANAGE_SUB_UNIT(1, 1))
|
|
326
326
|
.reply(200, { name: 'Station name' });
|
|
327
327
|
|
|
328
|
-
act(() => {
|
|
329
|
-
tree = create(wrapComponent(route));
|
|
328
|
+
await act(async () => {
|
|
329
|
+
tree = await create(wrapComponent(route));
|
|
330
330
|
});
|
|
331
331
|
const instance = tree.root;
|
|
332
332
|
const imagePicker = instance.findByType(ImagePicker);
|
|
@@ -342,10 +342,10 @@ describe('Test EditSubUnit', () => {
|
|
|
342
342
|
});
|
|
343
343
|
});
|
|
344
344
|
|
|
345
|
-
|
|
345
|
+
it('setImage and updateBackground but fail', async () => {
|
|
346
346
|
mock.onPatch(API.SUB_UNIT.MANAGE_SUB_UNIT(1, 1)).reply(400);
|
|
347
|
-
act(() => {
|
|
348
|
-
tree = create(wrapComponent(route));
|
|
347
|
+
await act(async () => {
|
|
348
|
+
tree = await create(wrapComponent(route));
|
|
349
349
|
});
|
|
350
350
|
const instance = tree.root;
|
|
351
351
|
const imagePicker = instance.findByType(ImagePicker);
|
|
@@ -55,15 +55,15 @@ describe('Test ManageSubUnit', () => {
|
|
|
55
55
|
useState.mockImplementationOnce((init) => [data, mockSetState]);
|
|
56
56
|
useState.mockImplementationOnce((init) => [false, mockSetState]);
|
|
57
57
|
useState.mockImplementationOnce((init) => [false, mockSetState]);
|
|
58
|
-
await act(() => {
|
|
59
|
-
tree = create(wrapComponent(route));
|
|
58
|
+
await act(async () => {
|
|
59
|
+
tree = await create(wrapComponent(route));
|
|
60
60
|
});
|
|
61
61
|
const instance = tree.root;
|
|
62
62
|
const subUnitScrollViews = instance.findAllByType(ScrollView);
|
|
63
63
|
expect(subUnitScrollViews).toHaveLength(2);
|
|
64
64
|
const rowItem = instance.findAllByType(RowItem);
|
|
65
65
|
expect(rowItem).toHaveLength(1);
|
|
66
|
-
act(() => {
|
|
66
|
+
await act(async () => {
|
|
67
67
|
rowItem[0].props.onPress();
|
|
68
68
|
});
|
|
69
69
|
expect(mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
|
|
@@ -81,8 +81,8 @@ describe('Test ManageSubUnit', () => {
|
|
|
81
81
|
let route = {
|
|
82
82
|
params: { unit: { id: 1, name: 'unit 1' } },
|
|
83
83
|
};
|
|
84
|
-
await act(() => {
|
|
85
|
-
tree = create(wrapComponent(route));
|
|
84
|
+
await act(async () => {
|
|
85
|
+
tree = await create(wrapComponent(route));
|
|
86
86
|
});
|
|
87
87
|
const instance = tree.root;
|
|
88
88
|
const buttonAddSubUnit = instance.find(
|
|
@@ -90,7 +90,7 @@ describe('Test ManageSubUnit', () => {
|
|
|
90
90
|
el.props.accessibilityLabel === AccessibilityLabel.ADD_SUB_UNIT &&
|
|
91
91
|
el.type === TouchableOpacity
|
|
92
92
|
);
|
|
93
|
-
act(() => {
|
|
93
|
+
await act(async () => {
|
|
94
94
|
buttonAddSubUnit.props.onPress();
|
|
95
95
|
});
|
|
96
96
|
expect(mockedNavigate).toHaveBeenCalledWith(Routes.AddSubUnitStack, {
|
|
@@ -28,14 +28,14 @@ jest.mock('@react-navigation/native', () => {
|
|
|
28
28
|
describe('Test Manage Access', () => {
|
|
29
29
|
const unit = { id: 1, name: 'unit name' };
|
|
30
30
|
|
|
31
|
-
it('Test init', () => {
|
|
31
|
+
it('Test init', async () => {
|
|
32
32
|
const { result } = renderHook(() => useManageSubUnit(unit));
|
|
33
33
|
expect(result.current.stations).toEqual([]);
|
|
34
34
|
expect(result.current.isLoading).toBeFalsy();
|
|
35
35
|
expect(result.current.isRefreshing).toBeFalsy();
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
it('Test onRefresh', () => {
|
|
38
|
+
it('Test onRefresh', async () => {
|
|
39
39
|
const { result } = renderHook(() => useManageSubUnit(unit));
|
|
40
40
|
mock.onGet(API.UNIT.UNIT_DETAIL(unit?.id)).reply(200, [
|
|
41
41
|
{
|
|
@@ -71,16 +71,16 @@ describe('Test Manage Access', () => {
|
|
|
71
71
|
],
|
|
72
72
|
},
|
|
73
73
|
]);
|
|
74
|
-
act(() => {
|
|
74
|
+
await act(async () => {
|
|
75
75
|
result.current.onRefresh();
|
|
76
76
|
});
|
|
77
77
|
expect(result.current.isRefreshing).toBeFalsy();
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
it('Test get unit failure', () => {
|
|
80
|
+
it('Test get unit failure', async () => {
|
|
81
81
|
const { result } = renderHook(() => useManageSubUnit(unit));
|
|
82
82
|
mock.onGet(API.UNIT.UNIT_DETAIL(unit?.id)).reply(400);
|
|
83
|
-
act(() => {
|
|
83
|
+
await act(async () => {
|
|
84
84
|
result.current.onRefresh();
|
|
85
85
|
});
|
|
86
86
|
expect(result.current.isRefreshing).toBeFalsy();
|
|
@@ -62,7 +62,7 @@ describe('Test Add LG Device', () => {
|
|
|
62
62
|
return instance.find((el) => el.props.accessibilityLabel === id);
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
it('render', async () => {
|
|
66
66
|
await act(async () => {
|
|
67
67
|
tree = await create(wrapComponent(route));
|
|
68
68
|
});
|
|
@@ -84,7 +84,7 @@ describe('Test Add LG Device', () => {
|
|
|
84
84
|
expect(groupCheckBox[0].props.data).toEqual([]);
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
it('fetchDetails success', async () => {
|
|
88
88
|
const response = {
|
|
89
89
|
status: 200,
|
|
90
90
|
data: {
|
|
@@ -104,7 +104,7 @@ describe('Test Add LG Device', () => {
|
|
|
104
104
|
]);
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
it('fetchDetails fail', async () => {
|
|
108
108
|
mock.onGet(API.UNIT.UNIT_DETAIL(1)).reply(400);
|
|
109
109
|
await act(async () => {
|
|
110
110
|
tree = await create(wrapComponent(route));
|
|
@@ -120,7 +120,7 @@ describe('Test Add LG Device', () => {
|
|
|
120
120
|
]);
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
it('ViewButtonBottom', async () => {
|
|
124
124
|
await act(async () => {
|
|
125
125
|
tree = await create(wrapComponent(route));
|
|
126
126
|
});
|
|
@@ -135,7 +135,7 @@ describe('Test Add LG Device', () => {
|
|
|
135
135
|
);
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
it('ViewButtonBottom onLeftClick', async () => {
|
|
139
139
|
await act(async () => {
|
|
140
140
|
tree = await create(wrapComponent(route));
|
|
141
141
|
});
|
|
@@ -147,7 +147,7 @@ describe('Test Add LG Device', () => {
|
|
|
147
147
|
expect(mockedGoBack).toHaveBeenCalled();
|
|
148
148
|
});
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
it('ViewButtonBottom onRightClick without select stationId', async () => {
|
|
151
151
|
await act(async () => {
|
|
152
152
|
tree = await create(wrapComponent(route));
|
|
153
153
|
});
|
|
@@ -159,7 +159,7 @@ describe('Test Add LG Device', () => {
|
|
|
159
159
|
expect(mockedNavigate).toHaveBeenCalled();
|
|
160
160
|
});
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
it('ViewButtonBottom onRightClick with stationId', async () => {
|
|
163
163
|
const response = {
|
|
164
164
|
status: 200,
|
|
165
165
|
data: {
|
|
@@ -211,7 +211,7 @@ describe('Test Add LG Device', () => {
|
|
|
211
211
|
expect(mockedNavigate).toHaveBeenCalledWith(Routes.Dashboard);
|
|
212
212
|
});
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
it('ViewButtonBottom onRightClick with stationId but sync failed', async () => {
|
|
215
215
|
const response = {
|
|
216
216
|
status: 200,
|
|
217
217
|
data: {
|
|
@@ -257,7 +257,7 @@ describe('Test Add LG Device', () => {
|
|
|
257
257
|
expect(mockedNavigate).toHaveBeenCalledWith(Routes.Dashboard);
|
|
258
258
|
});
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
it('ViewButtonBottom onRightClick with stationId but get token failed, wrong data', async () => {
|
|
261
261
|
const response = {
|
|
262
262
|
status: 200,
|
|
263
263
|
data: {
|
|
@@ -303,7 +303,7 @@ describe('Test Add LG Device', () => {
|
|
|
303
303
|
spyToastSuccess.mockRestore();
|
|
304
304
|
});
|
|
305
305
|
|
|
306
|
-
|
|
306
|
+
it('ViewButtonBottom onRightClick with stationId but get token failed, not success', async () => {
|
|
307
307
|
const response = {
|
|
308
308
|
status: 200,
|
|
309
309
|
data: {
|
|
@@ -26,10 +26,10 @@ jest.mock('react', () => ({
|
|
|
26
26
|
}));
|
|
27
27
|
|
|
28
28
|
describe('Test TDS Guide', () => {
|
|
29
|
-
|
|
29
|
+
it('render tds guide', async () => {
|
|
30
30
|
let tree;
|
|
31
|
-
act(() => {
|
|
32
|
-
tree = create(wrapComponent());
|
|
31
|
+
await act(async () => {
|
|
32
|
+
tree = await create(wrapComponent());
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
const instance = tree.root;
|
|
@@ -26,10 +26,10 @@ jest.mock('react', () => ({
|
|
|
26
26
|
}));
|
|
27
27
|
|
|
28
28
|
describe('Test UV Index Guide', () => {
|
|
29
|
-
|
|
29
|
+
it('render UV Index Guide', async () => {
|
|
30
30
|
let tree;
|
|
31
|
-
act(() => {
|
|
32
|
-
tree = create(wrapComponent());
|
|
31
|
+
await act(async () => {
|
|
32
|
+
tree = await create(wrapComponent());
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
const instance = tree.root;
|
|
@@ -17,54 +17,10 @@ import WrapHeaderScrollable from '../../commons/Sharing/WrapHeaderScrollable';
|
|
|
17
17
|
|
|
18
18
|
import { useIsOwnerOfUnit } from '../../hooks/Common';
|
|
19
19
|
import { AccessibilityLabel } from '../../configs/Constants';
|
|
20
|
-
import { IconOutline } from '@ant-design/icons-react-native';
|
|
21
20
|
import styles from './ManageUnitStyles';
|
|
22
21
|
import { useNavigation } from '@react-navigation/native';
|
|
23
22
|
import { ModalCustom } from '../../commons/Modal';
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
const ButtonWrapper = ({
|
|
27
|
-
onPress,
|
|
28
|
-
testId,
|
|
29
|
-
title,
|
|
30
|
-
value,
|
|
31
|
-
valueColor,
|
|
32
|
-
children,
|
|
33
|
-
icon,
|
|
34
|
-
}) => {
|
|
35
|
-
return (
|
|
36
|
-
<TouchableOpacity
|
|
37
|
-
onPress={onPress}
|
|
38
|
-
accessibilityLabel={testId}
|
|
39
|
-
style={styles.buttonWrapper}
|
|
40
|
-
>
|
|
41
|
-
<View style={styles.buttonInfo}>
|
|
42
|
-
<Text type="H4" semibold>
|
|
43
|
-
{title}
|
|
44
|
-
</Text>
|
|
45
|
-
<View style={styles.buttonValue}>
|
|
46
|
-
{!icon ? (
|
|
47
|
-
<Text
|
|
48
|
-
type="Body"
|
|
49
|
-
color={valueColor || Colors.Gray7}
|
|
50
|
-
style={styles.value}
|
|
51
|
-
>
|
|
52
|
-
{value}
|
|
53
|
-
</Text>
|
|
54
|
-
) : value ? (
|
|
55
|
-
<Image source={{ uri: value }} style={styles.avatar} />
|
|
56
|
-
) : (
|
|
57
|
-
<View style={styles.avatar}>
|
|
58
|
-
<Icon name={'user'} size={27} />
|
|
59
|
-
</View>
|
|
60
|
-
)}
|
|
61
|
-
<IconOutline name="right" size={20} color={Colors.Gray7} />
|
|
62
|
-
</View>
|
|
63
|
-
</View>
|
|
64
|
-
{children}
|
|
65
|
-
</TouchableOpacity>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
23
|
+
import ButtonWrapper from './components/ButtonWrapper';
|
|
68
24
|
|
|
69
25
|
const ManageUnit = ({ route }) => {
|
|
70
26
|
const t = useTranslations();
|
|
@@ -229,6 +185,8 @@ const ManageUnit = ({ route }) => {
|
|
|
229
185
|
accessibilityLabel={AccessibilityLabel.MANAGE_UNIT_CHANGE_NAME}
|
|
230
186
|
title={t('unit_name')}
|
|
231
187
|
value={unitData.name}
|
|
188
|
+
styleTitle={styles.titleButton}
|
|
189
|
+
styleValue={styles.valueButton}
|
|
232
190
|
/>
|
|
233
191
|
<ButtonWrapper
|
|
234
192
|
onPress={goSelectLocation}
|
|
@@ -312,6 +270,7 @@ const ManageUnit = ({ route }) => {
|
|
|
312
270
|
</Text>
|
|
313
271
|
</View>
|
|
314
272
|
<_TextInput
|
|
273
|
+
maxLength={50}
|
|
315
274
|
defaultValue={unitData?.name}
|
|
316
275
|
onChange={(value) => setUnitName(value)}
|
|
317
276
|
textInputStyle={styles.textInputStyle}
|