@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/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
|
});
|
|
@@ -21,7 +21,7 @@ const wrapComponent = (type, onPress, onPressUp, onPressDown, icon) => (
|
|
|
21
21
|
describe('Test RectangleButton', () => {
|
|
22
22
|
let wrapper;
|
|
23
23
|
let type;
|
|
24
|
-
|
|
24
|
+
it('render all RectangleButton column', async () => {
|
|
25
25
|
type = 'column';
|
|
26
26
|
const mockOnPress = jest.fn();
|
|
27
27
|
await act(async () => {
|
|
@@ -33,7 +33,7 @@ describe('Test RectangleButton', () => {
|
|
|
33
33
|
const touchableOpacity = instance.findAllByType(TouchableOpacity);
|
|
34
34
|
expect(touchableOpacity).toHaveLength(2);
|
|
35
35
|
});
|
|
36
|
-
|
|
36
|
+
it('render RectangleButtonUp column', async () => {
|
|
37
37
|
type = 'column';
|
|
38
38
|
const mockOnPress = jest.fn();
|
|
39
39
|
await act(async () => {
|
|
@@ -51,7 +51,7 @@ describe('Test RectangleButton', () => {
|
|
|
51
51
|
);
|
|
52
52
|
expect(RectangleButtonUp).toBeDefined();
|
|
53
53
|
});
|
|
54
|
-
|
|
54
|
+
it('onPress RectangleButtonUp column', async () => {
|
|
55
55
|
type = 'column';
|
|
56
56
|
const mockOnPress = jest.fn();
|
|
57
57
|
await act(async () => {
|
|
@@ -68,11 +68,11 @@ describe('Test RectangleButton', () => {
|
|
|
68
68
|
el.type === TouchableOpacity
|
|
69
69
|
);
|
|
70
70
|
expect(RectangleButtonUp).toBeDefined();
|
|
71
|
-
act(() => {
|
|
71
|
+
await act(async () => {
|
|
72
72
|
RectangleButtonUp.props.onPress();
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
|
-
|
|
75
|
+
it('render RectangleButtonDown column', async () => {
|
|
76
76
|
type = 'column';
|
|
77
77
|
const mockOnPress = jest.fn();
|
|
78
78
|
await act(async () => {
|
|
@@ -90,7 +90,7 @@ describe('Test RectangleButton', () => {
|
|
|
90
90
|
);
|
|
91
91
|
expect(RectangleButtonDown).toBeDefined();
|
|
92
92
|
});
|
|
93
|
-
|
|
93
|
+
it('onPress RectangleButtonDown column', async () => {
|
|
94
94
|
type = 'column';
|
|
95
95
|
const mockOnPress = jest.fn();
|
|
96
96
|
await act(async () => {
|
|
@@ -107,7 +107,7 @@ describe('Test RectangleButton', () => {
|
|
|
107
107
|
el.type === TouchableOpacity
|
|
108
108
|
);
|
|
109
109
|
expect(RectangleButtonDown).toBeDefined();
|
|
110
|
-
act(() => {
|
|
110
|
+
await act(async () => {
|
|
111
111
|
RectangleButtonDown.props.onPress();
|
|
112
112
|
});
|
|
113
113
|
});
|