@eohjsc/react-native-smart-city 0.3.36 → 0.3.37
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 +90 -1
- 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 +5 -0
- 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/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/ConnectingWifiGuide.js +2 -2
- package/src/screens/AddNewGateway/ConnectingZigbeeDevice.js +3 -2
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +5 -5
- 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 +1 -1
- package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +9 -9
- package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +1 -1
- 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 +4 -4
- 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 +41 -41
- 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/ListDevice/__test__/DeviceItem.test.js +3 -3
- package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +13 -21
- package/src/screens/SmartAccount/ListDevice/index.js +1 -0
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/DeviceItem.test.js +6 -6
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +6 -5
- package/src/screens/SmartAccount/SuccessfullyConnected/index.js +1 -0
- package/src/screens/SmartAccount/__test__/Connecting.test.js +4 -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 +24 -24
- 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/WaterQualityGuide/__test__/index.test.js +12 -12
- package/src/utils/Apis/axios.js +22 -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 +2 -2
- 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/UnitSummary/components/PowerConsumeHistoryChart/__test__/index.test.js +0 -63
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/index.js +0 -53
|
@@ -108,7 +108,7 @@ describe('Test SelectAddress', () => {
|
|
|
108
108
|
mock.resetHistory();
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
it('test not do anything then click done', async () => {
|
|
112
112
|
await act(async () => {
|
|
113
113
|
tree = await create(wrapComponent(route));
|
|
114
114
|
});
|
|
@@ -121,7 +121,7 @@ describe('Test SelectAddress', () => {
|
|
|
121
121
|
expect(mockGoBack).not.toBeCalled();
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
it('test search location', async () => {
|
|
125
125
|
await act(async () => {
|
|
126
126
|
tree = await create(wrapComponent(route));
|
|
127
127
|
});
|
|
@@ -178,7 +178,7 @@ describe('Test SelectAddress', () => {
|
|
|
178
178
|
expect(mockGoBack).toBeCalled();
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
it('test get lat lng of location failed', async () => {
|
|
182
182
|
await act(async () => {
|
|
183
183
|
tree = await create(wrapComponent(route));
|
|
184
184
|
});
|
|
@@ -224,7 +224,7 @@ describe('Test SelectAddress', () => {
|
|
|
224
224
|
});
|
|
225
225
|
});
|
|
226
226
|
|
|
227
|
-
|
|
227
|
+
it('test get current location success', async () => {
|
|
228
228
|
await act(async () => {
|
|
229
229
|
tree = await create(wrapComponent(route));
|
|
230
230
|
});
|
|
@@ -258,7 +258,7 @@ describe('Test SelectAddress', () => {
|
|
|
258
258
|
});
|
|
259
259
|
});
|
|
260
260
|
|
|
261
|
-
|
|
261
|
+
it('test get current location success get location name failed', async () => {
|
|
262
262
|
await act(async () => {
|
|
263
263
|
tree = await create(wrapComponent(route));
|
|
264
264
|
});
|
|
@@ -287,7 +287,7 @@ describe('Test SelectAddress', () => {
|
|
|
287
287
|
expect(mockGoBack).toBeCalled();
|
|
288
288
|
});
|
|
289
289
|
|
|
290
|
-
|
|
290
|
+
it('test get current location failed permission denied', async () => {
|
|
291
291
|
await act(async () => {
|
|
292
292
|
tree = await create(wrapComponent(route));
|
|
293
293
|
});
|
|
@@ -311,7 +311,7 @@ describe('Test SelectAddress', () => {
|
|
|
311
311
|
OpenSetting.mockClear();
|
|
312
312
|
});
|
|
313
313
|
|
|
314
|
-
|
|
314
|
+
it('test get current location failed location not enabled android', async () => {
|
|
315
315
|
Platform.OS = 'android';
|
|
316
316
|
await act(async () => {
|
|
317
317
|
tree = await create(wrapComponent(route));
|
|
@@ -355,7 +355,7 @@ describe('Test SelectAddress', () => {
|
|
|
355
355
|
).toBeCalled();
|
|
356
356
|
});
|
|
357
357
|
|
|
358
|
-
|
|
358
|
+
it('test get current location failed location not enabled ios', async () => {
|
|
359
359
|
Platform.OS = 'ios';
|
|
360
360
|
jest.spyOn(Alert, 'alert');
|
|
361
361
|
|
|
@@ -380,7 +380,7 @@ describe('Test SelectAddress', () => {
|
|
|
380
380
|
// expect AlertAsync is called
|
|
381
381
|
});
|
|
382
382
|
|
|
383
|
-
|
|
383
|
+
it('test get current location failed error not handle', async () => {
|
|
384
384
|
await act(async () => {
|
|
385
385
|
tree = await create(wrapComponent(route));
|
|
386
386
|
});
|
|
@@ -405,7 +405,7 @@ describe('Test SelectAddress', () => {
|
|
|
405
405
|
OpenSetting.mockClear();
|
|
406
406
|
});
|
|
407
407
|
|
|
408
|
-
|
|
408
|
+
it('test choose on map', async () => {
|
|
409
409
|
await act(async () => {
|
|
410
410
|
tree = await create(wrapComponent(route));
|
|
411
411
|
});
|
|
@@ -72,7 +72,7 @@ describe('Test SmartAccount', () => {
|
|
|
72
72
|
mock.resetHistory();
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
it('test render SmartAccount', async () => {
|
|
76
76
|
mock
|
|
77
77
|
.onGet(API.SMART_ACCOUNT.LIST_SMART_ACCOUNT(1))
|
|
78
78
|
.reply(response.status, response.data);
|
|
@@ -83,7 +83,7 @@ describe('Test SmartAccount', () => {
|
|
|
83
83
|
|
|
84
84
|
const smartAccountItem = instance.findAllByType(SmartAccountItem);
|
|
85
85
|
expect(smartAccountItem.length).toEqual(3);
|
|
86
|
-
act(() => {
|
|
86
|
+
await act(async () => {
|
|
87
87
|
smartAccountItem[0].props.gotoSmartAccountDetail(response.data[0]);
|
|
88
88
|
smartAccountItem[0].props.onShowMenuMore('ref', response.data[0]);
|
|
89
89
|
});
|
|
@@ -113,7 +113,7 @@ describe('Test SmartAccount', () => {
|
|
|
113
113
|
expect(menuActionMore.props.isVisible).toEqual(true);
|
|
114
114
|
});
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
it('test render SmartAccountItem', async () => {
|
|
117
117
|
await act(async () => {
|
|
118
118
|
tree = await renderer.create(wrapComponent());
|
|
119
119
|
});
|
|
@@ -125,7 +125,7 @@ describe('Test SmartAccount', () => {
|
|
|
125
125
|
expect(menuActionMore.props.isVisible).toEqual(false);
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
it('test render AlertAction', async () => {
|
|
129
129
|
await act(async () => {
|
|
130
130
|
tree = await renderer.create(wrapComponent());
|
|
131
131
|
});
|
|
@@ -39,7 +39,7 @@ jest.mock('react', () => {
|
|
|
39
39
|
|
|
40
40
|
describe('Test SmartAccountItem', () => {
|
|
41
41
|
let tree;
|
|
42
|
-
|
|
42
|
+
it('test render SmartAccountItem', async () => {
|
|
43
43
|
await act(async () => {
|
|
44
44
|
tree = await renderer.create(wrapComponent());
|
|
45
45
|
});
|
|
@@ -60,7 +60,7 @@ describe('Test Summaries', () => {
|
|
|
60
60
|
};
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
it('render Summaries receive noti with summary_id then reload', async () => {
|
|
64
64
|
mock.onGet(API.UNIT.UNIT_SUMMARY(1)).reply(200, [{ id: 1 }]);
|
|
65
65
|
const dataNotification = {
|
|
66
66
|
params: {
|
|
@@ -83,7 +83,7 @@ describe('Test Summaries', () => {
|
|
|
83
83
|
expect(mockedNavigate).toBeCalled();
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
it('render Summaries receive noti with summary_id then not reload', async () => {
|
|
87
87
|
mock.onGet(API.UNIT.UNIT_SUMMARY(1)).reply(200, [{ id: 1 }]);
|
|
88
88
|
const dataNotification = {
|
|
89
89
|
params: {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { View, TouchableOpacity, Image } from 'react-native';
|
|
3
|
+
import Text from '../../../../commons/Text';
|
|
4
|
+
import { Colors } from '../../../../configs';
|
|
5
|
+
import { Icon } from '@ant-design/react-native';
|
|
6
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
7
|
+
import { AccessibilityLabel } from '../../../../configs/Constants';
|
|
8
|
+
import styles from './styles';
|
|
9
|
+
|
|
10
|
+
const ButtonWrapper = ({
|
|
11
|
+
onPress,
|
|
12
|
+
accessibilityLabel,
|
|
13
|
+
title,
|
|
14
|
+
value,
|
|
15
|
+
valueColor,
|
|
16
|
+
children,
|
|
17
|
+
icon,
|
|
18
|
+
styleTitle,
|
|
19
|
+
styleValue,
|
|
20
|
+
}) => {
|
|
21
|
+
return (
|
|
22
|
+
<TouchableOpacity
|
|
23
|
+
onPress={onPress}
|
|
24
|
+
accessibilityLabel={
|
|
25
|
+
accessibilityLabel
|
|
26
|
+
? accessibilityLabel
|
|
27
|
+
: AccessibilityLabel.BUTTON_WRAPPER
|
|
28
|
+
}
|
|
29
|
+
style={styles.buttonWrapper}
|
|
30
|
+
>
|
|
31
|
+
<View style={styles.buttonInfo}>
|
|
32
|
+
<View style={styleTitle}>
|
|
33
|
+
<Text type="H4" semibold>
|
|
34
|
+
{title}
|
|
35
|
+
</Text>
|
|
36
|
+
</View>
|
|
37
|
+
<View style={[styles.buttonValue, styleValue]}>
|
|
38
|
+
{!icon ? (
|
|
39
|
+
<Text
|
|
40
|
+
type="Body"
|
|
41
|
+
color={valueColor || Colors.Gray7}
|
|
42
|
+
style={styles.value}
|
|
43
|
+
>
|
|
44
|
+
{value}
|
|
45
|
+
</Text>
|
|
46
|
+
) : value ? (
|
|
47
|
+
<Image source={{ uri: value }} style={styles.avatar} />
|
|
48
|
+
) : (
|
|
49
|
+
<View style={styles.avatar}>
|
|
50
|
+
<Icon name={'user'} size={27} />
|
|
51
|
+
</View>
|
|
52
|
+
)}
|
|
53
|
+
<IconOutline name="right" size={20} color={Colors.Gray7} />
|
|
54
|
+
</View>
|
|
55
|
+
</View>
|
|
56
|
+
{children}
|
|
57
|
+
</TouchableOpacity>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
export default memo(ButtonWrapper);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { Colors } from '../../../../configs';
|
|
3
|
+
|
|
4
|
+
export default StyleSheet.create({
|
|
5
|
+
buttonWrapper: {
|
|
6
|
+
paddingTop: 24,
|
|
7
|
+
paddingBottom: 24,
|
|
8
|
+
borderBottomWidth: 0.5,
|
|
9
|
+
borderBottomColor: Colors.Gray6,
|
|
10
|
+
},
|
|
11
|
+
buttonInfo: {
|
|
12
|
+
flex: 1,
|
|
13
|
+
flexDirection: 'row',
|
|
14
|
+
justifyContent: 'space-between',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
},
|
|
17
|
+
buttonValue: {
|
|
18
|
+
flex: 1,
|
|
19
|
+
flexDirection: 'row',
|
|
20
|
+
justifyContent: 'flex-end',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
},
|
|
23
|
+
value: {
|
|
24
|
+
marginRight: 20,
|
|
25
|
+
fontSize: 14,
|
|
26
|
+
},
|
|
27
|
+
avatar: {
|
|
28
|
+
height: 50,
|
|
29
|
+
width: 50,
|
|
30
|
+
borderRadius: 25,
|
|
31
|
+
borderWidth: 0.5,
|
|
32
|
+
borderColor: Colors.Gray5,
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
marginRight: 20,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
@@ -36,9 +36,9 @@ describe('Test HeaderUnit', () => {
|
|
|
36
36
|
});
|
|
37
37
|
let tree;
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
act(() => {
|
|
41
|
-
tree = create(<HeaderUnit {...data} />);
|
|
39
|
+
it('onBack', async () => {
|
|
40
|
+
await act(async () => {
|
|
41
|
+
tree = await create(<HeaderUnit {...data} />);
|
|
42
42
|
});
|
|
43
43
|
const instance = tree.root;
|
|
44
44
|
const button = instance.find(
|
|
@@ -47,16 +47,16 @@ describe('Test HeaderUnit', () => {
|
|
|
47
47
|
AccessibilityLabel.HEADER_UNIT_BUTTON_BACK &&
|
|
48
48
|
el.type === TouchableOpacity
|
|
49
49
|
);
|
|
50
|
-
act(() => {
|
|
50
|
+
await act(async () => {
|
|
51
51
|
button.props.onPress();
|
|
52
52
|
});
|
|
53
53
|
expect(mockOnBack).toHaveBeenCalledTimes(1);
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
it('goBack', async () => {
|
|
57
57
|
data.onBack = undefined;
|
|
58
|
-
act(() => {
|
|
59
|
-
tree = create(<HeaderUnit {...data} />);
|
|
58
|
+
await act(async () => {
|
|
59
|
+
tree = await create(<HeaderUnit {...data} />);
|
|
60
60
|
});
|
|
61
61
|
const instance = tree.root;
|
|
62
62
|
const button = instance.find(
|
|
@@ -65,15 +65,15 @@ describe('Test HeaderUnit', () => {
|
|
|
65
65
|
AccessibilityLabel.HEADER_UNIT_BUTTON_BACK &&
|
|
66
66
|
el.type === TouchableOpacity
|
|
67
67
|
);
|
|
68
|
-
act(() => {
|
|
68
|
+
await act(async () => {
|
|
69
69
|
button.props.onPress();
|
|
70
70
|
});
|
|
71
71
|
expect(mockGoBack).toHaveBeenCalledTimes(1);
|
|
72
72
|
});
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
act(() => {
|
|
76
|
-
tree = create(<HeaderUnit {...data} />);
|
|
74
|
+
it('onAdd', async () => {
|
|
75
|
+
await act(async () => {
|
|
76
|
+
tree = await create(<HeaderUnit {...data} />);
|
|
77
77
|
});
|
|
78
78
|
const instance = tree.root;
|
|
79
79
|
const button = instance.find(
|
|
@@ -82,15 +82,15 @@ describe('Test HeaderUnit', () => {
|
|
|
82
82
|
AccessibilityLabel.HEADER_UNIT_BUTTON_ADD &&
|
|
83
83
|
el.type === TouchableOpacity
|
|
84
84
|
);
|
|
85
|
-
act(() => {
|
|
85
|
+
await act(async () => {
|
|
86
86
|
button.props.onPress();
|
|
87
87
|
});
|
|
88
88
|
expect(mockOnAdd).toHaveBeenCalledTimes(1);
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
act(() => {
|
|
93
|
-
tree = create(<HeaderUnit {...data} />);
|
|
91
|
+
it('onMore', async () => {
|
|
92
|
+
await act(async () => {
|
|
93
|
+
tree = await create(<HeaderUnit {...data} />);
|
|
94
94
|
});
|
|
95
95
|
const instance = tree.root;
|
|
96
96
|
const button = instance.find(
|
|
@@ -99,16 +99,16 @@ describe('Test HeaderUnit', () => {
|
|
|
99
99
|
AccessibilityLabel.HEADER_UNIT_BUTTON_MORE &&
|
|
100
100
|
el.type === TouchableOpacity
|
|
101
101
|
);
|
|
102
|
-
act(() => {
|
|
102
|
+
await act(async () => {
|
|
103
103
|
button.props.onPress();
|
|
104
104
|
});
|
|
105
105
|
expect(mockOnMore).toHaveBeenCalledTimes(1);
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
it('transparent', async () => {
|
|
109
109
|
data.transparent = true;
|
|
110
|
-
act(() => {
|
|
111
|
-
tree = create(<HeaderUnit {...data} />);
|
|
110
|
+
await act(async () => {
|
|
111
|
+
tree = await create(<HeaderUnit {...data} />);
|
|
112
112
|
});
|
|
113
113
|
const instance = tree.root;
|
|
114
114
|
const iconPlus = instance.findByProps({ name: 'plus' });
|
|
@@ -12,7 +12,7 @@ const wrapComponent = (route) => (
|
|
|
12
12
|
);
|
|
13
13
|
describe('Test MyAllUnit', () => {
|
|
14
14
|
let tree;
|
|
15
|
-
|
|
15
|
+
it('render MyAllUnit', async () => {
|
|
16
16
|
const route = {
|
|
17
17
|
params: {
|
|
18
18
|
myUnits: [
|
|
@@ -26,8 +26,8 @@ describe('Test MyAllUnit', () => {
|
|
|
26
26
|
],
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
|
-
act(() => {
|
|
30
|
-
tree = create(wrapComponent(route));
|
|
29
|
+
await act(async () => {
|
|
30
|
+
tree = await create(wrapComponent(route));
|
|
31
31
|
});
|
|
32
32
|
const instance = tree.root;
|
|
33
33
|
const safeAreaView = instance.findAllByType(SafeAreaView);
|
|
@@ -11,7 +11,7 @@ const wrapComponent = (props) => (
|
|
|
11
11
|
</SCProvider>
|
|
12
12
|
);
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
it('test MyAllUnit', async () => {
|
|
15
15
|
let tree, props;
|
|
16
16
|
let mockGoBack = jest.fn();
|
|
17
17
|
|
|
@@ -41,13 +41,13 @@ test('test MyAllUnit', () => {
|
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
act(() => {
|
|
45
|
-
tree = create(wrapComponent(props));
|
|
44
|
+
await act(async () => {
|
|
45
|
+
tree = await create(wrapComponent(props));
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
const instance = tree.root;
|
|
49
49
|
const header = instance.findByType(Header);
|
|
50
|
-
act(() => {
|
|
50
|
+
await act(async () => {
|
|
51
51
|
header.props.goBack();
|
|
52
52
|
});
|
|
53
53
|
expect(mockGoBack).toBeCalled();
|
|
@@ -31,51 +31,51 @@ jest.mock('@react-navigation/native', () => {
|
|
|
31
31
|
|
|
32
32
|
describe('Test Header', () => {
|
|
33
33
|
let tree;
|
|
34
|
-
|
|
35
|
-
act(() => {
|
|
34
|
+
it('test hideModal', async () => {
|
|
35
|
+
await act(async () => {
|
|
36
36
|
tree = renderer.create(wrapComponent());
|
|
37
37
|
});
|
|
38
38
|
const instance = tree.root;
|
|
39
39
|
const modal = instance.findAllByType(Modal);
|
|
40
|
-
act(() => {
|
|
40
|
+
await act(async () => {
|
|
41
41
|
modal[0].props.onBackButtonPress();
|
|
42
42
|
});
|
|
43
43
|
expect(modal[0].props.isVisible).toBe(false);
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
act(() => {
|
|
46
|
+
it('test onItemClick', async () => {
|
|
47
|
+
await act(async () => {
|
|
48
48
|
tree = renderer.create(wrapComponent());
|
|
49
49
|
});
|
|
50
50
|
const instance = tree.root;
|
|
51
51
|
const modal = instance.findAllByType(Modal);
|
|
52
52
|
const imageButton = instance.findByType(ImageButton);
|
|
53
|
-
act(() => {
|
|
53
|
+
await act(async () => {
|
|
54
54
|
imageButton.props.onPress(Routes.Sharing);
|
|
55
55
|
});
|
|
56
56
|
expect(modal[0].props.isVisible).toBe(false);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
act(() => {
|
|
59
|
+
it('test Popover Close Menu', async () => {
|
|
60
|
+
await act(async () => {
|
|
61
61
|
tree = renderer.create(wrapComponent());
|
|
62
62
|
});
|
|
63
63
|
const instance = tree.root;
|
|
64
64
|
const popover = instance.findByType(Popover);
|
|
65
|
-
act(() => {
|
|
65
|
+
await act(async () => {
|
|
66
66
|
popover.props.onRequestClose();
|
|
67
67
|
});
|
|
68
68
|
expect(popover.props.isVisible).toBe(false);
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
act(() => {
|
|
71
|
+
it('test onpress touchableOpacity', async () => {
|
|
72
|
+
await act(async () => {
|
|
73
73
|
tree = renderer.create(wrapComponent());
|
|
74
74
|
});
|
|
75
75
|
const instance = tree.root;
|
|
76
76
|
const touchableOpacity = instance.findAllByType(TouchableOpacity);
|
|
77
77
|
|
|
78
|
-
act(() => {
|
|
78
|
+
await act(async () => {
|
|
79
79
|
touchableOpacity[0].props.onPress();
|
|
80
80
|
touchableOpacity[1].props.onPress();
|
|
81
81
|
touchableOpacity[2].props.onPress();
|
|
@@ -55,8 +55,8 @@ describe('Test MyUnitDevice', () => {
|
|
|
55
55
|
|
|
56
56
|
it('Test render without status', async () => {
|
|
57
57
|
props.device.status = undefined;
|
|
58
|
-
await act(() => {
|
|
59
|
-
tree = create(wrapComponent(props));
|
|
58
|
+
await act(async () => {
|
|
59
|
+
tree = await create(wrapComponent(props));
|
|
60
60
|
});
|
|
61
61
|
const instance = tree.root;
|
|
62
62
|
const Views = instance.findAllByType(View);
|
|
@@ -55,7 +55,7 @@ describe('Test SharedUnit', () => {
|
|
|
55
55
|
user: 1,
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
it('test create SharedUnit unit is not pin, not star', async () => {
|
|
59
59
|
const navigation = useNavigation();
|
|
60
60
|
mock.onPost(API.UNIT.PIN_UNIT(3)).reply(200);
|
|
61
61
|
mock.onPost(API.UNIT.STAR_UNIT(3)).reply(200);
|
|
@@ -67,7 +67,7 @@ describe('Test SharedUnit', () => {
|
|
|
67
67
|
(el) =>
|
|
68
68
|
el.props.accessibilityLabel === AccessibilityLabel.TOUCH_SHARED_UNIT
|
|
69
69
|
);
|
|
70
|
-
act(() => {
|
|
70
|
+
await act(async () => {
|
|
71
71
|
touchSharedUnit.props.onPress();
|
|
72
72
|
});
|
|
73
73
|
expect(mockNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
|
|
@@ -87,7 +87,7 @@ describe('Test SharedUnit', () => {
|
|
|
87
87
|
el.props.accessibilityLabel ===
|
|
88
88
|
AccessibilityLabel.ICON_ADD_PIN_SHARED_UNIT
|
|
89
89
|
);
|
|
90
|
-
act(() => {
|
|
90
|
+
await act(async () => {
|
|
91
91
|
iconAddPinSharedUnit.props.onPress();
|
|
92
92
|
});
|
|
93
93
|
const iconAddStarSharedUnit = instance.find(
|
|
@@ -95,13 +95,13 @@ describe('Test SharedUnit', () => {
|
|
|
95
95
|
el.props.accessibilityLabel ===
|
|
96
96
|
AccessibilityLabel.ICON_ADD_STAR_SHARED_UNIT
|
|
97
97
|
);
|
|
98
|
-
act(() => {
|
|
98
|
+
await act(async () => {
|
|
99
99
|
iconAddStarSharedUnit.props.onPress();
|
|
100
100
|
});
|
|
101
101
|
expect(iconRemovePinSharedUnit).toHaveLength(0);
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
it('test create SharedUnit unit is pin, is star', async () => {
|
|
105
105
|
const navigation = useNavigation();
|
|
106
106
|
item.is_pin = true;
|
|
107
107
|
item.is_star = true;
|
|
@@ -127,7 +127,7 @@ describe('Test SharedUnit', () => {
|
|
|
127
127
|
expect(mockRenewItem).toBeCalled();
|
|
128
128
|
});
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
it('test create SharedUnit unit is pin, is star with call api failure', async () => {
|
|
131
131
|
const navigation = useNavigation();
|
|
132
132
|
item.is_pin = true;
|
|
133
133
|
item.is_star = true;
|
|
@@ -76,36 +76,36 @@ describe('Test UnitSummary', () => {
|
|
|
76
76
|
});
|
|
77
77
|
let tree;
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
it('onRefresh', async () => {
|
|
80
80
|
mock.onGet(API.UNIT.UNIT_SUMMARY_DETAIL(1, 1)).reply(200);
|
|
81
|
-
act(() => {
|
|
82
|
-
tree = create(wrapComponent(route));
|
|
81
|
+
await act(async () => {
|
|
82
|
+
tree = await create(wrapComponent(route));
|
|
83
83
|
});
|
|
84
84
|
const instance = tree.root;
|
|
85
85
|
const refreshControl = instance.findByType(RefreshControl);
|
|
86
|
-
act(() => {
|
|
86
|
+
await act(async () => {
|
|
87
87
|
refreshControl.props.onRefresh();
|
|
88
88
|
});
|
|
89
89
|
expect(refreshControl).toBeDefined();
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
mock.onGet(API.UNIT.UNIT_SUMMARY_DETAIL(1, 1)).reply(
|
|
94
|
-
act(() => {
|
|
95
|
-
tree = create(wrapComponent(route));
|
|
92
|
+
it('render fetchSummaryDetail failed', async () => {
|
|
93
|
+
mock.onGet(API.UNIT.UNIT_SUMMARY_DETAIL(1, 1)).reply(400, {});
|
|
94
|
+
await act(async () => {
|
|
95
|
+
tree = await create(wrapComponent(route));
|
|
96
96
|
});
|
|
97
97
|
const instance = tree.root;
|
|
98
98
|
const refreshControl = instance.findByType(RefreshControl);
|
|
99
99
|
expect(refreshControl).toBeDefined();
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
it('render fetchSummaryDetail success', async () => {
|
|
103
103
|
jest.useFakeTimers();
|
|
104
104
|
mock.onGet(API.UNIT.UNIT_SUMMARY_DETAIL(1, 1)).reply(200);
|
|
105
|
-
act(() => {
|
|
106
|
-
tree = create(wrapComponent(route));
|
|
105
|
+
await act(async () => {
|
|
106
|
+
tree = await create(wrapComponent(route));
|
|
107
107
|
});
|
|
108
|
-
act(() => {
|
|
108
|
+
await act(async () => {
|
|
109
109
|
jest.runOnlyPendingTimers();
|
|
110
110
|
});
|
|
111
111
|
const instance = tree.root;
|
|
@@ -113,7 +113,7 @@ describe('Test UnitSummary', () => {
|
|
|
113
113
|
expect(refreshControl).toBeDefined();
|
|
114
114
|
});
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
it('render fetchUnitDetail success', async () => {
|
|
117
117
|
route = {
|
|
118
118
|
params: {
|
|
119
119
|
unitId: 1,
|
|
@@ -127,10 +127,10 @@ describe('Test UnitSummary', () => {
|
|
|
127
127
|
};
|
|
128
128
|
jest.useFakeTimers();
|
|
129
129
|
mock.onGet(API.UNIT.UNIT_DETAIL(1)).reply(200, {});
|
|
130
|
-
act(() => {
|
|
131
|
-
tree = create(wrapComponent(route));
|
|
130
|
+
await act(async () => {
|
|
131
|
+
tree = await create(wrapComponent(route));
|
|
132
132
|
});
|
|
133
|
-
act(() => {
|
|
133
|
+
await act(async () => {
|
|
134
134
|
jest.runOnlyPendingTimers();
|
|
135
135
|
});
|
|
136
136
|
const instance = tree.root;
|
|
@@ -138,7 +138,7 @@ describe('Test UnitSummary', () => {
|
|
|
138
138
|
expect(refreshControl).toBeDefined();
|
|
139
139
|
});
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
it('test receive notification with summary_id then reload data', async () => {
|
|
142
142
|
jest.useFakeTimers();
|
|
143
143
|
mock.onGet(API.UNIT.UNIT_SUMMARY_DETAIL(1, 1)).reply(200);
|
|
144
144
|
const dataNotification = {
|
|
@@ -149,15 +149,15 @@ describe('Test UnitSummary', () => {
|
|
|
149
149
|
useReceiveNotifications.mockImplementationOnce(() => ({
|
|
150
150
|
dataNotification,
|
|
151
151
|
}));
|
|
152
|
-
act(() => {
|
|
153
|
-
tree = create(wrapComponent(route));
|
|
152
|
+
await act(async () => {
|
|
153
|
+
tree = await create(wrapComponent(route));
|
|
154
154
|
});
|
|
155
|
-
act(() => {
|
|
155
|
+
await act(async () => {
|
|
156
156
|
jest.runOnlyPendingTimers();
|
|
157
157
|
});
|
|
158
158
|
});
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
it('test receive notification with other summary_id then not reload data', async () => {
|
|
161
161
|
jest.useFakeTimers();
|
|
162
162
|
mock.onGet(API.UNIT.UNIT_SUMMARY_DETAIL(1, 1)).reply(200);
|
|
163
163
|
const dataNotification = {
|
|
@@ -168,10 +168,10 @@ describe('Test UnitSummary', () => {
|
|
|
168
168
|
useReceiveNotifications.mockImplementationOnce(() => ({
|
|
169
169
|
dataNotification,
|
|
170
170
|
}));
|
|
171
|
-
act(() => {
|
|
172
|
-
tree = create(wrapComponent(route));
|
|
171
|
+
await act(async () => {
|
|
172
|
+
tree = await create(wrapComponent(route));
|
|
173
173
|
});
|
|
174
|
-
act(() => {
|
|
174
|
+
await act(async () => {
|
|
175
175
|
jest.runOnlyPendingTimers();
|
|
176
176
|
});
|
|
177
177
|
});
|
package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js
CHANGED
|
@@ -28,7 +28,7 @@ const wrapComponent = (summaryDetail) => (
|
|
|
28
28
|
describe('Test 3PPowerConsumption', () => {
|
|
29
29
|
let tree;
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
it('render 3PPowerConsumption', async () => {
|
|
32
32
|
const summaryDetail = {
|
|
33
33
|
volt1Value: 200,
|
|
34
34
|
current1Value: 20,
|
|
@@ -37,7 +37,7 @@ describe('Test 3PPowerConsumption', () => {
|
|
|
37
37
|
totalPowerValue: 20,
|
|
38
38
|
listConfigs: [1, 2, 3],
|
|
39
39
|
};
|
|
40
|
-
act(() => {
|
|
40
|
+
await act(async () => {
|
|
41
41
|
tree = renderer.create(wrapComponent(summaryDetail));
|
|
42
42
|
});
|
|
43
43
|
const instance = tree.root;
|
|
@@ -80,7 +80,7 @@ describe('Test 3PPowerConsumption', () => {
|
|
|
80
80
|
expect(listIndicator.props.data).toEqual(resultList);
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
it('render 3PPowerConsumption with total_power', async () => {
|
|
84
84
|
mock.onGet(API.VALUE_CONSUME.DISPLAY_HISTORY()).reply(200, [{}]);
|
|
85
85
|
const summaryDetail = {
|
|
86
86
|
volt1Value: 200,
|
|
@@ -4,12 +4,12 @@ import Text from '../../../../../commons/Text';
|
|
|
4
4
|
import ItemPower from '../ItemPower';
|
|
5
5
|
|
|
6
6
|
describe('test ItemPower', () => {
|
|
7
|
-
|
|
7
|
+
it('render', async () => {
|
|
8
8
|
let tree;
|
|
9
9
|
let data = { svg: '', title: 'Title item', des: '', time: '', value: '' };
|
|
10
10
|
|
|
11
|
-
act(() => {
|
|
12
|
-
tree = create(<ItemPower {...data} />);
|
|
11
|
+
await act(async () => {
|
|
12
|
+
tree = await create(<ItemPower {...data} />);
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
const instance = tree.root;
|