@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
package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/SmartTiviActionTemplate.test.js
CHANGED
|
@@ -14,7 +14,7 @@ const wrapComponent = (actionGroup, doAction) => (
|
|
|
14
14
|
|
|
15
15
|
describe('Test SmartTiviActionTemplate', () => {
|
|
16
16
|
let wrapper;
|
|
17
|
-
|
|
17
|
+
it('render SmartTiviActionTemplate', async () => {
|
|
18
18
|
await act(async () => {
|
|
19
19
|
wrapper = await create(wrapComponent());
|
|
20
20
|
});
|
|
@@ -22,7 +22,7 @@ describe('Test SmartTiviActionTemplate', () => {
|
|
|
22
22
|
const touchableOpacity = instance.findAllByType(ScrollView);
|
|
23
23
|
expect(touchableOpacity).toHaveLength(1);
|
|
24
24
|
});
|
|
25
|
-
|
|
25
|
+
it('render CircleButton small OnOff and exit', async () => {
|
|
26
26
|
await act(async () => {
|
|
27
27
|
wrapper = await create(wrapComponent());
|
|
28
28
|
});
|
|
@@ -33,7 +33,7 @@ describe('Test SmartTiviActionTemplate', () => {
|
|
|
33
33
|
AccessibilityLabel.SMART_TIVI_TEMPLATE.ONOFF_BUTTON
|
|
34
34
|
);
|
|
35
35
|
expect(circleButtonOnOff).toBeDefined();
|
|
36
|
-
await act(() => {
|
|
36
|
+
await act(async () => {
|
|
37
37
|
circleButtonOnOff.props.onPress();
|
|
38
38
|
});
|
|
39
39
|
|
|
@@ -45,11 +45,11 @@ describe('Test SmartTiviActionTemplate', () => {
|
|
|
45
45
|
expect(circleButtonExit).toBeDefined();
|
|
46
46
|
// expect(circleButton).toHaveLength(2);
|
|
47
47
|
|
|
48
|
-
await act(() => {
|
|
48
|
+
await act(async () => {
|
|
49
49
|
circleButtonExit.props.onPress();
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
|
-
|
|
52
|
+
it('render RectangleButton column Volume and CH', async () => {
|
|
53
53
|
await act(async () => {
|
|
54
54
|
wrapper = await create(wrapComponent());
|
|
55
55
|
});
|
|
@@ -60,10 +60,10 @@ describe('Test SmartTiviActionTemplate', () => {
|
|
|
60
60
|
AccessibilityLabel.SMART_TIVI_TEMPLATE.VOLUME_BUTTON
|
|
61
61
|
);
|
|
62
62
|
expect(RectangleButtonVolume).toBeDefined();
|
|
63
|
-
await act(() => {
|
|
63
|
+
await act(async () => {
|
|
64
64
|
RectangleButtonVolume.props.onPressUp();
|
|
65
65
|
});
|
|
66
|
-
await act(() => {
|
|
66
|
+
await act(async () => {
|
|
67
67
|
RectangleButtonVolume.props.onPressDown();
|
|
68
68
|
});
|
|
69
69
|
const RectangleButtonCH = instance.find(
|
|
@@ -72,14 +72,14 @@ describe('Test SmartTiviActionTemplate', () => {
|
|
|
72
72
|
AccessibilityLabel.SMART_TIVI_TEMPLATE.CH_BUTTON
|
|
73
73
|
);
|
|
74
74
|
expect(RectangleButtonCH).toBeDefined();
|
|
75
|
-
await act(() => {
|
|
75
|
+
await act(async () => {
|
|
76
76
|
RectangleButtonCH.props.onPressUp();
|
|
77
77
|
});
|
|
78
|
-
await act(() => {
|
|
78
|
+
await act(async () => {
|
|
79
79
|
RectangleButtonCH.props.onPressDown();
|
|
80
80
|
});
|
|
81
81
|
});
|
|
82
|
-
|
|
82
|
+
it('render CircleButton big button', async () => {
|
|
83
83
|
await act(async () => {
|
|
84
84
|
wrapper = await create(wrapComponent());
|
|
85
85
|
});
|
|
@@ -90,23 +90,23 @@ describe('Test SmartTiviActionTemplate', () => {
|
|
|
90
90
|
AccessibilityLabel.SMART_TIVI_TEMPLATE.BIG_BUTTON
|
|
91
91
|
);
|
|
92
92
|
expect(CircleButtonBig).toBeDefined();
|
|
93
|
-
await act(() => {
|
|
93
|
+
await act(async () => {
|
|
94
94
|
CircleButtonBig.props.onPressUp();
|
|
95
95
|
});
|
|
96
|
-
await act(() => {
|
|
96
|
+
await act(async () => {
|
|
97
97
|
CircleButtonBig.props.onPressDown();
|
|
98
98
|
});
|
|
99
|
-
await act(() => {
|
|
99
|
+
await act(async () => {
|
|
100
100
|
CircleButtonBig.props.onPressLeft();
|
|
101
101
|
});
|
|
102
|
-
await act(() => {
|
|
102
|
+
await act(async () => {
|
|
103
103
|
CircleButtonBig.props.onPressRight();
|
|
104
104
|
});
|
|
105
|
-
await act(() => {
|
|
105
|
+
await act(async () => {
|
|
106
106
|
CircleButtonBig.props.onPressOk();
|
|
107
107
|
});
|
|
108
108
|
});
|
|
109
|
-
|
|
109
|
+
it('render ControlPlay button', async () => {
|
|
110
110
|
await act(async () => {
|
|
111
111
|
wrapper = await create(wrapComponent());
|
|
112
112
|
});
|
|
@@ -117,17 +117,17 @@ describe('Test SmartTiviActionTemplate', () => {
|
|
|
117
117
|
AccessibilityLabel.SMART_TIVI_TEMPLATE.CONTROL_BUTTON
|
|
118
118
|
);
|
|
119
119
|
expect(ControlPlay).toBeDefined();
|
|
120
|
-
await act(() => {
|
|
120
|
+
await act(async () => {
|
|
121
121
|
ControlPlay.props.onPressPrev();
|
|
122
122
|
});
|
|
123
|
-
await act(() => {
|
|
123
|
+
await act(async () => {
|
|
124
124
|
ControlPlay.props.onPressStop();
|
|
125
125
|
});
|
|
126
|
-
await act(() => {
|
|
126
|
+
await act(async () => {
|
|
127
127
|
ControlPlay.props.onPressNext();
|
|
128
128
|
});
|
|
129
129
|
});
|
|
130
|
-
|
|
130
|
+
it('render controlHome button', async () => {
|
|
131
131
|
await act(async () => {
|
|
132
132
|
wrapper = await create(wrapComponent());
|
|
133
133
|
});
|
|
@@ -138,11 +138,11 @@ describe('Test SmartTiviActionTemplate', () => {
|
|
|
138
138
|
AccessibilityLabel.SMART_TIVI_TEMPLATE.HOME_BUTTON
|
|
139
139
|
);
|
|
140
140
|
expect(controlHome).toBeDefined();
|
|
141
|
-
await act(() => {
|
|
141
|
+
await act(async () => {
|
|
142
142
|
controlHome.props.onPress();
|
|
143
143
|
});
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
it('render controlBack button', async () => {
|
|
146
146
|
await act(async () => {
|
|
147
147
|
wrapper = await create(wrapComponent());
|
|
148
148
|
});
|
|
@@ -153,7 +153,7 @@ describe('Test SmartTiviActionTemplate', () => {
|
|
|
153
153
|
AccessibilityLabel.SMART_TIVI_TEMPLATE.BACK_BUTTON
|
|
154
154
|
);
|
|
155
155
|
expect(controlBack).toBeDefined();
|
|
156
|
-
await act(() => {
|
|
156
|
+
await act(async () => {
|
|
157
157
|
controlBack.props.onPress();
|
|
158
158
|
});
|
|
159
159
|
});
|
|
@@ -41,11 +41,9 @@ const GridItem = ({ item, index, length, doAction, sensor, title }) => {
|
|
|
41
41
|
const checkIcon = /\d/.test(icon); // to do check icon svg and icon antDesign
|
|
42
42
|
const doActionAndWatchConfig = useCallback(
|
|
43
43
|
(actionData) => {
|
|
44
|
-
let data =
|
|
44
|
+
let data = null;
|
|
45
45
|
if (allow_config_store_value && config) {
|
|
46
46
|
data = JSON.stringify({ config_id: config, config_value: is_on_value });
|
|
47
|
-
} else {
|
|
48
|
-
data = null;
|
|
49
47
|
}
|
|
50
48
|
doAction(actionData, data);
|
|
51
49
|
if (sensor?.is_managed_by_backend) {
|
|
@@ -55,7 +55,7 @@ describe('Test ColorPickerTemplate', () => {
|
|
|
55
55
|
};
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
it('render template ColorPickerTemplate', async () => {
|
|
59
59
|
useConfigGlobalState.mockImplementation(() => [{}, jest.fn()]);
|
|
60
60
|
const sensor = {
|
|
61
61
|
is_managed_by_backend: true,
|
|
@@ -78,8 +78,8 @@ describe('Test CurtainButtonTemplate', () => {
|
|
|
78
78
|
|
|
79
79
|
let wrapper;
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
await act(() => {
|
|
81
|
+
it('render without params', async () => {
|
|
82
|
+
await act(async () => {
|
|
83
83
|
wrapper = renderer.create(wrapComponent());
|
|
84
84
|
});
|
|
85
85
|
const instance = wrapper.root;
|
|
@@ -87,8 +87,8 @@ describe('Test CurtainButtonTemplate', () => {
|
|
|
87
87
|
expect(touchableOpacities.length).toEqual(3);
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
await act(() => {
|
|
90
|
+
it('render CurtainButtonTemplate', async () => {
|
|
91
|
+
await act(async () => {
|
|
92
92
|
wrapper = renderer.create(wrapComponent(actionGroup, sensor));
|
|
93
93
|
});
|
|
94
94
|
const instance = wrapper.root;
|
|
@@ -48,7 +48,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
48
48
|
};
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
it('render template', async () => {
|
|
52
52
|
const mockDoAction = jest.fn();
|
|
53
53
|
await act(async () => {
|
|
54
54
|
wrapper = await create(
|
|
@@ -75,7 +75,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
75
75
|
expect(watchMultiConfigs).toBeCalled();
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
it('do action not call watchConfigs cause is_managed_by_backend false', async () => {
|
|
79
79
|
const mockDoAction = jest.fn();
|
|
80
80
|
await act(async () => {
|
|
81
81
|
wrapper = await create(
|
|
@@ -97,7 +97,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
97
97
|
expect(watchMultiConfigs).not.toBeCalled();
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
it('do action not call watchConfigs cause device_type not lq_thinq', async () => {
|
|
101
101
|
const mockDoAction = jest.fn();
|
|
102
102
|
await act(async () => {
|
|
103
103
|
wrapper = await create(
|
|
@@ -122,7 +122,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
122
122
|
expect(watchMultiConfigs).not.toBeCalled();
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
it('do action watchConfigs cause allow_config_store_value true', async () => {
|
|
126
126
|
const mockDoAction = jest.fn();
|
|
127
127
|
actionGroup.configuration.allow_config_store_value = true;
|
|
128
128
|
await act(async () => {
|
|
@@ -148,7 +148,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
148
148
|
expect(watchMultiConfigs).toBeCalled();
|
|
149
149
|
});
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
it('action down without config', async () => {
|
|
152
152
|
actionGroup.configuration.allow_config_store_value = true;
|
|
153
153
|
actionGroup.configuration.config = undefined;
|
|
154
154
|
const mockDoAction = jest.fn();
|
|
@@ -172,7 +172,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
172
172
|
expect(watchMultiConfigs).not.toBeCalled();
|
|
173
173
|
});
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
it('action down allow_config_store_value true', async () => {
|
|
176
176
|
const mockDoAction = jest.fn();
|
|
177
177
|
actionGroup.configuration.allow_config_store_value = true;
|
|
178
178
|
actionGroup.configuration.config = null;
|
|
@@ -199,7 +199,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
199
199
|
expect(text.props.children).toEqual('27 *C');
|
|
200
200
|
});
|
|
201
201
|
|
|
202
|
-
|
|
202
|
+
it('action up allow_config_store_value true', async () => {
|
|
203
203
|
const mockDoAction = jest.fn();
|
|
204
204
|
actionGroup.configuration.allow_config_store_value = true;
|
|
205
205
|
actionGroup.configuration.config = null;
|
|
@@ -227,7 +227,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
227
227
|
expect(text.props.children).toEqual('29 *C');
|
|
228
228
|
});
|
|
229
229
|
|
|
230
|
-
|
|
230
|
+
it('action down with allow_config_store_value false', async () => {
|
|
231
231
|
const mockDoAction = jest.fn();
|
|
232
232
|
await act(async () => {
|
|
233
233
|
wrapper = await create(
|
|
@@ -253,7 +253,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
253
253
|
expect(text.props.children).toEqual('24 *C'); // TODO should 24, configValues make changes again
|
|
254
254
|
});
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
it('action up with allow_config_store_value false', async () => {
|
|
257
257
|
const mockDoAction = jest.fn();
|
|
258
258
|
await act(async () => {
|
|
259
259
|
wrapper = await create(
|
|
@@ -279,7 +279,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
279
279
|
expect(text.props.children).toEqual('26 *C'); // TODO should 26, configValues make changes again
|
|
280
280
|
});
|
|
281
281
|
|
|
282
|
-
|
|
282
|
+
it('action down limit ', async () => {
|
|
283
283
|
actionGroup.configuration.min_value = 25;
|
|
284
284
|
const mockDoAction = jest.fn();
|
|
285
285
|
await act(async () => {
|
|
@@ -303,7 +303,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
303
303
|
expect(text.props.children).toEqual('25 *C');
|
|
304
304
|
});
|
|
305
305
|
|
|
306
|
-
|
|
306
|
+
it('action up limit ', async () => {
|
|
307
307
|
actionGroup.configuration.max_value = 25;
|
|
308
308
|
const mockDoAction = jest.fn();
|
|
309
309
|
await act(async () => {
|
|
@@ -326,7 +326,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
326
326
|
const text = instance.findByType(Text);
|
|
327
327
|
expect(text.props.children).toEqual('25 *C');
|
|
328
328
|
});
|
|
329
|
-
|
|
329
|
+
it('render template have title', async () => {
|
|
330
330
|
const mockDoAction = jest.fn();
|
|
331
331
|
actionGroup.title = 'title';
|
|
332
332
|
await act(async () => {
|
|
@@ -345,7 +345,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
345
345
|
const text = instance.findAllByType(Text);
|
|
346
346
|
expect(text).toHaveLength(2);
|
|
347
347
|
});
|
|
348
|
-
|
|
348
|
+
it('render template watch config not exits', async () => {
|
|
349
349
|
const mockDoAction = jest.fn();
|
|
350
350
|
actionGroup.configuration.config = 100;
|
|
351
351
|
await act(async () => {
|
|
@@ -363,7 +363,7 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
363
363
|
const text = instance.findAllByType(ActivityIndicator);
|
|
364
364
|
expect(text).toHaveLength(0);
|
|
365
365
|
});
|
|
366
|
-
|
|
366
|
+
it('action up sensor device type is GOOGLE_HOME', async () => {
|
|
367
367
|
const mockDoAction = jest.fn();
|
|
368
368
|
await act(async () => {
|
|
369
369
|
wrapper = await create(
|
|
@@ -61,11 +61,11 @@ describe('Test OneBigButtonTemplate', () => {
|
|
|
61
61
|
const setState = jest.fn();
|
|
62
62
|
useState.mockImplementation((init) => [init, setState]);
|
|
63
63
|
|
|
64
|
-
const assertRender = (state, text) => {
|
|
64
|
+
const assertRender = async (state, text) => {
|
|
65
65
|
useState.mockImplementationOnce((init) => [state, setState]);
|
|
66
66
|
const mockDoAction = jest.fn();
|
|
67
67
|
|
|
68
|
-
act(() => {
|
|
68
|
+
await act(async () => {
|
|
69
69
|
wrapper = create(wrapComponent(actionGroup, mockDoAction));
|
|
70
70
|
});
|
|
71
71
|
|
|
@@ -75,29 +75,29 @@ describe('Test OneBigButtonTemplate', () => {
|
|
|
75
75
|
expect(renderJson?.type).toEqual('Modal');
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
assertRender(true, 'ON');
|
|
78
|
+
it('render state on', async () => {
|
|
79
|
+
await assertRender(true, 'ON');
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
assertRender(false, 'OFF');
|
|
82
|
+
it('render state off', async () => {
|
|
83
|
+
await assertRender(false, 'OFF');
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
const assertActionCall = (state, action_data) => {
|
|
86
|
+
const assertActionCall = async (state, action_data) => {
|
|
87
87
|
useState.mockImplementationOnce((init) => [state, setState]);
|
|
88
88
|
const mockDoAction = jest.fn();
|
|
89
|
-
act(() => {
|
|
89
|
+
await act(async () => {
|
|
90
90
|
wrapper = create(wrapComponent(actionGroup, mockDoAction));
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
expect(mockDoAction).not.toHaveBeenCalled();
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
assertActionCall(true, action_off_data);
|
|
96
|
+
it('action state on', async () => {
|
|
97
|
+
await assertActionCall(true, action_off_data);
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
assertActionCall(false, action_on_data);
|
|
100
|
+
it('action state off', async () => {
|
|
101
|
+
await assertActionCall(false, action_on_data);
|
|
102
102
|
});
|
|
103
103
|
});
|
|
@@ -71,7 +71,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
71
71
|
};
|
|
72
72
|
});
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
it('render with template OnOffSmartLockActionTemplate doAction lock', async () => {
|
|
75
75
|
useConfigGlobalState.mockImplementation(() => [
|
|
76
76
|
{ 5: { value: 2 } },
|
|
77
77
|
jest.fn(),
|
|
@@ -90,7 +90,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
90
90
|
expect(mockDoAction).toBeCalledWith(action_on_data, '{"door_lock":0}');
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
it('render with template OnOffSmartLockActionTemplate doAction unlock', async () => {
|
|
94
94
|
actionGroup.configuration.is_on_value = null;
|
|
95
95
|
const sensor = { is_managed_by_backend: false, name: 'Sensor' };
|
|
96
96
|
useConfigGlobalState.mockImplementation(() => [
|
|
@@ -100,7 +100,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
it('render with template OnOffSimpleActionTemplate', async () => {
|
|
104
104
|
const mockDoAction = jest.fn();
|
|
105
105
|
await act(async () => {
|
|
106
106
|
tree = await create(wrapComponent(actionGroup, mockDoAction, {}));
|
|
@@ -110,7 +110,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
110
110
|
expect(template).toHaveLength(1);
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
it('render with template on_off_button_action_template', async () => {
|
|
114
114
|
actionGroup.template = 'on_off_button_action_template';
|
|
115
115
|
const mockDoAction = jest.fn();
|
|
116
116
|
await act(async () => {
|
|
@@ -121,7 +121,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
121
121
|
expect(template).toHaveLength(0);
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
it('render with wrong template', async () => {
|
|
125
125
|
actionGroup.template = 'wrong_template';
|
|
126
126
|
const mockDoAction = jest.fn();
|
|
127
127
|
await act(async () => {
|
|
@@ -140,7 +140,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
140
140
|
expect(templateOnOffSimple).not.toHaveLength(1);
|
|
141
141
|
});
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
it('render with template OnOffSimpleActionTemplate with is_managed_by_backend', async () => {
|
|
144
144
|
const mockDoAction = jest.fn();
|
|
145
145
|
await act(async () => {
|
|
146
146
|
tree = await create(wrapComponent(actionGroup, mockDoAction, {}));
|
|
@@ -151,7 +151,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
151
151
|
expect(watchMultiConfigs).toBeCalledTimes(0);
|
|
152
152
|
});
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
it('template OnOffSimpleActionTemplate doAction with is_on_value, match configValue', async () => {
|
|
155
155
|
const mockDoAction = jest.fn();
|
|
156
156
|
await act(async () => {
|
|
157
157
|
tree = await create(wrapComponent(actionGroup, mockDoAction, sensor));
|
|
@@ -168,7 +168,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
168
168
|
expect(watchMultiConfigs).toBeCalledTimes(0);
|
|
169
169
|
});
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
it('template OnOffSimpleActionTemplate doAction with is_on_value, not match configValue', async () => {
|
|
172
172
|
actionGroup.configuration.is_on_value = [1];
|
|
173
173
|
const mockDoAction = jest.fn();
|
|
174
174
|
await act(async () => {
|
|
@@ -184,7 +184,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
184
184
|
expect(mockDoAction).toHaveBeenCalledWith(action_on_data, null);
|
|
185
185
|
});
|
|
186
186
|
|
|
187
|
-
|
|
187
|
+
it('template OnOffSimpleActionTemplate doAction with is_on_value and is_managed_by_backend', async () => {
|
|
188
188
|
const mockDoAction = jest.fn();
|
|
189
189
|
await act(async () => {
|
|
190
190
|
tree = await create(wrapComponent(actionGroup, mockDoAction, sensor));
|
|
@@ -200,7 +200,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
200
200
|
expect(watchMultiConfigs).toBeCalledTimes(0);
|
|
201
201
|
});
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
it('render with template OnOffSimpleActionTemplate with just action_data', async () => {
|
|
204
204
|
actionGroup = {
|
|
205
205
|
template: 'OnOffSimpleActionTemplate',
|
|
206
206
|
configuration: {
|
|
@@ -226,7 +226,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
226
226
|
expect(mockDoAction).toHaveBeenCalledWith(action_data, false);
|
|
227
227
|
});
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
it('render with template OnOffSimpleActionTemplate with just action_data lg_thinq', async () => {
|
|
230
230
|
actionGroup = {
|
|
231
231
|
template: 'OnOffSimpleActionTemplate',
|
|
232
232
|
configuration: {
|
|
@@ -259,7 +259,7 @@ describe('Test OnOffTemplate', () => {
|
|
|
259
259
|
);
|
|
260
260
|
});
|
|
261
261
|
|
|
262
|
-
|
|
262
|
+
it('render with template OnOffSimpleActionTemplate disabled', async () => {
|
|
263
263
|
actionGroup = {
|
|
264
264
|
template: 'OnOffSimpleActionTemplate',
|
|
265
265
|
configuration: {
|
|
@@ -55,7 +55,7 @@ describe('Test OneBigButtonTemplate', () => {
|
|
|
55
55
|
sensor = { name: 'Sensor' };
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
it('render OneBigButtonTemplate', async () => {
|
|
59
59
|
const mockDoAction = jest.fn();
|
|
60
60
|
await act(async () => {
|
|
61
61
|
tree = await create(wrapComponent(actionGroup, mockDoAction, sensor));
|
|
@@ -64,7 +64,7 @@ describe('Test OneBigButtonTemplate', () => {
|
|
|
64
64
|
const buttons = instance.findAllByType(TouchableOpacity);
|
|
65
65
|
expect(buttons.length).toEqual(1);
|
|
66
66
|
|
|
67
|
-
act(() => {
|
|
67
|
+
await act(async () => {
|
|
68
68
|
buttons[0].props.onPress();
|
|
69
69
|
});
|
|
70
70
|
|
|
@@ -78,7 +78,7 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
78
78
|
};
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
it('render template', async () => {
|
|
82
82
|
const mockDoAction = jest.fn();
|
|
83
83
|
sensor.is_managed_by_backend = true;
|
|
84
84
|
await act(async () => {
|
|
@@ -95,7 +95,7 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
95
95
|
expect(touchs).toHaveLength(5); // show-hide alert + 2 options + onDone
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
it('render template without selectedOption match, get first one', async () => {
|
|
99
99
|
actionGroup.configuration.options[1].value_int = 3;
|
|
100
100
|
sensor.is_managed_by_backend = true;
|
|
101
101
|
const mockDoAction = jest.fn();
|
|
@@ -169,15 +169,15 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
169
169
|
expect(texts[1].props.children).toEqual('Level2'); // TODO: should be Level1, configValues make change again
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
it('show popup, change selectedOption and watchMultiConfigs', async () => {
|
|
173
173
|
await assertUpdateSelectedOption(true);
|
|
174
174
|
});
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
it('show popup, change selectedOption and not watchMultiConfigs', async () => {
|
|
177
177
|
await assertUpdateSelectedOption(false);
|
|
178
178
|
});
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
it('doAction with text when have value_text', async () => {
|
|
181
181
|
actionGroup.configuration.options[0].value_text = 'level-1';
|
|
182
182
|
const mockDoAction = jest.fn();
|
|
183
183
|
await act(async () => {
|
|
@@ -235,7 +235,7 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
235
235
|
expect(texts[1].props.children).toEqual('Level2');
|
|
236
236
|
});
|
|
237
237
|
|
|
238
|
-
|
|
238
|
+
it('render template without read config', async () => {
|
|
239
239
|
delete actionGroup.configuration.config;
|
|
240
240
|
sensor.is_managed_by_backend = true;
|
|
241
241
|
|
|
@@ -254,7 +254,7 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
254
254
|
getTranslate('en', 'not_available')
|
|
255
255
|
);
|
|
256
256
|
});
|
|
257
|
-
|
|
257
|
+
it('doAction sensor device type is GOOGLE_HOME', async () => {
|
|
258
258
|
actionGroup.configuration.options[0].value_text = 'level-1';
|
|
259
259
|
sensor.device_type = DEVICE_TYPE.GOOGLE_HOME;
|
|
260
260
|
const mockDoAction = jest.fn();
|
|
@@ -55,7 +55,7 @@ describe('Test SliderRangeTemplate', () => {
|
|
|
55
55
|
};
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
it('render template SliderRangeTemplate', async () => {
|
|
59
59
|
useConfigGlobalState.mockImplementation(() => [{}, jest.fn()]);
|
|
60
60
|
const sensor = { is_managed_by_backend: true, name: 'Sensor' };
|
|
61
61
|
await act(async () => {
|
|
@@ -48,7 +48,7 @@ describe('Test StatesGridActionTemplate', () => {
|
|
|
48
48
|
name: 'Sensor name',
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
it('test render without params', async () => {
|
|
52
52
|
await act(async () => {
|
|
53
53
|
tree = await create(<StatesGridActionTemplate />);
|
|
54
54
|
});
|
|
@@ -57,7 +57,7 @@ describe('Test StatesGridActionTemplate', () => {
|
|
|
57
57
|
expect(Texts).toHaveLength(1);
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
it('test render with params', async () => {
|
|
61
61
|
await act(async () => {
|
|
62
62
|
tree = await create(
|
|
63
63
|
<StatesGridActionTemplate
|
|
@@ -61,8 +61,8 @@ describe('Test ThreeButtonTemplate', () => {
|
|
|
61
61
|
|
|
62
62
|
let wrapper;
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
await act(() => {
|
|
64
|
+
it('render ThreeButtonTemplate', async () => {
|
|
65
|
+
await act(async () => {
|
|
66
66
|
wrapper = renderer.create(wrapComponent(actionGroup));
|
|
67
67
|
});
|
|
68
68
|
const instance = wrapper.root;
|
|
@@ -68,7 +68,7 @@ describe('Test TimerActionTemplate success with config value', () => {
|
|
|
68
68
|
};
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
it('render without params', async () => {
|
|
72
72
|
await act(async () => {
|
|
73
73
|
wrapper = await create(wrapComponent());
|
|
74
74
|
});
|
|
@@ -77,7 +77,7 @@ describe('Test TimerActionTemplate success with config value', () => {
|
|
|
77
77
|
expect(texts).toHaveLength(6);
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
it('render template', async () => {
|
|
81
81
|
await act(async () => {
|
|
82
82
|
wrapper = await create(wrapComponent(actionGroup, sensor));
|
|
83
83
|
});
|
|
@@ -105,7 +105,7 @@ describe('Test TimerActionTemplate success with config value', () => {
|
|
|
105
105
|
);
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
it('render template with config_hour', async () => {
|
|
109
109
|
actionGroup = {
|
|
110
110
|
...actionGroup,
|
|
111
111
|
configuration: {
|
|
@@ -60,7 +60,7 @@ describe('Test TimerActionTemplate without config value', () => {
|
|
|
60
60
|
};
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
it('render template', async () => {
|
|
64
64
|
Date.now = jest.fn(() => new Date('2021-09-09T10:00:00.000Z'));
|
|
65
65
|
const mockDoAction = jest.fn();
|
|
66
66
|
await act(async () => {
|
|
@@ -82,7 +82,7 @@ describe('Test TimerActionTemplate without config value', () => {
|
|
|
82
82
|
);
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
it('timer onConfirm', async () => {
|
|
86
86
|
Date.now = jest.fn(() => new Date('2021-09-09T10:00:00.000Z'));
|
|
87
87
|
const mockDoAction = jest.fn();
|
|
88
88
|
await act(async () => {
|