@eohjsc/react-native-smart-city 0.3.34 → 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/assets/images/AddNewDevice/on-icon.svg +5 -0
- package/assets/images/AddNewDevice/router-connect-icon.svg +3 -0
- 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/HorizontalBarChart.js +2 -6
- 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/configs/Constants.js +2 -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/navigations/AddGatewayStack.js +10 -0
- 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/SetupSensor.js +6 -0
- 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/ConnectingModbusDevice.js +0 -1
- package/src/screens/AddNewGateway/ConnectingWifiGuide.js +2 -2
- package/src/screens/AddNewGateway/ConnectingZigbeeDevice.js +3 -2
- package/src/screens/AddNewGateway/PlugAndPlay/ConnectRouterGuide.js +49 -0
- package/src/screens/AddNewGateway/PlugAndPlay/ConnectRouterGuideStyles.js +31 -0
- package/src/screens/AddNewGateway/PlugAndPlay/ZigbeeDeviceConnectGuide.js +51 -0
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +5 -5
- package/src/screens/AddNewGateway/ScanGatewayQR.js +11 -23
- package/src/screens/AddNewGateway/ScanModbusQR.js +75 -11
- package/src/screens/AddNewGateway/ScanWifiDeviceQR.js +19 -9
- package/src/screens/AddNewGateway/SelectDeviceSubUnit.js +26 -7
- package/src/screens/AddNewGateway/SelectDeviceType.js +8 -1
- package/src/screens/AddNewGateway/SelectZigbeeGateway.js +1 -1
- package/src/screens/AddNewGateway/ShareWifiPassword.js +1 -2
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +6 -6
- package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +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 +8 -10
- package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +9 -11
- package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +4 -3
- 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 +3 -3
- 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/InvalidQRCode/index.js +33 -0
- package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +7 -7
- package/src/screens/ScanChipQR/components/QRScan/index.js +7 -5
- 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 -1
- 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 +11 -1
- package/src/utils/I18n/translations/vi.json +11 -1
- package/src/utils/Route/index.js +3 -0
- 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
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="70" height="70" viewBox="0 0 70 70" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M35 67C52.6731 67 67 52.6731 67 35C67 17.3269 52.6731 3 35 3C17.3269 3 3 17.3269 3 35C3 52.6731 17.3269 67 35 67ZM35 70C54.33 70 70 54.33 70 35C70 15.67 54.33 0 35 0C15.67 0 0 15.67 0 35C0 54.33 15.67 70 35 70Z" fill="#00979D"/>
|
|
3
|
+
<path d="M34.0401 34.9093C34.0401 36.8684 33.6732 38.5463 32.9393 39.9431C32.2113 41.3339 31.217 42.3993 29.9563 43.1391C28.7016 43.8789 27.2782 44.2488 25.6861 44.2488C24.094 44.2488 22.6676 43.8789 21.407 43.1391C20.1522 42.3933 19.1579 41.325 18.424 39.9342C17.696 38.5374 17.332 36.8624 17.332 34.9093C17.332 32.9503 17.696 31.2753 18.424 29.8845C19.1579 28.4877 20.1522 27.4194 21.407 26.6796C22.6676 25.9397 24.094 25.5698 25.6861 25.5698C27.2782 25.5698 28.7016 25.9397 29.9563 26.6796C31.217 27.4194 32.2113 28.4877 32.9393 29.8845C33.6732 31.2753 34.0401 32.9503 34.0401 34.9093ZM30.7287 34.9093C30.7287 33.5303 30.5127 32.3673 30.0806 31.4203C29.6545 30.4674 29.0626 29.7483 28.305 29.263C27.5475 28.7718 26.6745 28.5261 25.6861 28.5261C24.6977 28.5261 23.8247 28.7718 23.0671 29.263C22.3095 29.7483 21.7147 30.4674 21.2827 31.4203C20.8565 32.3673 20.6435 33.5303 20.6435 34.9093C20.6435 36.2883 20.8565 37.4543 21.2827 38.4072C21.7147 39.3542 22.3095 40.0733 23.0671 40.5645C23.8247 41.0498 24.6977 41.2925 25.6861 41.2925C26.6745 41.2925 27.5475 41.0498 28.305 40.5645C29.0626 40.0733 29.6545 39.3542 30.0806 38.4072C30.5127 37.4543 30.7287 36.2883 30.7287 34.9093Z" fill="#00979D"/>
|
|
4
|
+
<path d="M52.0954 25.8184V44.0002H49.1657L40.5986 31.6156H40.4477V44.0002H37.154V25.8184H40.1015L48.6597 38.2119H48.8195V25.8184H52.0954Z" fill="#00979D"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="133" height="59" viewBox="0 0 133 59" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M127.202 34.4313C128.51 34.4315 129.8 34.3786 131.002 33.7424C131.461 33.2829 131.885 32.8588 132.345 32.3639C133.228 30.7026 133.21 29.0234 132.344 27.3441L131.018 26.0183C129.799 25.3995 128.508 25.3463 127.2 25.3461C122.033 25.3543 116.866 25.3536 111.699 25.353L111.691 25.353C106.521 25.3523 101.35 25.3516 96.1801 25.3598C95.9524 25.3598 95.7173 25.4111 95.4419 25.4712C95.2898 25.5044 95.1252 25.5403 94.9428 25.5717C94.9528 25.0269 94.9657 24.5051 94.9782 23.9998L94.9783 23.9992C95.0095 22.7342 95.0383 21.5724 95.0129 20.4105C94.9064 17.1936 92.4138 14.6303 89.1969 14.5946C85.7827 14.5447 82.3772 14.5553 78.9682 14.566H78.968L78.9673 14.566L78.9667 14.566L78.966 14.566L78.9654 14.566L78.9647 14.566L78.964 14.566L78.9634 14.566L78.9627 14.5661C77.5026 14.5706 76.0418 14.5752 74.5794 14.575C73.4481 14.5749 72.9356 15.1227 72.9181 16.2716C72.9065 16.8662 72.9257 17.4608 72.9452 18.0656C72.9553 18.3777 72.9654 18.6924 72.9715 19.0113C70.9035 18.9934 68.9945 18.9931 67.0856 18.9929C65.4064 19.0103 64.0455 19.6995 63.1619 21.1488C61.3241 24.1887 63.3749 27.9361 66.963 28.025C68.271 28.0605 69.579 28.0332 70.887 28.0058C71.541 27.9922 72.1949 27.9785 72.8489 27.9727C72.849 28.6342 72.8446 29.264 72.8402 29.8851L72.8402 29.8884L72.8402 29.8884L72.8402 29.8895C72.8359 30.495 72.8317 31.0921 72.8317 31.7022C72.6949 31.7022 72.5539 31.7063 72.4088 31.7106L72.4079 31.7106L72.4075 31.7106L72.4072 31.7106H72.4072H72.4071C72.2529 31.7151 72.0939 31.7198 71.9303 31.7198C71.5144 31.7197 71.0995 31.7185 70.6853 31.7174H70.6852H70.6852H70.6851H70.6851H70.685H70.685H70.6849H70.6849C69.4444 31.7139 68.2089 31.7105 66.9635 31.7368C64.3476 31.8072 62.4036 33.8572 62.4923 36.3848C62.5633 38.8594 64.4901 40.7156 67.0707 40.7512C68.2884 40.7735 69.4992 40.7612 70.703 40.7489C71.4213 40.7415 72.1372 40.7342 72.8506 40.7343C72.8614 40.8313 72.8722 40.8757 72.8789 40.9036C72.8833 40.9215 72.886 40.9326 72.886 40.9464C72.9037 41.7418 72.9038 42.5195 72.9039 43.2973C72.9218 44.6583 73.4168 45.1886 74.7601 45.1888C76.3024 45.189 77.8428 45.1911 79.382 45.1932L79.3842 45.1932H79.3865H79.3887L79.4166 45.1932L79.438 45.1933L79.4593 45.1933H79.4613C82.5876 45.1976 85.7087 45.202 88.8297 45.1906C92.4708 45.1911 94.9981 42.6285 95.033 38.9873C95.0441 38.032 95.0266 37.0767 95.0078 36.0486L95.0078 36.0474C94.997 35.4591 94.9858 34.8469 94.9793 34.1973C95.1655 34.226 95.3372 34.2634 95.5003 34.2989C95.7397 34.351 95.9605 34.399 96.1813 34.4096C101.351 34.4191 106.521 34.4198 111.691 34.4204C116.861 34.4211 122.031 34.4218 127.202 34.4313ZM76.6686 42.1488C76.4565 42.1488 76.2444 42.1488 76.0147 42.1311C76.0136 33.9297 76.0125 25.8344 76.0291 17.6507C76.1487 17.6507 76.2847 17.6425 76.4252 17.634L76.4255 17.634C76.5759 17.6249 76.7314 17.6154 76.8776 17.6155C78.1681 17.6156 79.4607 17.6139 80.7545 17.6121L80.7634 17.6121L80.767 17.612L80.7679 17.612L80.769 17.612L80.7741 17.612C83.3721 17.6085 85.9754 17.6049 88.5787 17.617C90.7351 17.6173 91.9725 18.8547 91.9728 21.0464L91.9751 38.7572C91.9754 40.9489 90.8089 42.1507 88.6526 42.1504L76.6687 42.1488H76.6686ZM95.3067 31.3678C95.2362 31.3595 95.1694 31.3516 95.1027 31.3516C95.1202 30.3796 95.1201 29.4253 95.1199 28.365L95.1199 28.3645L95.1258 28.3645C98.3584 28.3826 101.591 28.4007 104.841 28.4011L127.784 28.4041C128.049 28.3864 128.332 28.3865 128.615 28.4219C129.481 28.5457 130.011 29.1467 129.958 29.9421C129.905 30.7728 129.446 31.2323 128.615 31.356C128.438 31.3913 128.226 31.3913 128.05 31.3912L95.5622 31.387C95.4689 31.387 95.3855 31.3771 95.3067 31.3678ZM72.8835 21.9984H72.8835C72.863 22.6147 72.8366 23.1891 72.8111 23.7426L72.8111 23.7436C72.7927 24.1423 72.7749 24.5301 72.7602 24.9149C72.4677 24.9202 72.1732 24.926 71.877 24.9318C70.2397 24.9641 68.5506 24.9973 66.8743 24.9671C66.0435 24.9493 65.4778 24.2422 65.5131 23.4645C65.5306 22.6338 66.1138 22.0506 67.0506 22.033C68.9594 21.9979 70.8682 21.9982 72.8831 21.9984H72.8831H72.8832H72.8832H72.8833H72.8833H72.8834H72.8834H72.8835ZM70.5785 34.8483C71.3364 34.8626 72.0982 34.877 72.8675 34.8838C72.8617 35.1842 72.8578 35.4867 72.8539 35.7891C72.8461 36.394 72.8383 36.9989 72.8148 37.5881L72.4526 37.5978L71.9783 37.6109C70.2556 37.6585 68.5216 37.7063 66.7875 37.6757C65.9921 37.6579 65.5148 37.0392 65.5324 36.2085C65.5323 35.3954 66.0271 34.8299 66.8579 34.8123C68.0992 34.8015 69.3338 34.8248 70.5785 34.8483ZM34.2029 34.3223C34.3625 34.2948 34.5334 34.2653 34.724 34.2425C34.7241 34.863 34.722 35.4522 34.7201 36.0222L34.7201 36.0232C34.7164 37.1088 34.7129 38.1249 34.7246 39.1562C34.7958 42.6206 37.3237 45.1839 40.7881 45.2197C45.5251 45.2557 50.2797 45.2386 55.0344 45.2215C56.307 45.2217 56.8372 44.6915 56.8371 43.3835C56.8367 40.392 56.8382 37.4024 56.8398 34.4141V34.4049V34.4049V34.4048V34.4048V34.4047V34.4046V34.4046V34.4045V34.4044C56.843 28.4267 56.8461 22.4542 56.8336 16.4816C56.8334 15.1383 56.3207 14.6256 54.942 14.6255C50.2934 14.6072 45.6271 14.6066 40.9785 14.6237C37.2667 14.6232 34.7218 17.1681 34.7046 20.8622C34.7048 22.347 34.7226 23.8494 34.7582 25.5816C34.5829 25.5565 34.4253 25.527 34.2776 25.4993C34.0084 25.4489 33.772 25.4047 33.5209 25.4047C24.4213 25.3858 15.3393 25.3846 6.2573 25.3834L6.24781 25.3834L6.2477 25.3834C5.75282 25.3834 5.25795 25.3833 4.76309 25.4539C1.75833 25.9131 0.044255 29.2535 1.47631 31.958C2.39566 33.6904 3.93351 34.4152 5.8778 34.4155C10.4999 34.4073 15.122 34.4079 19.7441 34.4085L19.7452 34.4085H19.7515L19.7558 34.4085L19.7579 34.4085C24.3754 34.4091 28.9929 34.4097 33.6105 34.4014C33.8014 34.3914 33.9924 34.3585 34.2029 34.3223ZM53.3192 17.6115L53.3192 17.6115C53.4388 17.6162 53.5493 17.6206 53.6345 17.6301V17.6383C53.6355 25.8016 53.6366 33.9295 53.62 42.0751C53.5614 42.0751 53.4846 42.0812 53.3947 42.0883C53.2675 42.0983 53.114 42.1104 52.9483 42.1104C49.0421 42.1276 45.1358 42.1447 41.2295 42.1266C38.9671 42.1263 37.7473 40.9065 37.747 38.6794L37.7447 20.9687C37.7445 18.7769 38.9286 17.5928 41.0849 17.5931C43.7375 17.5817 46.3901 17.586 49.0375 17.5902L49.0445 17.5902C50.3639 17.5924 51.682 17.5945 52.9981 17.5947C53.1049 17.6029 53.2154 17.6073 53.3191 17.6114L53.3192 17.6115ZM5.62956 28.4058L34.6879 28.4096C34.6703 29.4167 34.6704 30.3355 34.6706 31.3249L34.6706 31.325L34.6706 31.3261C34.5824 31.3319 34.4962 31.3397 34.41 31.3476L34.4094 31.3476C34.2365 31.3633 34.0637 31.379 33.8752 31.379L6.23092 31.3754C6.03649 31.393 5.85973 31.393 5.6653 31.3753C4.60478 31.3398 3.98606 30.7564 4.00362 29.855C4.02118 28.9536 4.6044 28.4057 5.62956 28.4058ZM57.9637 8.13901C58.1405 8.31578 58.3192 8.49059 58.4979 8.66541C58.8554 9.01503 59.2129 9.36466 59.5547 9.73C60.1734 10.3841 60.1735 11.1971 59.5903 11.8157C58.9894 12.4519 58.1057 12.4872 57.4339 11.8508C56.3556 10.8078 55.3126 9.76479 54.2696 8.68646C53.6332 8.01471 53.6508 7.14862 54.287 6.54774C54.8879 5.98221 55.7186 5.96464 56.3727 6.58337C56.7964 6.95408 57.1804 7.34463 57.5693 7.74015L57.5695 7.7404L57.5698 7.74066L57.5701 7.74092L57.5703 7.74117L57.5706 7.74142L57.5708 7.74169L57.5711 7.74195C57.7008 7.87393 57.8312 8.00647 57.9637 8.13901ZM73.3279 10.8139C73.5026 10.6352 73.6774 10.4565 73.8541 10.2798C74.0322 10.1017 74.2122 9.92567 74.3909 9.75092C74.7443 9.40535 75.0924 9.06496 75.4094 8.72456C76.0633 8.03531 76.0455 7.16921 75.4091 6.56816C74.8257 5.9848 73.9773 5.98469 73.3411 6.58557C72.263 7.62828 71.2203 8.67099 70.1776 9.74905C69.5237 10.4383 69.5415 11.3044 70.1779 11.9054C70.7789 12.4711 71.6273 12.4712 72.2635 11.8704C72.6288 11.5287 72.9783 11.1713 73.3279 10.8139ZM71.7031 51.5692C71.5316 51.3976 71.36 51.23 71.1891 51.0631L71.1889 51.0629C70.8492 50.731 70.5121 50.4017 70.1828 50.0489C69.5464 49.3771 69.564 48.5111 70.1825 47.8925C70.7834 47.327 71.6142 47.3094 72.2682 47.9281C73.3466 48.9711 74.3896 50.0141 75.4325 51.0924C76.0689 51.7642 76.0514 52.6303 75.4328 53.2488C74.8319 53.8143 74.0189 53.8142 73.3471 53.2132L73.2764 53.1425L71.7031 51.5692ZM56.4247 48.9499L56.4246 48.95L56.4245 48.9501L56.4244 48.9502C56.2576 49.1209 56.0901 49.2923 55.9187 49.4637C55.7368 49.6457 55.5509 49.8277 55.3643 50.0103C54.9893 50.3775 54.6115 50.7473 54.2575 51.125C53.6743 51.7789 53.6744 52.6273 54.2577 53.2107C54.8411 53.7941 55.7072 53.8472 56.3434 53.2463C57.4392 52.186 58.5172 51.1079 59.5776 50.0122C60.1785 49.3759 60.1607 48.5098 59.5773 47.9265C58.9763 47.2901 58.1279 47.29 57.4386 47.9439C57.0859 48.2731 56.7567 48.6101 56.4249 48.9497L56.4247 48.9499ZM66.0227 1.06991C66.0732 1.26605 66.1254 1.4391 66.1732 1.5975C66.2762 1.93871 66.3587 2.21194 66.3588 2.50166C66.3943 3.80964 66.3944 5.11762 66.3593 6.42559C66.3417 7.43308 65.7232 8.08699 64.8394 8.08687C63.9556 8.08676 63.3723 7.43269 63.3368 6.40752C63.3016 5.07556 63.3185 3.76098 63.3358 2.41209V2.41206V2.41203V2.41199L63.3363 2.37754C63.3538 1.6882 63.6366 1.08727 64.3082 0.945956C64.6995 0.867739 65.1198 0.933931 65.5547 1.00243L65.5547 1.00244L65.5547 1.00244L65.5547 1.00245C65.7091 1.02676 65.8653 1.05137 66.0227 1.06991ZM65.4472 58.815C65.6085 58.7848 65.765 58.7555 65.9065 58.7446C65.982 58.5593 66.0654 58.4034 66.1393 58.2653L66.1393 58.2653C66.2557 58.0478 66.3483 57.8748 66.3483 57.7018C66.3518 57.5432 66.3555 57.3848 66.3591 57.2265L66.3593 57.2214L66.3594 57.2163C66.3925 55.7905 66.4254 54.3759 66.33 52.9471C66.2945 52.1341 65.6405 51.6921 64.8274 51.7273C64.0143 51.7626 63.4488 52.2574 63.4136 53.0705C63.3431 54.5906 63.3256 56.1283 63.4318 57.6484C63.4496 58.0903 63.9799 58.656 64.4041 58.8328C64.6977 58.9552 65.0845 58.8828 65.4472 58.815ZM86.0882 30.9616C85.4871 30.3605 85.487 29.4768 86.0525 28.8759C86.6358 28.2573 87.5372 28.2397 88.1382 28.8054C88.7746 29.4065 88.7924 30.3433 88.1739 30.9618C87.5907 31.545 86.6892 31.5273 86.0882 30.9616ZM42.6421 30.9559C43.2255 31.5393 44.1269 31.5217 44.7278 30.9208C45.311 30.3376 45.3109 29.4538 44.7275 28.8351C44.1265 28.2341 43.2604 28.2163 42.6418 28.7995C42.0056 29.4004 42.0057 30.3549 42.6421 30.9559Z" fill="#00979D"/>
|
|
3
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -90,10 +90,10 @@ describe('Test ItemQuickAction', () => {
|
|
|
90
90
|
alignItems: 'center',
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
it('render with no action', async () => {
|
|
94
94
|
const newSensor = await factory.build('Sensor');
|
|
95
|
-
act(() => {
|
|
96
|
-
tree = create(<ItemQuickAction sensor={newSensor} />);
|
|
95
|
+
await act(async () => {
|
|
96
|
+
tree = await create(<ItemQuickAction sensor={newSensor} />);
|
|
97
97
|
});
|
|
98
98
|
const instance = tree.root;
|
|
99
99
|
const buttonOnActionPress = instance.findAll(
|
|
@@ -105,11 +105,11 @@ describe('Test ItemQuickAction', () => {
|
|
|
105
105
|
expect(buttonOnActionPress).toHaveLength(0);
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
it('render with full action data case on and icon up', async () => {
|
|
109
109
|
const mockSetStatus = jest.fn();
|
|
110
110
|
sensor.action.icon = 'up';
|
|
111
|
-
act(() => {
|
|
112
|
-
tree = create(
|
|
111
|
+
await act(async () => {
|
|
112
|
+
tree = await create(
|
|
113
113
|
<ItemQuickAction
|
|
114
114
|
sensor={sensor}
|
|
115
115
|
wrapperStyle={style}
|
|
@@ -128,7 +128,7 @@ describe('Test ItemQuickAction', () => {
|
|
|
128
128
|
expect(buttonOnActionPress).toBeDefined();
|
|
129
129
|
|
|
130
130
|
mockSetState.mockClear();
|
|
131
|
-
act(() => {
|
|
131
|
+
await act(async () => {
|
|
132
132
|
buttonOnActionPress.props.onPress();
|
|
133
133
|
});
|
|
134
134
|
expect(mockSendRemoteControl).toBeCalled();
|
|
@@ -139,11 +139,11 @@ describe('Test ItemQuickAction', () => {
|
|
|
139
139
|
expect(mockSetState).toBeCalledWith(sensor.quick_action.off_action);
|
|
140
140
|
});
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
it('render with icon_outlined poweroff and action have allow_config_store_value_id', async () => {
|
|
143
143
|
const mockSetStatus = jest.fn();
|
|
144
144
|
sensor.action.icon = null;
|
|
145
|
-
act(() => {
|
|
146
|
-
tree = create(
|
|
145
|
+
await act(async () => {
|
|
146
|
+
tree = await create(
|
|
147
147
|
<ItemQuickAction
|
|
148
148
|
sensor={sensor}
|
|
149
149
|
wrapperStyle={style}
|
|
@@ -162,7 +162,7 @@ describe('Test ItemQuickAction', () => {
|
|
|
162
162
|
expect(buttonOnActionPress).toBeDefined();
|
|
163
163
|
|
|
164
164
|
mockSetState.mockClear();
|
|
165
|
-
act(() => {
|
|
165
|
+
await act(async () => {
|
|
166
166
|
buttonOnActionPress.props.onPress();
|
|
167
167
|
});
|
|
168
168
|
expect(mockSendRemoteControl).toBeCalledWith(
|
|
@@ -178,7 +178,7 @@ describe('Test ItemQuickAction', () => {
|
|
|
178
178
|
expect(mockSetState).toBeCalledWith(sensor.quick_action.off_action);
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
it('render case old version config', async () => {
|
|
182
182
|
const oldSensor = {
|
|
183
183
|
action: {
|
|
184
184
|
color: '#00979D',
|
|
@@ -198,8 +198,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
198
198
|
status: 'OFF',
|
|
199
199
|
status2: 'ON',
|
|
200
200
|
};
|
|
201
|
-
act(() => {
|
|
202
|
-
tree = create(
|
|
201
|
+
await act(async () => {
|
|
202
|
+
tree = await create(
|
|
203
203
|
<ItemQuickAction sensor={oldSensor} wrapperStyle={style} />
|
|
204
204
|
);
|
|
205
205
|
});
|
|
@@ -213,7 +213,7 @@ describe('Test ItemQuickAction', () => {
|
|
|
213
213
|
);
|
|
214
214
|
|
|
215
215
|
mockSetState.mockClear();
|
|
216
|
-
act(() => {
|
|
216
|
+
await act(async () => {
|
|
217
217
|
buttonOnActionPress.props.onPress();
|
|
218
218
|
});
|
|
219
219
|
expect(mockSetState).toBeCalledTimes(1);
|
|
@@ -222,10 +222,12 @@ describe('Test ItemQuickAction', () => {
|
|
|
222
222
|
expect(mockSetState).toBeCalledTimes(3);
|
|
223
223
|
});
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
it('when sending command, button is disabled', async () => {
|
|
226
226
|
useState.mockImplementationOnce((init) => [true, mockSetState]);
|
|
227
|
-
act(() => {
|
|
228
|
-
tree = create(
|
|
227
|
+
await act(async () => {
|
|
228
|
+
tree = await create(
|
|
229
|
+
<ItemQuickAction sensor={sensor} wrapperStyle={style} />
|
|
230
|
+
);
|
|
229
231
|
});
|
|
230
232
|
|
|
231
233
|
const instance = tree.root;
|
|
@@ -238,11 +240,13 @@ describe('Test ItemQuickAction', () => {
|
|
|
238
240
|
expect(buttonOnActionPress).toBeDefined();
|
|
239
241
|
});
|
|
240
242
|
|
|
241
|
-
|
|
243
|
+
it('click quick action icon down , isSendingCommand = true', async () => {
|
|
242
244
|
sensor.action.icon = 'down';
|
|
243
245
|
useState.mockImplementationOnce((init) => [true, mockSetState]);
|
|
244
|
-
act(() => {
|
|
245
|
-
tree = create(
|
|
246
|
+
await act(async () => {
|
|
247
|
+
tree = await create(
|
|
248
|
+
<ItemQuickAction sensor={sensor} wrapperStyle={style} />
|
|
249
|
+
);
|
|
246
250
|
});
|
|
247
251
|
|
|
248
252
|
const instance = tree.root;
|
|
@@ -254,7 +258,7 @@ describe('Test ItemQuickAction', () => {
|
|
|
254
258
|
);
|
|
255
259
|
expect(buttonOnActionPress).toBeDefined();
|
|
256
260
|
});
|
|
257
|
-
|
|
261
|
+
it('trigger action with quick action no auto update', async () => {
|
|
258
262
|
const noAutoUpdateSensor = {
|
|
259
263
|
action: {
|
|
260
264
|
name: 'on',
|
|
@@ -289,8 +293,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
289
293
|
},
|
|
290
294
|
};
|
|
291
295
|
|
|
292
|
-
act(() => {
|
|
293
|
-
tree = create(
|
|
296
|
+
await act(async () => {
|
|
297
|
+
tree = await create(
|
|
294
298
|
<ItemQuickAction sensor={noAutoUpdateSensor} wrapperStyle={style} />
|
|
295
299
|
);
|
|
296
300
|
});
|
|
@@ -304,7 +308,7 @@ describe('Test ItemQuickAction', () => {
|
|
|
304
308
|
);
|
|
305
309
|
|
|
306
310
|
mockSetState.mockClear();
|
|
307
|
-
act(() => {
|
|
311
|
+
await act(async () => {
|
|
308
312
|
buttonOnActionPress.props.onPress();
|
|
309
313
|
});
|
|
310
314
|
expect(mockSendRemoteControl).toBeCalledWith(
|
|
@@ -319,12 +323,12 @@ describe('Test ItemQuickAction', () => {
|
|
|
319
323
|
expect(mockSetState).toBeCalledTimes(1);
|
|
320
324
|
});
|
|
321
325
|
|
|
322
|
-
|
|
326
|
+
it('render with full action data case off', async () => {
|
|
323
327
|
sensor.action.id = 10; // off action
|
|
324
328
|
const mockSetStatus = jest.fn();
|
|
325
329
|
|
|
326
|
-
act(() => {
|
|
327
|
-
tree = create(
|
|
330
|
+
await act(async () => {
|
|
331
|
+
tree = await create(
|
|
328
332
|
<ItemQuickAction
|
|
329
333
|
sensor={sensor}
|
|
330
334
|
wrapperStyle={style}
|
|
@@ -342,7 +346,7 @@ describe('Test ItemQuickAction', () => {
|
|
|
342
346
|
);
|
|
343
347
|
|
|
344
348
|
mockSetState.mockClear();
|
|
345
|
-
act(() => {
|
|
349
|
+
await act(async () => {
|
|
346
350
|
buttonOnActionPress.props.onPress();
|
|
347
351
|
});
|
|
348
352
|
|
|
@@ -350,14 +354,14 @@ describe('Test ItemQuickAction', () => {
|
|
|
350
354
|
expect(mockSetState).toBeCalledWith(sensor.quick_action.on_action);
|
|
351
355
|
});
|
|
352
356
|
|
|
353
|
-
|
|
357
|
+
it('listen to config value for update action', async () => {
|
|
354
358
|
const globalStates = require('../../../iot/states');
|
|
355
359
|
globalStates.useConfigGlobalState = () => [{ 51: { value: true } }, null];
|
|
356
360
|
|
|
357
361
|
const mockSetStatus = jest.fn();
|
|
358
362
|
|
|
359
|
-
act(() => {
|
|
360
|
-
tree = create(
|
|
363
|
+
await act(async () => {
|
|
364
|
+
tree = await create(
|
|
361
365
|
<ItemQuickAction
|
|
362
366
|
sensor={sensor}
|
|
363
367
|
wrapperStyle={style}
|
|
@@ -11,68 +11,106 @@ import ColorPicker from 'react-native-wheel-color-picker';
|
|
|
11
11
|
import { useConfigGlobalState } from '../../iot/states';
|
|
12
12
|
import { SCContext } from '../../context';
|
|
13
13
|
import { Action } from '../../context/actionType';
|
|
14
|
+
import { DEVICE_TYPE } from '../../configs/Constants';
|
|
14
15
|
|
|
15
|
-
const WheelColorPicker = ({
|
|
16
|
+
const WheelColorPicker = ({ color, onChangeColorComplete, onStart }) => {
|
|
17
|
+
const regex = /^#([0-9a-f]{3}){1,2}$/i;
|
|
18
|
+
const isCheckHex = regex.test(color);
|
|
19
|
+
// check crash if valueColor value wrong
|
|
20
|
+
if (!isCheckHex) {
|
|
21
|
+
return (
|
|
22
|
+
<ColorPicker
|
|
23
|
+
style={styles.colorPicker}
|
|
24
|
+
sliderHidden={true}
|
|
25
|
+
swatches={false}
|
|
26
|
+
onInteractionStart={onStart}
|
|
27
|
+
onColorChangeComplete={onChangeColorComplete}
|
|
28
|
+
thumbSize={16}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
16
32
|
return (
|
|
17
33
|
<ColorPicker
|
|
18
34
|
style={styles.colorPicker}
|
|
19
35
|
sliderHidden={true}
|
|
20
36
|
swatches={false}
|
|
21
|
-
color={
|
|
37
|
+
color={color}
|
|
22
38
|
onInteractionStart={onStart}
|
|
23
|
-
onColorChangeComplete={
|
|
39
|
+
onColorChangeComplete={onChangeColorComplete}
|
|
24
40
|
thumbSize={16}
|
|
25
41
|
/>
|
|
26
42
|
);
|
|
27
43
|
};
|
|
28
44
|
|
|
29
|
-
let
|
|
45
|
+
let hexColorTemp = '#fff';
|
|
30
46
|
const ColorPickerTemplate = memo(({ actionGroup = {}, doAction, sensor }) => {
|
|
31
47
|
const { configuration = {} } = actionGroup;
|
|
32
|
-
const
|
|
48
|
+
const { config = undefined } = configuration;
|
|
33
49
|
const [configValues] = useConfigGlobalState('configValues');
|
|
50
|
+
|
|
51
|
+
const getColor = useCallback(() => {
|
|
52
|
+
if (config) {
|
|
53
|
+
const configValue = configValues[config] || {};
|
|
54
|
+
const { value = 0 } = configValue;
|
|
55
|
+
if (value) {
|
|
56
|
+
return `#${value?.toString(16)}`;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return '#fff';
|
|
60
|
+
}, [config, configValues]);
|
|
61
|
+
|
|
62
|
+
const [valueColorComplete, setValueColorComplete] = useState(getColor());
|
|
63
|
+
const [isChangeColor, setIsChangeColor] = useState(false);
|
|
64
|
+
const [isFirstTime, setIsFirstTime] = useState(true);
|
|
65
|
+
|
|
34
66
|
const { setAction } = useContext(SCContext);
|
|
35
67
|
|
|
36
|
-
const
|
|
68
|
+
const onChangeColorComplete = useCallback(
|
|
37
69
|
(color) => {
|
|
38
70
|
setAction(Action.SET_LOCK_VIEW_PICK_COLOR, false);
|
|
39
|
-
|
|
40
|
-
isFirstTime = false;
|
|
41
|
-
clearTimeout(to);
|
|
42
|
-
}, 1000);
|
|
43
|
-
|
|
44
|
-
!isFirstTime &&
|
|
71
|
+
if (isChangeColor) {
|
|
45
72
|
doAction(
|
|
46
73
|
configuration?.action_color_data,
|
|
47
74
|
JSON.stringify({ value: color })
|
|
48
75
|
);
|
|
76
|
+
setIsChangeColor(false);
|
|
77
|
+
}
|
|
49
78
|
},
|
|
50
79
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
51
|
-
[configuration?.action_color_data, doAction]
|
|
80
|
+
[configuration?.action_color_data, doAction, isChangeColor]
|
|
52
81
|
);
|
|
53
82
|
|
|
54
83
|
useEffect(() => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
84
|
+
hexColorTemp = valueColorComplete;
|
|
85
|
+
}, [valueColorComplete]);
|
|
86
|
+
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const configValue = configValues[config] || {};
|
|
89
|
+
const { value = 0 } = configValue;
|
|
90
|
+
const hexColor = `#${value?.toString(16)}`;
|
|
91
|
+
if (value && isFirstTime) {
|
|
92
|
+
setValueColorComplete(hexColor);
|
|
93
|
+
setIsFirstTime(false);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (sensor?.device_type !== DEVICE_TYPE.LG_THINQ) {
|
|
97
|
+
if (hexColorTemp !== hexColor) {
|
|
98
|
+
setValueColorComplete(hexColor);
|
|
99
|
+
}
|
|
59
100
|
}
|
|
60
101
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
102
|
}, [configValues]);
|
|
62
103
|
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
return () => (isFirstTime = true);
|
|
65
|
-
}, []);
|
|
66
|
-
|
|
67
104
|
const onStartPickColor = useCallback(() => {
|
|
105
|
+
setIsChangeColor(true);
|
|
68
106
|
setAction(Action.SET_LOCK_VIEW_PICK_COLOR, true);
|
|
69
107
|
}, [setAction]);
|
|
70
108
|
|
|
71
109
|
return (
|
|
72
110
|
<View style={styles.viewPickColor}>
|
|
73
111
|
<WheelColorPicker
|
|
74
|
-
|
|
75
|
-
|
|
112
|
+
color={valueColorComplete}
|
|
113
|
+
onChangeColorComplete={onChangeColorComplete}
|
|
76
114
|
onStart={onStartPickColor}
|
|
77
115
|
/>
|
|
78
116
|
</View>
|
|
@@ -39,9 +39,9 @@ describe('Test AutoLock', () => {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
it('render AutoLock', async () => {
|
|
43
43
|
await act(async () => {
|
|
44
|
-
tree = create(wrapComponent());
|
|
44
|
+
tree = await create(wrapComponent());
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
const instance = tree.root;
|
|
@@ -13,7 +13,7 @@ const wrapComponent = (route = {}) => (
|
|
|
13
13
|
|
|
14
14
|
describe('Test ItemPasscode', () => {
|
|
15
15
|
let tree;
|
|
16
|
-
|
|
16
|
+
it('test render without params', async () => {
|
|
17
17
|
await act(async () => {
|
|
18
18
|
tree = await create(wrapComponent());
|
|
19
19
|
});
|
|
@@ -54,9 +54,9 @@ describe('Test SetupGeneratePasscode', () => {
|
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
it('render SetupGeneratePasscode', async () => {
|
|
58
58
|
await act(async () => {
|
|
59
|
-
tree = create(wrapComponent());
|
|
59
|
+
tree = await create(wrapComponent());
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
const instance = tree.root;
|
|
@@ -7,15 +7,28 @@ import { Colors } from '../../configs';
|
|
|
7
7
|
import SvgBrightness from '../../../assets/images/brightness.svg';
|
|
8
8
|
import SliderRange from 'react-native-slider';
|
|
9
9
|
import { useConfigGlobalState } from '../../iot/states';
|
|
10
|
+
import { DEVICE_TYPE } from '../../configs/Constants';
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
let percentTemp = 0;
|
|
13
|
+
const SliderRangeTemplate = memo(({ actionGroup = {}, doAction, sensor }) => {
|
|
12
14
|
const t = useTranslations();
|
|
13
15
|
const { configuration = {} } = actionGroup;
|
|
14
|
-
const [valueBrightness, setValueBrightness] = useState(0);
|
|
15
|
-
const [valueBrightnessTemp, setValueBrightnessTemp] = useState(0);
|
|
16
|
-
const [isFirstTime, setIsFirstTime] = useState(true);
|
|
17
|
-
|
|
18
16
|
const [configValues] = useConfigGlobalState('configValues');
|
|
17
|
+
const { config = undefined } = configuration;
|
|
18
|
+
|
|
19
|
+
const getPercent = useCallback(() => {
|
|
20
|
+
if (config) {
|
|
21
|
+
const configValue = configValues[config] || {};
|
|
22
|
+
const { value = 0 } = configValue;
|
|
23
|
+
if (value) {
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return 0;
|
|
28
|
+
}, [config, configValues]);
|
|
29
|
+
|
|
30
|
+
const [valueBrightness, setValueBrightness] = useState(getPercent());
|
|
31
|
+
const [isFirstTime, setIsFirstTime] = useState(true);
|
|
19
32
|
|
|
20
33
|
const onChangeBrightness = useCallback(
|
|
21
34
|
async (value) => {
|
|
@@ -23,28 +36,30 @@ const SliderRangeTemplate = memo(({ actionGroup = {}, doAction }) => {
|
|
|
23
36
|
configuration?.action_brightness_data,
|
|
24
37
|
JSON.stringify({ value_brness: value })
|
|
25
38
|
);
|
|
26
|
-
await setValueBrightness(value);
|
|
27
|
-
await setValueBrightnessTemp(value);
|
|
28
39
|
},
|
|
29
40
|
[configuration?.action_brightness_data, doAction]
|
|
30
41
|
);
|
|
31
42
|
|
|
32
43
|
useEffect(() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
percentTemp = valueBrightness;
|
|
45
|
+
}, [valueBrightness]);
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
const configValue = configValues[config] || {};
|
|
49
|
+
const { value = 0 } = configValue;
|
|
50
|
+
if (value && isFirstTime) {
|
|
51
|
+
setValueBrightness(value);
|
|
37
52
|
setIsFirstTime(false);
|
|
38
|
-
|
|
39
|
-
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (sensor?.device_type !== DEVICE_TYPE.LG_THINQ) {
|
|
56
|
+
if (percentTemp !== value) {
|
|
57
|
+
setValueBrightness(value);
|
|
58
|
+
}
|
|
59
|
+
percentTemp = value;
|
|
40
60
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
configValues,
|
|
44
|
-
configuration,
|
|
45
|
-
isFirstTime,
|
|
46
|
-
valueBrightnessTemp,
|
|
47
|
-
]);
|
|
61
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
|
+
}, [configValues]);
|
|
48
63
|
|
|
49
64
|
return (
|
|
50
65
|
<View style={styles.viewBrightness}>
|
|
@@ -32,7 +32,7 @@ const wrapComponent = (
|
|
|
32
32
|
describe('Test CircleButton', () => {
|
|
33
33
|
let wrapper;
|
|
34
34
|
let type;
|
|
35
|
-
|
|
35
|
+
it('render CircleButton small', async () => {
|
|
36
36
|
type = 'small';
|
|
37
37
|
const mockOnPress = jest.fn();
|
|
38
38
|
await act(async () => {
|
|
@@ -43,7 +43,7 @@ describe('Test CircleButton', () => {
|
|
|
43
43
|
const smallButton = instance.findAllByType(TouchableOpacity);
|
|
44
44
|
expect(smallButton).toHaveLength(1);
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
it('render CircleButton icon null', async () => {
|
|
47
47
|
type = 'small';
|
|
48
48
|
const icon = <></>;
|
|
49
49
|
const mockOnPress = jest.fn();
|
|
@@ -55,7 +55,7 @@ describe('Test CircleButton', () => {
|
|
|
55
55
|
const smallButton = instance.findAllByType(TouchableOpacity);
|
|
56
56
|
expect(smallButton).toHaveLength(1);
|
|
57
57
|
});
|
|
58
|
-
|
|
58
|
+
it('onPress CircleButton small', async () => {
|
|
59
59
|
type = 'small';
|
|
60
60
|
const mockOnPress = jest.fn();
|
|
61
61
|
await act(async () => {
|
|
@@ -65,11 +65,11 @@ describe('Test CircleButton', () => {
|
|
|
65
65
|
|
|
66
66
|
const smallButton = instance.findAllByType(TouchableOpacity);
|
|
67
67
|
expect(smallButton).toHaveLength(1);
|
|
68
|
-
act(() => {
|
|
68
|
+
await act(async () => {
|
|
69
69
|
smallButton[0].props.onPress();
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
|
-
|
|
72
|
+
it('render CircleButton big', async () => {
|
|
73
73
|
type = 'big';
|
|
74
74
|
const mockOnPress = jest.fn();
|
|
75
75
|
await act(async () => {
|
|
@@ -80,7 +80,7 @@ describe('Test CircleButton', () => {
|
|
|
80
80
|
const touchableOpacity = instance.findAllByType(TouchableOpacity);
|
|
81
81
|
expect(touchableOpacity).toHaveLength(5);
|
|
82
82
|
});
|
|
83
|
-
|
|
83
|
+
it('render CircleButton return null', async () => {
|
|
84
84
|
type = null;
|
|
85
85
|
await act(async () => {
|
|
86
86
|
wrapper = await create(wrapComponent(type));
|
|
@@ -90,7 +90,7 @@ describe('Test CircleButton', () => {
|
|
|
90
90
|
const touchableOpacity = instance.findAllByType(TouchableOpacity);
|
|
91
91
|
expect(touchableOpacity).toHaveLength(0);
|
|
92
92
|
});
|
|
93
|
-
|
|
93
|
+
it('onPress CircleButton big', async () => {
|
|
94
94
|
type = 'big';
|
|
95
95
|
const mockOnPress = jest.fn();
|
|
96
96
|
await act(async () => {
|
|
@@ -110,19 +110,19 @@ describe('Test CircleButton', () => {
|
|
|
110
110
|
|
|
111
111
|
const touchableOpacity = instance.findAllByType(TouchableOpacity);
|
|
112
112
|
expect(touchableOpacity).toHaveLength(5);
|
|
113
|
-
act(() => {
|
|
113
|
+
await act(async () => {
|
|
114
114
|
touchableOpacity[0].props.onPress();
|
|
115
115
|
});
|
|
116
|
-
act(() => {
|
|
116
|
+
await act(async () => {
|
|
117
117
|
touchableOpacity[1].props.onPress();
|
|
118
118
|
});
|
|
119
|
-
act(() => {
|
|
119
|
+
await act(async () => {
|
|
120
120
|
touchableOpacity[2].props.onPress();
|
|
121
121
|
});
|
|
122
|
-
act(() => {
|
|
122
|
+
await act(async () => {
|
|
123
123
|
touchableOpacity[3].props.onPress();
|
|
124
124
|
});
|
|
125
|
-
act(() => {
|
|
125
|
+
await act(async () => {
|
|
126
126
|
touchableOpacity[4].props.onPress();
|
|
127
127
|
});
|
|
128
128
|
});
|
|
@@ -18,7 +18,7 @@ const wrapComponent = (onPressPrev, onPressStop, onPressNext) => (
|
|
|
18
18
|
|
|
19
19
|
describe('Test ControlPlay', () => {
|
|
20
20
|
let wrapper;
|
|
21
|
-
|
|
21
|
+
it('render ControlPlay', async () => {
|
|
22
22
|
const mockOnPress = jest.fn();
|
|
23
23
|
await act(async () => {
|
|
24
24
|
wrapper = await create(
|
|
@@ -30,7 +30,7 @@ describe('Test ControlPlay', () => {
|
|
|
30
30
|
const prevButton = instance.findAllByType(TouchableOpacity);
|
|
31
31
|
expect(prevButton).toHaveLength(3);
|
|
32
32
|
});
|
|
33
|
-
|
|
33
|
+
it('render ControlPlay Prev', async () => {
|
|
34
34
|
const mockOnPress = jest.fn();
|
|
35
35
|
await act(async () => {
|
|
36
36
|
wrapper = await create(
|
|
@@ -47,7 +47,7 @@ describe('Test ControlPlay', () => {
|
|
|
47
47
|
);
|
|
48
48
|
expect(PrevButton).toBeDefined();
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
it('OnPress ControlPlay Prev', async () => {
|
|
51
51
|
const mockOnPress = jest.fn();
|
|
52
52
|
await act(async () => {
|
|
53
53
|
wrapper = await create(
|
|
@@ -63,11 +63,11 @@ describe('Test ControlPlay', () => {
|
|
|
63
63
|
el.type === TouchableOpacity
|
|
64
64
|
);
|
|
65
65
|
expect(PrevButton).toBeDefined();
|
|
66
|
-
act(() => {
|
|
66
|
+
await act(async () => {
|
|
67
67
|
PrevButton.props.onPress();
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
|
-
|
|
70
|
+
it('render ControlPlay Stop', async () => {
|
|
71
71
|
const mockOnPress = jest.fn();
|
|
72
72
|
await act(async () => {
|
|
73
73
|
wrapper = await create(
|
|
@@ -84,7 +84,7 @@ describe('Test ControlPlay', () => {
|
|
|
84
84
|
);
|
|
85
85
|
expect(StopButton).toBeDefined();
|
|
86
86
|
});
|
|
87
|
-
|
|
87
|
+
it('OnPress ControlPlay Stop', async () => {
|
|
88
88
|
const mockOnPress = jest.fn();
|
|
89
89
|
await act(async () => {
|
|
90
90
|
wrapper = await create(
|
|
@@ -100,11 +100,11 @@ describe('Test ControlPlay', () => {
|
|
|
100
100
|
el.type === TouchableOpacity
|
|
101
101
|
);
|
|
102
102
|
expect(StopButton).toBeDefined();
|
|
103
|
-
act(() => {
|
|
103
|
+
await act(async () => {
|
|
104
104
|
StopButton.props.onPress();
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
|
-
|
|
107
|
+
it('render ControlPlay Next', async () => {
|
|
108
108
|
const mockOnPress = jest.fn();
|
|
109
109
|
await act(async () => {
|
|
110
110
|
wrapper = await create(
|
|
@@ -121,7 +121,7 @@ describe('Test ControlPlay', () => {
|
|
|
121
121
|
);
|
|
122
122
|
expect(NextButton).toBeDefined();
|
|
123
123
|
});
|
|
124
|
-
|
|
124
|
+
it('OnPress ControlPlay Next', async () => {
|
|
125
125
|
const mockOnPress = jest.fn();
|
|
126
126
|
await act(async () => {
|
|
127
127
|
wrapper = await create(
|
|
@@ -137,7 +137,7 @@ describe('Test ControlPlay', () => {
|
|
|
137
137
|
el.type === TouchableOpacity
|
|
138
138
|
);
|
|
139
139
|
expect(NextButton).toBeDefined();
|
|
140
|
-
act(() => {
|
|
140
|
+
await act(async () => {
|
|
141
141
|
NextButton.props.onPress();
|
|
142
142
|
});
|
|
143
143
|
});
|