@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
|
@@ -195,7 +195,7 @@ describe('test DeviceDetail', () => {
|
|
|
195
195
|
],
|
|
196
196
|
side_menu_items: [{ id: 1, order: 1, name: 'Setup generate passcode' }],
|
|
197
197
|
};
|
|
198
|
-
|
|
198
|
+
it('render DeviceDetail render SensorDisplayItem', async () => {
|
|
199
199
|
const responseDisplay = {
|
|
200
200
|
status: 200,
|
|
201
201
|
data: data_sensor_display,
|
|
@@ -263,7 +263,7 @@ describe('test DeviceDetail', () => {
|
|
|
263
263
|
});
|
|
264
264
|
});
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
it('AlertSendConfirm onSendNowAlert', async () => {
|
|
267
267
|
await act(async () => {
|
|
268
268
|
tree = await create(wrapComponent(store, account, route));
|
|
269
269
|
});
|
|
@@ -288,7 +288,7 @@ describe('test DeviceDetail', () => {
|
|
|
288
288
|
expect(alertSent.props.showAlertSent).toEqual(false);
|
|
289
289
|
});
|
|
290
290
|
|
|
291
|
-
|
|
291
|
+
it('ButtonPopup onClick', async () => {
|
|
292
292
|
await act(async () => {
|
|
293
293
|
tree = await create(wrapComponent(store, account, route));
|
|
294
294
|
});
|
|
@@ -314,7 +314,7 @@ describe('test DeviceDetail', () => {
|
|
|
314
314
|
expect(buttonPopup.props.visible).toEqual(false);
|
|
315
315
|
});
|
|
316
316
|
|
|
317
|
-
|
|
317
|
+
it('ButtonPopup render', async () => {
|
|
318
318
|
await act(async () => {
|
|
319
319
|
tree = await create(wrapComponent(store, account, route));
|
|
320
320
|
});
|
|
@@ -337,7 +337,7 @@ describe('test DeviceDetail', () => {
|
|
|
337
337
|
expect(buttonPopupIcon.props.name).toEqual('check-circle');
|
|
338
338
|
});
|
|
339
339
|
|
|
340
|
-
|
|
340
|
+
it('ScrollView onRefresh', async () => {
|
|
341
341
|
await act(async () => {
|
|
342
342
|
tree = await create(wrapComponent(store, account, route));
|
|
343
343
|
});
|
|
@@ -350,7 +350,7 @@ describe('test DeviceDetail', () => {
|
|
|
350
350
|
expect(scrollView).toBeDefined();
|
|
351
351
|
});
|
|
352
352
|
|
|
353
|
-
|
|
353
|
+
it('Should render SensorDisplayItem', async () => {
|
|
354
354
|
const responseDisplay = {
|
|
355
355
|
status: 200,
|
|
356
356
|
data: {
|
|
@@ -489,7 +489,7 @@ describe('test DeviceDetail', () => {
|
|
|
489
489
|
expect(sensorDisplayItem).toHaveLength(4);
|
|
490
490
|
});
|
|
491
491
|
|
|
492
|
-
|
|
492
|
+
it('render SensorDisplayItem emercency', async () => {
|
|
493
493
|
const responseDisplay = {
|
|
494
494
|
status: 200,
|
|
495
495
|
data: {
|
|
@@ -554,7 +554,7 @@ describe('test DeviceDetail', () => {
|
|
|
554
554
|
expect(sensorDisplayItem).toHaveLength(1);
|
|
555
555
|
});
|
|
556
556
|
|
|
557
|
-
|
|
557
|
+
it('render CurrentRainSensor', async () => {
|
|
558
558
|
const responseDisplay = {
|
|
559
559
|
status: 200,
|
|
560
560
|
data: {
|
|
@@ -606,7 +606,7 @@ describe('test DeviceDetail', () => {
|
|
|
606
606
|
expect(currentRainSensor).toHaveLength(1); // not crash app
|
|
607
607
|
});
|
|
608
608
|
|
|
609
|
-
|
|
609
|
+
it('not fetch value if not managed by backend', async () => {
|
|
610
610
|
route.params.sensorData.is_managed_by_backend = false;
|
|
611
611
|
await act(async () => {
|
|
612
612
|
tree = await create(wrapComponent(store, account, route));
|
|
@@ -619,7 +619,7 @@ describe('test DeviceDetail', () => {
|
|
|
619
619
|
expect(sensorDisplayItem).toHaveLength(0);
|
|
620
620
|
});
|
|
621
621
|
|
|
622
|
-
|
|
622
|
+
it('HeaderDevice button more onClick', async () => {
|
|
623
623
|
await act(async () => {
|
|
624
624
|
tree = await create(wrapComponent(store, account, route));
|
|
625
625
|
});
|
|
@@ -638,7 +638,7 @@ describe('test DeviceDetail', () => {
|
|
|
638
638
|
expect(menu.props.isVisible).toBe(true);
|
|
639
639
|
});
|
|
640
640
|
|
|
641
|
-
|
|
641
|
+
it('Add device to Favourites', async () => {
|
|
642
642
|
const sensor = route?.params?.sensorData;
|
|
643
643
|
sensor.is_favourite = false;
|
|
644
644
|
|
|
@@ -657,7 +657,7 @@ describe('test DeviceDetail', () => {
|
|
|
657
657
|
});
|
|
658
658
|
});
|
|
659
659
|
|
|
660
|
-
|
|
660
|
+
it('Remove device from Favourites', async () => {
|
|
661
661
|
const sensor = route?.params?.sensorData;
|
|
662
662
|
store.unit.favoriteDeviceIds = [sensor.id];
|
|
663
663
|
|
|
@@ -677,7 +677,7 @@ describe('test DeviceDetail', () => {
|
|
|
677
677
|
});
|
|
678
678
|
});
|
|
679
679
|
|
|
680
|
-
|
|
680
|
+
it('Go to ActivityLog', async () => {
|
|
681
681
|
const responseDisplay = {
|
|
682
682
|
status: 200,
|
|
683
683
|
data: {
|
|
@@ -733,7 +733,7 @@ describe('test DeviceDetail', () => {
|
|
|
733
733
|
});
|
|
734
734
|
});
|
|
735
735
|
|
|
736
|
-
|
|
736
|
+
it('Open popup ble when server down', async () => {
|
|
737
737
|
store.app.isBluetoothEnabled = false;
|
|
738
738
|
data_sensor_display.items[1].configuration.configuration.action1_data.command_prefer_over_bluetooth = true;
|
|
739
739
|
const responseDisplay = {
|
|
@@ -531,8 +531,15 @@ const DeviceDetail = ({ route }) => {
|
|
|
531
531
|
} else if (resp_status >= 500) {
|
|
532
532
|
setServerDown(true);
|
|
533
533
|
}
|
|
534
|
-
|
|
535
|
-
|
|
534
|
+
setLoading((preState) => {
|
|
535
|
+
if (preState.isConnected) {
|
|
536
|
+
return {
|
|
537
|
+
...preState,
|
|
538
|
+
isConnected: false,
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
return preState;
|
|
542
|
+
});
|
|
536
543
|
};
|
|
537
544
|
if (
|
|
538
545
|
sensor?.is_managed_by_backend &&
|
|
@@ -546,7 +553,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
546
553
|
setLoading((preState) => ({ ...preState, isConnected: false }));
|
|
547
554
|
}
|
|
548
555
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
549
|
-
}, [sensor, display
|
|
556
|
+
}, [sensor, display]);
|
|
550
557
|
|
|
551
558
|
const isShowEmergencyResolve =
|
|
552
559
|
display.items.filter(
|
|
@@ -3,7 +3,7 @@ import { getConfigControlFromDeviceDisplay } from './index';
|
|
|
3
3
|
describe('Test getConfigControlFromDeviceDisplay', () => {
|
|
4
4
|
let deviceDisplay;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
it('test onoff template', async () => {
|
|
7
7
|
deviceDisplay = {
|
|
8
8
|
items: [
|
|
9
9
|
{
|
|
@@ -39,7 +39,7 @@ describe('Test getConfigControlFromDeviceDisplay', () => {
|
|
|
39
39
|
expect(configs).toHaveLength(2);
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
it('test state grid template', async () => {
|
|
43
43
|
deviceDisplay = {
|
|
44
44
|
items: [
|
|
45
45
|
{
|
|
@@ -61,7 +61,7 @@ describe('Test getConfigControlFromDeviceDisplay', () => {
|
|
|
61
61
|
expect(configs).toHaveLength(1);
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
it('test timer action template', async () => {
|
|
65
65
|
deviceDisplay = {
|
|
66
66
|
items: [
|
|
67
67
|
{
|
|
@@ -90,7 +90,7 @@ describe('Test getConfigControlFromDeviceDisplay', () => {
|
|
|
90
90
|
expect(configs).toHaveLength(2);
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
it('test two button template', async () => {
|
|
94
94
|
deviceDisplay = {
|
|
95
95
|
items: [
|
|
96
96
|
{
|
|
@@ -50,7 +50,7 @@ describe('EditActionsList', () => {
|
|
|
50
50
|
beforeEach(() => {
|
|
51
51
|
mockGoBack.mockClear();
|
|
52
52
|
});
|
|
53
|
-
|
|
53
|
+
it('render EditActionsList', async () => {
|
|
54
54
|
await act(async () => {
|
|
55
55
|
tree = await create(wrapComponent());
|
|
56
56
|
});
|
|
@@ -60,7 +60,7 @@ describe('EditActionsList', () => {
|
|
|
60
60
|
expect(draggableFlatList).toHaveLength(1);
|
|
61
61
|
expect(modalBottom).toHaveLength(1);
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
it('EditActionsList onPress cancel', async () => {
|
|
64
64
|
await act(async () => {
|
|
65
65
|
tree = await create(wrapComponent());
|
|
66
66
|
});
|
|
@@ -75,7 +75,7 @@ describe('EditActionsList', () => {
|
|
|
75
75
|
buttonCancel.props.onPress();
|
|
76
76
|
expect(mockGoBack).toHaveBeenCalled();
|
|
77
77
|
});
|
|
78
|
-
|
|
78
|
+
it('EditActionsList onPress save', async () => {
|
|
79
79
|
mock.onPut(API.AUTOMATE.ORDER_SCRIPT_ACTION(1)).reply(200);
|
|
80
80
|
await act(async () => {
|
|
81
81
|
tree = await create(wrapComponent());
|
|
@@ -91,7 +91,7 @@ describe('EditActionsList', () => {
|
|
|
91
91
|
buttonSave.props.onPress();
|
|
92
92
|
expect(mock.history.put).toHaveLength(1);
|
|
93
93
|
});
|
|
94
|
-
|
|
94
|
+
it('EditActionsList onPress remove', async () => {
|
|
95
95
|
await act(async () => {
|
|
96
96
|
tree = await create(wrapComponent());
|
|
97
97
|
});
|
|
@@ -105,7 +105,7 @@ describe('EditActionsList', () => {
|
|
|
105
105
|
expect(buttonRemove).toBeDefined();
|
|
106
106
|
buttonRemove.props.onPress();
|
|
107
107
|
});
|
|
108
|
-
|
|
108
|
+
it('EditActionsList modal onPress remove', async () => {
|
|
109
109
|
await act(async () => {
|
|
110
110
|
tree = await create(wrapComponent());
|
|
111
111
|
});
|
|
@@ -52,9 +52,9 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
52
52
|
|
|
53
53
|
let tree;
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
act(() => {
|
|
57
|
-
tree = create(wrapComponent(route));
|
|
55
|
+
it('onChangeNameText', async () => {
|
|
56
|
+
await act(async () => {
|
|
57
|
+
tree = await create(wrapComponent(route));
|
|
58
58
|
});
|
|
59
59
|
const instance = tree.root;
|
|
60
60
|
const textInput = instance.find(
|
|
@@ -65,7 +65,7 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
65
65
|
);
|
|
66
66
|
const viewButtonBottom = instance.findByType(ViewButtonBottom);
|
|
67
67
|
|
|
68
|
-
act(() => {
|
|
68
|
+
await act(async () => {
|
|
69
69
|
textInput.props.onChangeText('ABC');
|
|
70
70
|
});
|
|
71
71
|
|
|
@@ -73,9 +73,9 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
73
73
|
expect(viewButtonBottom.props.rightDisabled).toBeTruthy();
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
act(() => {
|
|
78
|
-
tree = create(wrapComponent(route));
|
|
76
|
+
it('onTextPhoneChange', async () => {
|
|
77
|
+
await act(async () => {
|
|
78
|
+
tree = await create(wrapComponent(route));
|
|
79
79
|
});
|
|
80
80
|
const instance = tree.root;
|
|
81
81
|
const textInput = instance.find(
|
|
@@ -86,7 +86,7 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
86
86
|
);
|
|
87
87
|
const viewButtonBottom = instance.findByType(ViewButtonBottom);
|
|
88
88
|
|
|
89
|
-
act(() => {
|
|
89
|
+
await act(async () => {
|
|
90
90
|
textInput.props.onChangeText('123');
|
|
91
91
|
});
|
|
92
92
|
|
|
@@ -94,21 +94,21 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
94
94
|
expect(viewButtonBottom.props.rightDisabled).toBeTruthy();
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
act(() => {
|
|
99
|
-
tree = create(wrapComponent(route));
|
|
97
|
+
it('onCancel', async () => {
|
|
98
|
+
await act(async () => {
|
|
99
|
+
tree = await create(wrapComponent(route));
|
|
100
100
|
});
|
|
101
101
|
const instance = tree.root;
|
|
102
102
|
const viewButtonBottom = instance.findByType(ViewButtonBottom);
|
|
103
103
|
|
|
104
|
-
act(() => {
|
|
104
|
+
await act(async () => {
|
|
105
105
|
viewButtonBottom.props.onLeftClick();
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
expect(mockedGoBack).toHaveBeenCalledTimes(1);
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
it('onSave success', async () => {
|
|
112
112
|
mock.onPost(API.EMERGENCY_BUTTON.CREATE_CONTACT()).reply(200);
|
|
113
113
|
|
|
114
114
|
await act(async () => {
|
|
@@ -132,7 +132,7 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
132
132
|
expect(mockedGoBack).toHaveBeenCalledTimes(1);
|
|
133
133
|
});
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
it('onSave failed', async () => {
|
|
136
136
|
await act(async () => {
|
|
137
137
|
tree = await create(wrapComponent(route));
|
|
138
138
|
});
|
|
@@ -162,7 +162,7 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
162
162
|
expect(mockedGoBack).not.toHaveBeenCalled();
|
|
163
163
|
});
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
it('invalid phone number', async () => {
|
|
166
166
|
await act(async () => {
|
|
167
167
|
tree = await create(wrapComponent(route));
|
|
168
168
|
});
|
|
@@ -50,35 +50,35 @@ describe('test EmergencyContactList', () => {
|
|
|
50
50
|
mockedNavigate.mockClear();
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
act(() => {
|
|
55
|
-
tree = create(wrapComponent(route));
|
|
53
|
+
it('handleRemove', async () => {
|
|
54
|
+
await act(async () => {
|
|
55
|
+
tree = await create(wrapComponent(route));
|
|
56
56
|
});
|
|
57
57
|
const instance = tree.root;
|
|
58
58
|
const alertAction = instance.findByType(AlertAction);
|
|
59
59
|
mock.onDelete(API.EMERGENCY_BUTTON.REMOVE_CONTACTS()).reply(204);
|
|
60
|
-
act(() => {
|
|
60
|
+
await act(async () => {
|
|
61
61
|
alertAction.props.rightButtonClick();
|
|
62
62
|
});
|
|
63
63
|
expect(alertAction.props.visible).toBe(false);
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
act(() => {
|
|
68
|
-
tree = create(wrapComponent(route));
|
|
66
|
+
it('handleRemove failure', async () => {
|
|
67
|
+
await act(async () => {
|
|
68
|
+
tree = await create(wrapComponent(route));
|
|
69
69
|
});
|
|
70
70
|
const instance = tree.root;
|
|
71
71
|
const alertAction = instance.findByType(AlertAction);
|
|
72
72
|
mock.onDelete(API.EMERGENCY_BUTTON.REMOVE_CONTACTS()).reply(400);
|
|
73
|
-
act(() => {
|
|
73
|
+
await act(async () => {
|
|
74
74
|
alertAction.props.rightButtonClick();
|
|
75
75
|
});
|
|
76
76
|
expect(alertAction.props.visible).toBe(false);
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
act(() => {
|
|
81
|
-
tree = create(wrapComponent(route));
|
|
79
|
+
it('onAddNew', async () => {
|
|
80
|
+
await act(async () => {
|
|
81
|
+
tree = await create(wrapComponent(route));
|
|
82
82
|
});
|
|
83
83
|
const instance = tree.root;
|
|
84
84
|
|
|
@@ -91,16 +91,16 @@ describe('test EmergencyContactList', () => {
|
|
|
91
91
|
|
|
92
92
|
expect(menuActionList.props.visible).toBe(false);
|
|
93
93
|
|
|
94
|
-
act(() => {
|
|
94
|
+
await act(async () => {
|
|
95
95
|
rowUser.props.onPress();
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
expect(menuActionList.props.visible).toBeTruthy();
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
act(() => {
|
|
103
|
-
tree = create(wrapComponent(route));
|
|
101
|
+
it('onItemAddClick create contact', async () => {
|
|
102
|
+
await act(async () => {
|
|
103
|
+
tree = await create(wrapComponent(route));
|
|
104
104
|
});
|
|
105
105
|
const instance = tree.root;
|
|
106
106
|
|
|
@@ -113,9 +113,9 @@ describe('test EmergencyContactList', () => {
|
|
|
113
113
|
expect(buttonsMenuActionList).toHaveLength(2);
|
|
114
114
|
});
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
act(() => {
|
|
118
|
-
tree = create(wrapComponent(route));
|
|
116
|
+
it('onItemAddClick select unit members', async () => {
|
|
117
|
+
await act(async () => {
|
|
118
|
+
tree = await create(wrapComponent(route));
|
|
119
119
|
});
|
|
120
120
|
const instance = tree.root;
|
|
121
121
|
|
|
@@ -127,7 +127,7 @@ describe('test EmergencyContactList', () => {
|
|
|
127
127
|
);
|
|
128
128
|
expect(buttonsMenuActionList).toHaveLength(2);
|
|
129
129
|
|
|
130
|
-
act(() => {
|
|
130
|
+
await act(async () => {
|
|
131
131
|
buttonsMenuActionList[1].props.onPress();
|
|
132
132
|
});
|
|
133
133
|
|
|
@@ -44,9 +44,9 @@ describe('test EmergencyContactsSelectContacts', () => {
|
|
|
44
44
|
|
|
45
45
|
let tree;
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
act(() => {
|
|
49
|
-
tree = create(wrapComponent(route));
|
|
47
|
+
it('onPress ErgencyContactsSelectContacts', async () => {
|
|
48
|
+
await act(async () => {
|
|
49
|
+
tree = await create(wrapComponent(route));
|
|
50
50
|
});
|
|
51
51
|
const instance = tree.root;
|
|
52
52
|
const rowUser = instance.findAllByProps(
|
|
@@ -57,15 +57,15 @@ describe('test EmergencyContactsSelectContacts', () => {
|
|
|
57
57
|
expect(rowUser[0]).toBeDefined();
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
it('render emergencyContactsSelectContacts success', async () => {
|
|
61
61
|
jest.useFakeTimers();
|
|
62
62
|
mock.onGet(API.SHARE.UNITS_MEMBERS(1, 1)).reply(200, {
|
|
63
63
|
id: 1,
|
|
64
64
|
name: 'test',
|
|
65
65
|
phone_number: 1,
|
|
66
66
|
});
|
|
67
|
-
act(() => {
|
|
68
|
-
tree = create(wrapComponent(route));
|
|
67
|
+
await act(async () => {
|
|
68
|
+
tree = await create(wrapComponent(route));
|
|
69
69
|
});
|
|
70
70
|
const instance = tree.root;
|
|
71
71
|
const rowUser = instance.findAllByProps(
|
|
@@ -76,10 +76,10 @@ describe('test EmergencyContactsSelectContacts', () => {
|
|
|
76
76
|
expect(rowUser[0]).toBeDefined();
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
it('test onSave emergencyContactsSelectContacts', async () => {
|
|
80
80
|
mock.onPost(API.EMERGENCY_BUTTON.CREATE_BATCH()).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 viewButtonBottom = instance.findByType(ViewButtonBottom);
|
|
@@ -94,10 +94,10 @@ describe('test EmergencyContactsSelectContacts', () => {
|
|
|
94
94
|
});
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
it('test onSave emergencyContactsSelectContacts fail', async () => {
|
|
98
98
|
mock.onPost(API.EMERGENCY_BUTTON.CREATE_BATCH()).reply(500);
|
|
99
|
-
act(() => {
|
|
100
|
-
tree = create(wrapComponent(route));
|
|
99
|
+
await act(async () => {
|
|
100
|
+
tree = await create(wrapComponent(route));
|
|
101
101
|
});
|
|
102
102
|
const instance = tree.root;
|
|
103
103
|
|
|
@@ -19,15 +19,15 @@ const wrapComponent = (props) => (
|
|
|
19
19
|
describe('Test DropDownItem', () => {
|
|
20
20
|
let tree;
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
it('test render DropDownItem', async () => {
|
|
23
23
|
const props = {
|
|
24
24
|
label: 'mode',
|
|
25
25
|
data: [{ label: 'Stop (0)', value: 'stop' }],
|
|
26
26
|
isOpen: true,
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
act(() => {
|
|
30
|
-
tree = create(wrapComponent(props));
|
|
29
|
+
await act(async () => {
|
|
30
|
+
tree = await create(wrapComponent(props));
|
|
31
31
|
});
|
|
32
32
|
const instance = tree.root;
|
|
33
33
|
const dropDownPicker = instance.findAll(
|
|
@@ -38,7 +38,7 @@ describe('Test DropDownItem', () => {
|
|
|
38
38
|
expect(dropDownPicker).toHaveLength(1);
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
it('test onPress DropDown', async () => {
|
|
42
42
|
const props = {
|
|
43
43
|
label: 'mode',
|
|
44
44
|
data: [{ label: 'Stop (0)', value: 'stop' }],
|
|
@@ -46,12 +46,12 @@ describe('Test DropDownItem', () => {
|
|
|
46
46
|
index: 0,
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
act(() => {
|
|
50
|
-
tree = create(wrapComponent(props));
|
|
49
|
+
await act(async () => {
|
|
50
|
+
tree = await create(wrapComponent(props));
|
|
51
51
|
});
|
|
52
52
|
const instance = tree.root;
|
|
53
53
|
const touchableOpacity = instance.findByType(TouchableOpacity);
|
|
54
|
-
act(() => {
|
|
54
|
+
await act(async () => {
|
|
55
55
|
touchableOpacity.props.onPress();
|
|
56
56
|
});
|
|
57
57
|
|
|
@@ -15,9 +15,9 @@ const wrapComponent = () => (
|
|
|
15
15
|
describe('test EmergencySetting', () => {
|
|
16
16
|
let tree;
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
act(() => {
|
|
20
|
-
tree = create(wrapComponent());
|
|
18
|
+
it('test render EmergencySetting', async () => {
|
|
19
|
+
await act(async () => {
|
|
20
|
+
tree = await create(wrapComponent());
|
|
21
21
|
});
|
|
22
22
|
const instance = tree.root;
|
|
23
23
|
const dropDownItem = instance.findAllByType(DropDownItem);
|
|
@@ -44,34 +44,34 @@ describe('Test EnterPassword', () => {
|
|
|
44
44
|
mockNavigate.mockClear();
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
it('test render EnterPassword button done', async () => {
|
|
48
48
|
const route = {
|
|
49
49
|
params: { dataParams: {}, type: '' },
|
|
50
50
|
};
|
|
51
|
-
act(() => {
|
|
52
|
-
tree = create(wrapComponent(route));
|
|
51
|
+
await act(async () => {
|
|
52
|
+
tree = await create(wrapComponent(route));
|
|
53
53
|
});
|
|
54
54
|
const instance = tree.root;
|
|
55
55
|
const button = buttonDone(instance);
|
|
56
56
|
expect(button).toHaveLength(1);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
it('test render EnterPassword has not params', async () => {
|
|
60
60
|
const route = {};
|
|
61
|
-
act(() => {
|
|
62
|
-
tree = create(wrapComponent(route));
|
|
61
|
+
await act(async () => {
|
|
62
|
+
tree = await create(wrapComponent(route));
|
|
63
63
|
});
|
|
64
64
|
const instance = tree.root;
|
|
65
65
|
const button = buttonDone(instance);
|
|
66
66
|
expect(button).toHaveLength(1);
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
it('test render EnterPassword text input password', async () => {
|
|
70
70
|
const route = {
|
|
71
71
|
params: { dataParams: {}, type: '' },
|
|
72
72
|
};
|
|
73
|
-
act(() => {
|
|
74
|
-
tree = create(wrapComponent(route));
|
|
73
|
+
await act(async () => {
|
|
74
|
+
tree = await create(wrapComponent(route));
|
|
75
75
|
});
|
|
76
76
|
const instance = tree.root;
|
|
77
77
|
const textInput = instance.findAll(
|
|
@@ -82,7 +82,7 @@ describe('Test EnterPassword', () => {
|
|
|
82
82
|
expect(textInput).toHaveLength(3);
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
it('test EnterPassword button done onPress none type ', async () => {
|
|
86
86
|
const route = {
|
|
87
87
|
params: { dataParams: { unit_id: 1, member: { id: 1 } }, type: '' },
|
|
88
88
|
};
|
|
@@ -97,7 +97,7 @@ describe('Test EnterPassword', () => {
|
|
|
97
97
|
});
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
it('test EnterPassword button done onPress has type ', async () => {
|
|
101
101
|
const route = {
|
|
102
102
|
params: {
|
|
103
103
|
dataParams: {
|
|
@@ -119,7 +119,7 @@ describe('Test EnterPassword', () => {
|
|
|
119
119
|
expect(mockNavigate).toBeCalled();
|
|
120
120
|
});
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
it('test EnterPassword button failure', async () => {
|
|
123
123
|
const route = {
|
|
124
124
|
params: {
|
|
125
125
|
dataParams: {
|
|
@@ -32,9 +32,9 @@ jest.mock('@react-navigation/native', () => {
|
|
|
32
32
|
describe('test Explore', () => {
|
|
33
33
|
let tree;
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
act(() => {
|
|
37
|
-
tree = create(wrapComponent(mockedNavigate));
|
|
35
|
+
it('Explore', async () => {
|
|
36
|
+
await act(async () => {
|
|
37
|
+
tree = await create(wrapComponent(mockedNavigate));
|
|
38
38
|
});
|
|
39
39
|
const instance = tree.root;
|
|
40
40
|
const safeAreaView = instance.findAllByType(SafeAreaView);
|
|
@@ -79,7 +79,7 @@ describe('Test GuestInfo', () => {
|
|
|
79
79
|
};
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
it('test render GuestInfo', async () => {
|
|
83
83
|
mock.onGet(API.SHARED_SENSOR.ACCESS(1)).reply(200, data);
|
|
84
84
|
await act(async () => {
|
|
85
85
|
tree = await create(wrapComponent(route));
|
|
@@ -116,7 +116,7 @@ describe('Test GuestInfo', () => {
|
|
|
116
116
|
expect(temporary.props.isSelected).toBeTruthy();
|
|
117
117
|
});
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
it('test open and close 2 modal', async () => {
|
|
120
120
|
mock.onGet(API.SHARED_SENSOR.ACCESS(1)).reply(200, data);
|
|
121
121
|
await act(async () => {
|
|
122
122
|
tree = await create(wrapComponent(route));
|
|
@@ -182,7 +182,7 @@ describe('Test GuestInfo', () => {
|
|
|
182
182
|
expect(accessScheduleSheet.props.isVisible).toBeFalsy();
|
|
183
183
|
});
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
it('test save', async () => {
|
|
186
186
|
data.access_schedule = 'recurring';
|
|
187
187
|
mock.onGet(API.SHARED_SENSOR.ACCESS(1)).reply(200, data);
|
|
188
188
|
await act(async () => {
|
|
@@ -89,7 +89,7 @@ describe('Test HanetCaptureFaceID', () => {
|
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
it('Test update face id', async () => {
|
|
93
93
|
await act(async () => {
|
|
94
94
|
tree = await create(wrapComponent(route));
|
|
95
95
|
});
|
|
@@ -110,7 +110,7 @@ describe('Test HanetCaptureFaceID', () => {
|
|
|
110
110
|
expect(mockedGoBack).toHaveBeenCalled();
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
it('Test set face id for new member', async () => {
|
|
114
114
|
route.params.isAddNewMember = true;
|
|
115
115
|
await act(async () => {
|
|
116
116
|
tree = await create(wrapComponent(route));
|