@eohjsc/react-native-smart-city 0.3.36 → 0.3.38

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.
Files changed (312) hide show
  1. package/package.json +1 -1
  2. package/src/commons/Action/__test__/ItemQuickAction.test.js +36 -32
  3. package/src/commons/ActionGroup/ColorPickerTemplate.js +61 -23
  4. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +2 -2
  5. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/ItemPasscode.test.js +1 -1
  6. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +1 -1
  7. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +2 -2
  8. package/src/commons/ActionGroup/SliderRangeTemplate.js +35 -20
  9. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/CircleButton.test.js +12 -12
  10. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/ControlPlay.test.js +10 -10
  11. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/RectangleButton.test.js +7 -7
  12. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/SmartTiviActionTemplate.test.js +23 -23
  13. package/src/commons/ActionGroup/StatesGridActionTemplate.js +1 -3
  14. package/src/commons/ActionGroup/__test__/ColorPickerTemplate.test.js +1 -1
  15. package/src/commons/ActionGroup/__test__/CurtainButtonTemplate.test.js +4 -4
  16. package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +14 -14
  17. package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +12 -12
  18. package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +2 -2
  19. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +10 -10
  20. package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +2 -2
  21. package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +7 -7
  22. package/src/commons/ActionGroup/__test__/SliderRangeTemplate.test.js +1 -1
  23. package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +2 -2
  24. package/src/commons/ActionGroup/__test__/ThreeButtonTemplate.test.js +2 -2
  25. package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +3 -3
  26. package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +2 -2
  27. package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +14 -14
  28. package/src/commons/ActionGroup/__test__/index.test.js +41 -41
  29. package/src/commons/ActionTemplate/OnOffButtonAction.js +6 -4
  30. package/src/commons/ActionTemplate/OnOffSimpleAction.js +9 -3
  31. package/src/commons/ActionTemplate/OnOffSmartLockAction.js +12 -10
  32. package/src/commons/ActionTemplate/__test__/OnOffButtonAction.test.js +3 -3
  33. package/src/commons/ActionTemplate/__test__/OnOffSimpleAction.test.js +3 -3
  34. package/src/commons/ActionTemplate/__test__/OneButtonAction.test.js +3 -3
  35. package/src/commons/ActionTemplate/__test__/ThreeButtonAction.test.js +3 -3
  36. package/src/commons/ActionTemplate/__test__/index.test.js +6 -6
  37. package/src/commons/ActionTemplate/index.js +15 -3
  38. package/src/commons/Alert/__test__/Alert.test.js +2 -2
  39. package/src/commons/AlertAction/__test__/AlertAction.test.js +2 -2
  40. package/src/commons/Auth/__test__/AccountItem.test.js +4 -4
  41. package/src/commons/Auth/__test__/AccountList.test.js +4 -4
  42. package/src/commons/Auth/__test__/OtpInputList.test.js +20 -16
  43. package/src/commons/Auth/__test__/SocialButton.test.js +6 -6
  44. package/src/commons/Automate/__test__/ItemAutomate.test.js +2 -2
  45. package/src/commons/Automate/__test__/ItemScriptAction.test.js +2 -2
  46. package/src/commons/BackDefault/__test__/BackDefault.test.js +2 -2
  47. package/src/commons/Button/__test__/Button.test.js +3 -3
  48. package/src/commons/ButtonPopup/__test__/ButtonPopup.test.js +2 -2
  49. package/src/commons/Calendar/__test__/Calendar.test.js +2 -2
  50. package/src/commons/ChartLoading/__test__/ChartLoading.test.js +2 -2
  51. package/src/commons/CircleButton/__test__/CircleButton.test.js +2 -2
  52. package/src/commons/CircleView/__test__/CircleView.test.js +2 -2
  53. package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +3 -3
  54. package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +2 -2
  55. package/src/commons/DateTimeRangeChange/__test__/DateTimeButton.test.js +4 -4
  56. package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +5 -5
  57. package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +2 -2
  58. package/src/commons/Device/Hanet/ItemHanetDevice.test.js +5 -5
  59. package/src/commons/Device/LinearChart/LinearChart.test.js +2 -2
  60. package/src/commons/Device/RainningSensor/__test__/CurrentRainSensor.test.js +6 -6
  61. package/src/commons/Device/SonosSpeaker/__test__/SonosSpeaker.test.js +8 -8
  62. package/src/commons/Device/WindDirection/Compass/Compass.test.js +4 -4
  63. package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +2 -2
  64. package/src/commons/Device/WindSpeed/LinearChart/__test__/ValueBalloon.test.js +2 -2
  65. package/src/commons/Device/WindSpeed/__test__/Anemometer.test.js +4 -4
  66. package/src/commons/Device/WindSpeed/__test__/ChartInfo.test.js +5 -5
  67. package/src/commons/Device/__test__/ConnectedViewHeader.test.js +6 -6
  68. package/src/commons/Device/__test__/DeviceAlertStatus.test.js +6 -6
  69. package/src/commons/Device/__test__/DisconnectedView.test.js +12 -12
  70. package/src/commons/Device/__test__/FlatListItems.test.js +2 -2
  71. package/src/commons/Device/__test__/FooterInfo.test.js +2 -2
  72. package/src/commons/Device/__test__/SensorConnectedStatus.test.js +2 -2
  73. package/src/commons/DisplayChecking/__test__/DisplayChecking.test.js +2 -2
  74. package/src/commons/Explore/SearchBox/__test__/SearchBox.test.js +6 -6
  75. package/src/commons/Explore/__test__/CityItem.test.js +6 -6
  76. package/src/commons/Explore/__test__/HeaderExplore.test.js +2 -2
  77. package/src/commons/Explore/__test__/HeaderLabel.test.js +3 -3
  78. package/src/commons/Explore/__test__/LocationItem.test.js +3 -3
  79. package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +4 -4
  80. package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +2 -2
  81. package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +1 -1
  82. package/src/commons/Form/__test__/CurrencyInput.test.js +12 -12
  83. package/src/commons/Form/__test__/TextInput.test.js +4 -4
  84. package/src/commons/Form/__test__/TextInputPassword.test.js +5 -5
  85. package/src/commons/FourButtonFilterHistory/__test__/FourButtonFilterHistory.test.js +1 -1
  86. package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +12 -10
  87. package/src/commons/Header/__test__/HeaderCT.test.js +11 -11
  88. package/src/commons/ImageButton/__test__/ImageButton.test.js +2 -2
  89. package/src/commons/ImagePicker/__test__/ImagePicker.test.js +8 -8
  90. package/src/commons/MediaPlayerDetail/__test__/MediaPlayerDetail.test.js +1 -1
  91. package/src/commons/MediaPlayerDetail/__test__/MediaPlayerFull.test.js +8 -8
  92. package/src/commons/MenuActionAddnew/__test__/MenuActionAddNew.test.js +3 -3
  93. package/src/commons/MenuActionList/__test__/MenuActionList.test.js +3 -3
  94. package/src/commons/MenuActionMore/__test__/MenuActionMore.test.js +2 -2
  95. package/src/commons/Modal/__test__/ModalBottom.test.js +4 -4
  96. package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +39 -13
  97. package/src/commons/OneTapTemplate/OptionsDropdownActionTemplate.js +33 -14
  98. package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +9 -4
  99. package/src/commons/OneTapTemplate/__test__/NumberUpDownActionTemplate.test.js +25 -12
  100. package/src/commons/OneTapTemplate/__test__/OptionsDropdownActionTemplate.test.js +13 -13
  101. package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +7 -7
  102. package/src/commons/PreventAccess/__test__/PreventAccess.test.js +7 -5
  103. package/src/commons/Processing/__test__/Connecting.test.js +61 -25
  104. package/src/commons/Processing/index.js +21 -7
  105. package/src/commons/RowItem/__test__/RowItem.test.js +2 -2
  106. package/src/commons/RowUser/__test__/RowUser.test.js +2 -2
  107. package/src/commons/SearchLocation/__test__/RowLocation.test.js +4 -4
  108. package/src/commons/Section/Section.test.js +4 -4
  109. package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +3 -3
  110. package/src/commons/SelectSubUnit/index.js +1 -1
  111. package/src/commons/SelectUnit/__test__/SelectUnit.test.js +3 -3
  112. package/src/commons/SelectUnit/index.js +3 -4
  113. package/src/commons/Sharing/__test__/BtnRemoveMember.test.js +3 -3
  114. package/src/commons/Sharing/__test__/ButtonRemoveMember.test.js +2 -2
  115. package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +3 -3
  116. package/src/commons/Sharing/__test__/MemberList.test.js +8 -8
  117. package/src/commons/Sharing/__test__/RowMember.test.js +4 -4
  118. package/src/commons/Sharing/__test__/StationDevicePermission.test.js +7 -7
  119. package/src/commons/Sharing/__test__/WrapHeaderScrollable.test.js +6 -6
  120. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +6 -6
  121. package/src/commons/SubUnit/__test__/Favorites.test.js +3 -3
  122. package/src/commons/SubUnit/__test__/Item.test.js +4 -4
  123. package/src/commons/SubUnit/__test__/ShortDetail.test.js +16 -16
  124. package/src/commons/SummaryItem/__test__/SummaryItem.test.js +7 -7
  125. package/src/commons/Tabbar/__test__/index.test.js +1 -1
  126. package/src/commons/TextButton/__test__/TextButton.test.js +6 -6
  127. package/src/commons/Today/__test__/Today.test.js +2 -2
  128. package/src/commons/TouchableScale/__test__/TouchableScale.test.js +5 -5
  129. package/src/commons/Unit/__test__/HeaderUnit.test.js +3 -3
  130. package/src/commons/Unit/__test__/SharedUnit.test.js +13 -13
  131. package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +25 -25
  132. package/src/commons/UnitSummary/ConfigHistoryChart/__test__/ConfigHistoryChart.test.js +258 -25
  133. package/src/commons/UnitSummary/ConfigHistoryChart/index.js +96 -4
  134. package/src/commons/UnitSummary/__test__/TotalPowerBox.test.js +2 -2
  135. package/src/commons/UnitSummary/__test__/TotalPowerConsumption.test.js +2 -2
  136. package/src/commons/ViewButtonBottom/__test__/ViewButtonBottom.test.js +3 -3
  137. package/src/commons/WheelDateTimePicker/__test__/index.test.js +2 -2
  138. package/src/commons/WrapParallaxScrollView/index.js +2 -1
  139. package/src/configs/API.js +6 -2
  140. package/src/configs/AccessibilityLabel.js +13 -1
  141. package/src/configs/Constants.js +9 -12
  142. package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +2 -2
  143. package/src/hooks/Common/__test__/useStatusbar.test.js +4 -4
  144. package/src/hooks/Common/__test__/useTranslations.test.js +1 -1
  145. package/src/hooks/IoT/__test__/useRemoteControl.test.js +7 -7
  146. package/src/hooks/IoT/useRemoteControl.js +0 -1
  147. package/src/iot/RemoteControl/__test__/Bluetooth.test.js +17 -17
  148. package/src/iot/RemoteControl/__test__/Internet.test.js +4 -4
  149. package/src/screens/AQIGuide/__test__/AQIGuide.test.js +3 -3
  150. package/src/screens/ActivityLog/__test__/FilterPopup.test.js +2 -2
  151. package/src/screens/ActivityLog/__test__/ItemLog.test.js +21 -21
  152. package/src/screens/ActivityLog/hooks/__test__/index.test.js +1 -1
  153. package/src/screens/AddCommon/SelectSubUnit.js +3 -0
  154. package/src/screens/AddCommon/SelectUnit.js +1 -1
  155. package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +4 -4
  156. package/src/screens/AddCommon/__test__/SelectUnit.test.js +11 -6
  157. package/src/screens/AddLocationMaps/__test__/index.test.js +6 -6
  158. package/src/screens/AddNewAction/Device/__test__/index.test.js +3 -3
  159. package/src/screens/AddNewAction/SelectAction.js +6 -1
  160. package/src/screens/AddNewAction/__test__/SelectAction.test.js +128 -20
  161. package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +10 -10
  162. package/src/screens/AddNewAction/__test__/SetupSensor.test.js +8 -8
  163. package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +2 -2
  164. package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +8 -8
  165. package/src/screens/AddNewDevice/__test__/ConnectingDevices.test.js +8 -8
  166. package/src/screens/AddNewGateway/ConnectingDevice.js +29 -7
  167. package/src/screens/AddNewGateway/ConnectingWifiDevice.js +4 -2
  168. package/src/screens/AddNewGateway/ConnectingWifiGuide.js +7 -6
  169. package/src/screens/AddNewGateway/ConnectingZigbeeDevice.js +3 -2
  170. package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +5 -5
  171. package/src/screens/AddNewGateway/ScanWifiDeviceQR.js +1 -4
  172. package/src/screens/AddNewGateway/ShareWifiPassword.js +4 -2
  173. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +6 -6
  174. package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +1 -1
  175. package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +2 -1
  176. package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +23 -18
  177. package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +30 -2
  178. package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +4 -4
  179. package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +4 -4
  180. package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +4 -4
  181. package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +5 -5
  182. package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +2 -2
  183. package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +6 -6
  184. package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +1 -1
  185. package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +2 -2
  186. package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +2 -2
  187. package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +6 -6
  188. package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +4 -4
  189. package/src/screens/AllCamera/__test__/index.test.js +2 -2
  190. package/src/screens/Automate/__test__/Loading.test.js +2 -2
  191. package/src/screens/Automate/__test__/MultiUnits.test.js +10 -10
  192. package/src/screens/Automate/__test__/index.test.js +3 -3
  193. package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +2 -2
  194. package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +4 -4
  195. package/src/screens/Device/__test__/DetailHistoryChart.test.js +2 -2
  196. package/src/screens/Device/__test__/detail.test.js +14 -14
  197. package/src/screens/Device/detail.js +10 -3
  198. package/src/screens/Device/utils/index.test.js +4 -4
  199. package/src/screens/Drawer/Drawer.test.js +1 -1
  200. package/src/screens/EditActionsList/__tests__/index.test.js +5 -5
  201. package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +15 -15
  202. package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +19 -19
  203. package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +12 -12
  204. package/src/screens/EmergencySetting/__test__/DropDownItem.test.js +7 -7
  205. package/src/screens/EmergencySetting/__test__/index.test.js +3 -3
  206. package/src/screens/EnterPassword/__test__/EnterPassword.test.js +12 -12
  207. package/src/screens/Explore/__test__/Explore.test.js +3 -3
  208. package/src/screens/GuestInfo/__test__/index.test.js +3 -3
  209. package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +2 -2
  210. package/src/screens/HanetCamera/__test__/Detail.test.js +2 -2
  211. package/src/screens/HanetCamera/__test__/ManageAccess.test.js +5 -5
  212. package/src/screens/HanetCamera/__test__/MemberInfo.test.js +5 -5
  213. package/src/screens/HanetCamera/hooks/__test__/useHanetCheckinData.test.js +6 -6
  214. package/src/screens/HanetCamera/hooks/__test__/useHanetPlaceMembers.test.js +3 -3
  215. package/src/screens/ManageAccess/hooks/__test__/useManageAccess.test.js +11 -7
  216. package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +1 -1
  217. package/src/screens/Notification/__test__/Notification.test.js +5 -5
  218. package/src/screens/Notification/__test__/NotificationItem.test.js +79 -75
  219. package/src/screens/Notification/components/NotificationItem.js +134 -141
  220. package/src/screens/PlayBackCamera/__test__/Timer.test.js +3 -3
  221. package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +7 -7
  222. package/src/screens/ScriptDetail/__test__/index.test.js +31 -31
  223. package/src/screens/SetSchedule/__test__/SelectWeekday.test.js +1 -1
  224. package/src/screens/SetSchedule/__test__/index.test.js +4 -4
  225. package/src/screens/SharedUnit/__test__/ShareUnit.test.js +2 -2
  226. package/src/screens/SharedUnit/__test__/TabHeader.test.js +3 -3
  227. package/src/screens/Sharing/Components/__test__/DeviceItem.test.js +4 -4
  228. package/src/screens/Sharing/Components/__test__/ItemChangeRole.test.js +4 -4
  229. package/src/screens/Sharing/Components/__test__/TitleCheckBox.test.js +4 -4
  230. package/src/screens/Sharing/__test__/MemberList.test.js +1 -1
  231. package/src/screens/Sharing/__test__/MemberList2.test.js +1 -1
  232. package/src/screens/Sharing/__test__/SelectPermission.test.js +41 -41
  233. package/src/screens/Sharing/__test__/SelectUser.test.js +14 -14
  234. package/src/screens/SideMenuDetail/__test__/index.test.js +25 -4
  235. package/src/screens/SideMenuDetail/index.js +32 -19
  236. package/src/screens/SmartAccount/Connecting/index.js +3 -0
  237. package/src/screens/SmartAccount/ListDevice/__test__/DeviceItem.test.js +3 -3
  238. package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +17 -21
  239. package/src/screens/SmartAccount/ListDevice/index.js +17 -11
  240. package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +66 -11
  241. package/src/screens/SmartAccount/SuccessfullyConnected/index.js +102 -26
  242. package/src/screens/SmartAccount/SuccessfullyConnected/styles.js +58 -1
  243. package/src/screens/SmartAccount/__test__/Connecting.test.js +7 -4
  244. package/src/screens/SmartAccount/__test__/SmartAccount.test.js +17 -17
  245. package/src/screens/SmartIr/__test__/ButtonsBottom.test.js +2 -2
  246. package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +12 -12
  247. package/src/screens/SmartIr/__test__/SelectBrand.test.js +5 -5
  248. package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +5 -5
  249. package/src/screens/SmartIr/__test__/SmartIr.test.js +5 -5
  250. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +12 -12
  251. package/src/screens/SubUnit/__test__/Detail.test.js +6 -6
  252. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +44 -44
  253. package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +6 -6
  254. package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +5 -5
  255. package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +10 -10
  256. package/src/screens/TDSGuide/__test__/TDSGuide.test.js +3 -3
  257. package/src/screens/UVIndexGuide/__test__/UVIndexGuide.test.js +3 -3
  258. package/src/screens/Unit/ManageUnit.js +4 -45
  259. package/src/screens/Unit/ManageUnitStyles.js +5 -35
  260. package/src/screens/Unit/Station/__test__/index.test.js +1 -1
  261. package/src/screens/Unit/Summaries.js +11 -20
  262. package/src/screens/Unit/__test__/AddMenu.test.js +8 -8
  263. package/src/screens/Unit/__test__/CheckSendEmail.test.js +3 -3
  264. package/src/screens/Unit/__test__/ChooseLocation.test.js +2 -2
  265. package/src/screens/Unit/__test__/Detail.test.js +17 -17
  266. package/src/screens/Unit/__test__/ManageUnit.test.js +17 -17
  267. package/src/screens/Unit/__test__/MyAllUnit.test.js +5 -5
  268. package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +4 -4
  269. package/src/screens/Unit/__test__/SelectAddress.test.js +10 -10
  270. package/src/screens/Unit/__test__/SmartAccount.test.js +4 -4
  271. package/src/screens/Unit/__test__/SmartAccountItem.test.js +1 -1
  272. package/src/screens/Unit/__test__/Summaries.test.js +2 -2
  273. package/src/screens/Unit/components/ButtonWrapper/index.js +60 -0
  274. package/src/screens/Unit/components/ButtonWrapper/styles.js +37 -0
  275. package/src/screens/Unit/components/MyAllUnit/__test__/Header.test.js +19 -19
  276. package/src/screens/Unit/components/MyAllUnit/__test__/MyAllUnit.test.js +3 -3
  277. package/src/screens/Unit/components/MyAllUnit/__test__/index.test.js +4 -4
  278. package/src/screens/Unit/components/__test__/Header.test.js +12 -12
  279. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
  280. package/src/screens/Unit/components/__test__/SharedUnit.test.js +6 -6
  281. package/src/screens/UnitSummary/__test__/index.test.js +61 -25
  282. package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +3 -3
  283. package/src/screens/UnitSummary/components/PowerConsumption/__test__/ItemPower.test.js +3 -3
  284. package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +5 -5
  285. package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +3 -3
  286. package/src/screens/UnitSummary/components/Temperature/__test__/ChartAverage.test.js +3 -3
  287. package/src/screens/UnitSummary/components/Temperature/__test__/ItemAverage.test.js +3 -3
  288. package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +18 -18
  289. package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +12 -12
  290. package/src/screens/UnitSummary/components/__test__/TotalPowerBox.test.js +2 -2
  291. package/src/screens/UnitSummary/components/__test__/TotalPowerConsumption.test.js +2 -2
  292. package/src/screens/UnitSummary/components/__test__/UnitSummary.test.js +8 -8
  293. package/src/screens/UnitSummary/components/__test__/index.test.js +5 -5
  294. package/src/screens/UnitSummary/index.js +6 -1
  295. package/src/screens/WaterQualityGuide/__test__/index.test.js +12 -12
  296. package/src/utils/Apis/axios.js +23 -0
  297. package/src/utils/Converter/__test__/array.test.js +1 -1
  298. package/src/utils/Converter/__test__/url.test.js +1 -1
  299. package/src/utils/Functions/__test__/Search.test.js +1 -1
  300. package/src/utils/Functions/__test__/ShortEmail.test.js +1 -1
  301. package/src/utils/I18n/translations/en.json +3 -1
  302. package/src/utils/I18n/translations/vi.json +3 -1
  303. package/src/utils/__test__/InitData.test.js +2 -2
  304. package/src/utils/__test__/Utils.test.js +21 -3
  305. package/src/commons/UnitSummary/ConfigHistoryChart.js +0 -105
  306. package/src/screens/AddNewDevice/hooks/ConnectDevices.js +0 -67
  307. package/src/screens/AddNewDevice/hooks/useStateAlertRename.js +0 -32
  308. package/src/screens/SmartAccount/SuccessfullyConnected/DeviceItem.js +0 -37
  309. package/src/screens/SmartAccount/SuccessfullyConnected/DeviceItemStyles.js +0 -49
  310. package/src/screens/SmartAccount/SuccessfullyConnected/__test__/DeviceItem.test.js +0 -65
  311. package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/__test__/index.test.js +0 -63
  312. package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/index.js +0 -53
@@ -75,7 +75,7 @@ describe('Test AddSubUnit', () => {
75
75
  });
76
76
  let tree;
77
77
 
78
- test('onChoosePhoto show image picker', async () => {
78
+ it('onChoosePhoto show image picker', async () => {
79
79
  await act(async () => {
80
80
  tree = await create(wrapComponent(route));
81
81
  });
@@ -94,7 +94,7 @@ describe('Test AddSubUnit', () => {
94
94
  expect(imagePicker.props.showImagePicker).toEqual(true);
95
95
  });
96
96
 
97
- test('ImagePicker setImageUrl show wallpaper', async () => {
97
+ it('ImagePicker setImageUrl show wallpaper', async () => {
98
98
  await act(async () => {
99
99
  tree = await create(wrapComponent(route));
100
100
  });
@@ -127,7 +127,7 @@ describe('Test AddSubUnit', () => {
127
127
  return viewButtonBottom;
128
128
  };
129
129
 
130
- test('onChangeRoomName and setImageUrl for validateData', async () => {
130
+ it('onChangeRoomName and setImageUrl for validateData', async () => {
131
131
  await act(async () => {
132
132
  tree = await create(wrapComponent(route));
133
133
  });
@@ -135,7 +135,7 @@ describe('Test AddSubUnit', () => {
135
135
  await makeValidateData(instance);
136
136
  });
137
137
 
138
- test('ViewButtonBottom onLeftClick', async () => {
138
+ it('ViewButtonBottom onLeftClick', async () => {
139
139
  await act(async () => {
140
140
  tree = await create(wrapComponent(route));
141
141
  });
@@ -149,7 +149,7 @@ describe('Test AddSubUnit', () => {
149
149
  expect(mockedGoBack).toHaveBeenCalled();
150
150
  });
151
151
 
152
- test('validateData then send api success', async () => {
152
+ it('validateData then send api success', async () => {
153
153
  mock.onPost(API.UNIT.CREATE_UNIT()).reply(200, {});
154
154
  await act(async () => {
155
155
  tree = await create(wrapComponent(route));
@@ -167,7 +167,7 @@ describe('Test AddSubUnit', () => {
167
167
  });
168
168
  });
169
169
 
170
- test('validateData then send api fail', async () => {
170
+ it('validateData then send api fail', async () => {
171
171
  mock.onPost(API.UNIT.CREATE_UNIT()).reply(400);
172
172
  await act(async () => {
173
173
  tree = await create(wrapComponent(route));
@@ -185,7 +185,7 @@ describe('Test AddSubUnit', () => {
185
185
  });
186
186
  });
187
187
 
188
- test('test create Unit', async () => {
188
+ it('test create Unit', async () => {
189
189
  route.params = {
190
190
  ...route.params,
191
191
  location: 'Unit address',
@@ -207,7 +207,7 @@ describe('Test AddSubUnit', () => {
207
207
  expect(mockNavigationDispatch).toBeCalledWith(mockReplace);
208
208
  });
209
209
 
210
- test('test choose Location', async () => {
210
+ it('test choose Location', async () => {
211
211
  route.params = {
212
212
  ...route.params,
213
213
  location: '',
@@ -223,13 +223,13 @@ describe('Test AddSubUnit', () => {
223
223
  el.props.accessibilityLabel ===
224
224
  AccessibilityLabel.ADD_SUB_UNIT_BUTTON_CHOOSE_LOCATION
225
225
  );
226
- act(() => {
226
+ await act(async () => {
227
227
  buttonChooseLocation.props.onPress();
228
228
  });
229
229
  expect(mockedNavigate).toHaveBeenCalledWith(Routes.AddLocationMaps);
230
230
  });
231
231
 
232
- test('test create Unit Fail', async () => {
232
+ it('test create Unit Fail', async () => {
233
233
  route.params = {
234
234
  ...route.params,
235
235
  location: 'Unit address',
@@ -252,7 +252,7 @@ describe('Test AddSubUnit', () => {
252
252
  });
253
253
  });
254
254
 
255
- test('test create sub-unit type AddHassiDevice', async () => {
255
+ it('test create sub-unit type AddHassiDevice', async () => {
256
256
  route.params = {
257
257
  ...route.params,
258
258
  addType: 'AddHassiDevice',
@@ -269,7 +269,7 @@ describe('Test AddSubUnit', () => {
269
269
  expect(mockedGoBack).toHaveBeenCalled();
270
270
  });
271
271
 
272
- test('test create sub-unit type AddNewGateway', async () => {
272
+ it('test create sub-unit type AddNewGateway', async () => {
273
273
  route.params = {
274
274
  ...route.params,
275
275
  addType: 'AddNewGateway',
@@ -109,16 +109,16 @@ describe('Test SubUnitDetail', () => {
109
109
  });
110
110
  let tree;
111
111
 
112
- test('ItemDevice', async () => {
113
- act(() => {
114
- tree = create(wrapComponent(route));
112
+ it('ItemDevice', async () => {
113
+ await act(async () => {
114
+ tree = await create(wrapComponent(route));
115
115
  });
116
116
  const instance = tree.root;
117
117
  const itemDevices = instance.findAllByType(ItemDevice);
118
118
  expect(itemDevices).toHaveLength(0);
119
119
  });
120
120
 
121
- test('onBack', async () => {
121
+ it('onBack', async () => {
122
122
  mockedDangerouslyGetState.mockImplementation(() => ({
123
123
  routes: [
124
124
  { name: 'route 1' },
@@ -138,7 +138,7 @@ describe('Test SubUnitDetail', () => {
138
138
  expect(mockedDangerouslyGetStatePop).toHaveBeenCalledWith(2);
139
139
  });
140
140
 
141
- test('click Menu ActionMore', async () => {
141
+ it('click Menu ActionMore', async () => {
142
142
  mockedDangerouslyGetState.mockImplementation(() => ({
143
143
  routes: [
144
144
  { name: 'route 1' },
@@ -157,7 +157,7 @@ describe('Test SubUnitDetail', () => {
157
157
  AccessibilityLabel.HEADER_UNIT_BUTTON_BACK &&
158
158
  el.type === TouchableOpacity
159
159
  );
160
- act(() => {
160
+ await act(async () => {
161
161
  button.props.onPress();
162
162
  });
163
163
  const buttonOnActionPress = instance.findAll(
@@ -95,9 +95,9 @@ describe('Test EditSubUnit', () => {
95
95
  });
96
96
  let tree;
97
97
 
98
- test('alertAction', async () => {
99
- act(() => {
100
- tree = create(wrapComponent(route));
98
+ it('alertAction', async () => {
99
+ await act(async () => {
100
+ tree = await create(wrapComponent(route));
101
101
  });
102
102
  const instance = tree.root;
103
103
  const alertAction = instance.findByType(AlertAction);
@@ -109,7 +109,7 @@ describe('Test EditSubUnit', () => {
109
109
  );
110
110
  });
111
111
 
112
- test('alertAction rightButtonClick success, previous screen Routes.UnitDetail', async () => {
112
+ it('alertAction rightButtonClick success, previous screen Routes.UnitDetail', async () => {
113
113
  mock
114
114
  .onDelete('https://backend.eoh.io/api/property_manager/1/sub_units/2/')
115
115
  .reply(200);
@@ -122,8 +122,8 @@ describe('Test EditSubUnit', () => {
122
122
  ],
123
123
  }));
124
124
 
125
- act(() => {
126
- tree = create(wrapComponent(route));
125
+ await act(async () => {
126
+ tree = await create(wrapComponent(route));
127
127
  });
128
128
 
129
129
  const instance = tree.root;
@@ -134,7 +134,7 @@ describe('Test EditSubUnit', () => {
134
134
  expect(alertAction.props.visible).toEqual(false);
135
135
  });
136
136
 
137
- test('alertAction rightButtonClick success', async () => {
137
+ it('alertAction rightButtonClick success', async () => {
138
138
  mock
139
139
  .onDelete('https://backend.eoh.io/api/property_manager/1/sub_units/2/')
140
140
  .reply(200);
@@ -142,8 +142,8 @@ describe('Test EditSubUnit', () => {
142
142
  routes: [{ name: 'route 1' }, { name: 'route 2' }, { name: 'route 3' }],
143
143
  }));
144
144
 
145
- act(() => {
146
- tree = create(wrapComponent(route));
145
+ await act(async () => {
146
+ tree = await create(wrapComponent(route));
147
147
  });
148
148
  const instance = tree.root;
149
149
  const alertAction = instance.findByType(AlertAction);
@@ -153,7 +153,7 @@ describe('Test EditSubUnit', () => {
153
153
  expect(mockedPop).not.toBeCalled();
154
154
  });
155
155
 
156
- test('alertAction rightButtonClick fail', async () => {
156
+ it('alertAction rightButtonClick fail', async () => {
157
157
  mock
158
158
  .onDelete('https://backend.eoh.io/api/property_manager/1/sub_units/2/')
159
159
  .reply(400);
@@ -162,8 +162,8 @@ describe('Test EditSubUnit', () => {
162
162
  routes: [{ name: 'route 1' }, { name: 'route 2' }, { name: 'route 3' }],
163
163
  }));
164
164
 
165
- act(() => {
166
- tree = create(wrapComponent(route));
165
+ await act(async () => {
166
+ tree = await create(wrapComponent(route));
167
167
  });
168
168
  const instance = tree.root;
169
169
  const alertAction = instance.findByType(AlertAction);
@@ -179,9 +179,9 @@ describe('Test EditSubUnit', () => {
179
179
  });
180
180
  });
181
181
 
182
- test('alertAction leftButtonClick', async () => {
183
- act(() => {
184
- tree = create(wrapComponent(route));
182
+ it('alertAction leftButtonClick', async () => {
183
+ await act(async () => {
184
+ tree = await create(wrapComponent(route));
185
185
  });
186
186
  const instance = tree.root;
187
187
  const alertAction = instance.findByType(AlertAction);
@@ -191,9 +191,9 @@ describe('Test EditSubUnit', () => {
191
191
  expect(alertAction.props.visible).toEqual(false);
192
192
  });
193
193
 
194
- test('alertAction hideModal', async () => {
195
- act(() => {
196
- tree = create(wrapComponent(route));
194
+ it('alertAction hideModal', async () => {
195
+ await act(async () => {
196
+ tree = await create(wrapComponent(route));
197
197
  });
198
198
  const instance = tree.root;
199
199
  const alertAction = instance.findByType(AlertAction);
@@ -203,9 +203,9 @@ describe('Test EditSubUnit', () => {
203
203
  expect(alertAction.props.visible).toEqual(false);
204
204
  });
205
205
 
206
- test('viewBottomButton onLeftClick', async () => {
207
- act(() => {
208
- tree = create(wrapComponent(route));
206
+ it('viewBottomButton onLeftClick', async () => {
207
+ await act(async () => {
208
+ tree = await create(wrapComponent(route));
209
209
  });
210
210
  const instance = tree.root;
211
211
  const modal = instance.find(
@@ -229,13 +229,13 @@ describe('Test EditSubUnit', () => {
229
229
  expect(modal.props.isVisible).toEqual(false);
230
230
  });
231
231
 
232
- test('viewBottomButton onRightClick success', async () => {
232
+ it('viewBottomButton onRightClick success', async () => {
233
233
  mock
234
234
  .onPatch(API.SUB_UNIT.MANAGE_SUB_UNIT(1, 1))
235
235
  .reply(200, { name: 'Station name' });
236
236
 
237
- act(() => {
238
- tree = create(wrapComponent(route));
237
+ await act(async () => {
238
+ tree = await create(wrapComponent(route));
239
239
  });
240
240
  const instance = tree.root;
241
241
  const text = instance.find(
@@ -252,10 +252,10 @@ describe('Test EditSubUnit', () => {
252
252
  expect(text.props.children).toEqual('Station name');
253
253
  });
254
254
 
255
- test('viewBottomButton onRightClick fail', async () => {
255
+ it('viewBottomButton onRightClick fail', async () => {
256
256
  mock.onPatch(API.SUB_UNIT.MANAGE_SUB_UNIT(1, 2)).reply(200);
257
257
  await act(async () => {
258
- tree = create(wrapComponent(route));
258
+ tree = await create(wrapComponent(route));
259
259
  });
260
260
  const instance = tree.root;
261
261
  const viewBottomButtons = instance.findAllByType(ViewButtonBottom);
@@ -268,9 +268,9 @@ describe('Test EditSubUnit', () => {
268
268
  expect(Toast.show).not.toHaveBeenCalled();
269
269
  });
270
270
 
271
- test('onPressRemove', async () => {
272
- act(() => {
273
- tree = create(wrapComponent(route));
271
+ it('onPressRemove', async () => {
272
+ await act(async () => {
273
+ tree = await create(wrapComponent(route));
274
274
  });
275
275
  const instance = tree.root;
276
276
  const button = instance.find(
@@ -282,28 +282,28 @@ describe('Test EditSubUnit', () => {
282
282
  const alertAction = instance.findByType(AlertAction);
283
283
  expect(alertAction.props.visible).toEqual(false);
284
284
 
285
- act(() => {
285
+ await act(async () => {
286
286
  button.props.onPress();
287
287
  });
288
288
 
289
289
  expect(alertAction.props.visible).toEqual(true);
290
290
  });
291
291
 
292
- test('onChangeName', async () => {
293
- act(() => {
294
- tree = create(wrapComponent(route));
292
+ it('onChangeName', async () => {
293
+ await act(async () => {
294
+ tree = await create(wrapComponent(route));
295
295
  });
296
296
  const instance = tree.root;
297
297
  const textInput = instance.findByType(_TextInput);
298
- act(() => {
298
+ await act(async () => {
299
299
  textInput.props.onChange('New sub-unit name');
300
300
  });
301
301
  // This dont have expect
302
302
  });
303
303
 
304
- test('selectFile', async () => {
305
- act(() => {
306
- tree = create(wrapComponent(route));
304
+ it('selectFile', async () => {
305
+ await act(async () => {
306
+ tree = await create(wrapComponent(route));
307
307
  });
308
308
  const instance = tree.root;
309
309
  const button = instance.find(
@@ -314,19 +314,19 @@ describe('Test EditSubUnit', () => {
314
314
  );
315
315
  const imagePicker = instance.findByType(ImagePicker);
316
316
  expect(imagePicker.props.showImagePicker).toEqual(false);
317
- act(() => {
317
+ await act(async () => {
318
318
  button.props.onPress();
319
319
  });
320
320
  expect(imagePicker.props.showImagePicker).toEqual(true);
321
321
  });
322
322
 
323
- test('setImage and updateBackground success', async () => {
323
+ it('setImage and updateBackground success', async () => {
324
324
  mock
325
325
  .onPatch(API.SUB_UNIT.MANAGE_SUB_UNIT(1, 1))
326
326
  .reply(200, { name: 'Station name' });
327
327
 
328
- act(() => {
329
- tree = create(wrapComponent(route));
328
+ await act(async () => {
329
+ tree = await create(wrapComponent(route));
330
330
  });
331
331
  const instance = tree.root;
332
332
  const imagePicker = instance.findByType(ImagePicker);
@@ -342,10 +342,10 @@ describe('Test EditSubUnit', () => {
342
342
  });
343
343
  });
344
344
 
345
- test('setImage and updateBackground but fail', async () => {
345
+ it('setImage and updateBackground but fail', async () => {
346
346
  mock.onPatch(API.SUB_UNIT.MANAGE_SUB_UNIT(1, 1)).reply(400);
347
- act(() => {
348
- tree = create(wrapComponent(route));
347
+ await act(async () => {
348
+ tree = await create(wrapComponent(route));
349
349
  });
350
350
  const instance = tree.root;
351
351
  const imagePicker = instance.findByType(ImagePicker);
@@ -55,15 +55,15 @@ describe('Test ManageSubUnit', () => {
55
55
  useState.mockImplementationOnce((init) => [data, mockSetState]);
56
56
  useState.mockImplementationOnce((init) => [false, mockSetState]);
57
57
  useState.mockImplementationOnce((init) => [false, mockSetState]);
58
- await act(() => {
59
- tree = create(wrapComponent(route));
58
+ await act(async () => {
59
+ tree = await create(wrapComponent(route));
60
60
  });
61
61
  const instance = tree.root;
62
62
  const subUnitScrollViews = instance.findAllByType(ScrollView);
63
63
  expect(subUnitScrollViews).toHaveLength(2);
64
64
  const rowItem = instance.findAllByType(RowItem);
65
65
  expect(rowItem).toHaveLength(1);
66
- act(() => {
66
+ await act(async () => {
67
67
  rowItem[0].props.onPress();
68
68
  });
69
69
  expect(mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
@@ -81,8 +81,8 @@ describe('Test ManageSubUnit', () => {
81
81
  let route = {
82
82
  params: { unit: { id: 1, name: 'unit 1' } },
83
83
  };
84
- await act(() => {
85
- tree = create(wrapComponent(route));
84
+ await act(async () => {
85
+ tree = await create(wrapComponent(route));
86
86
  });
87
87
  const instance = tree.root;
88
88
  const buttonAddSubUnit = instance.find(
@@ -90,7 +90,7 @@ describe('Test ManageSubUnit', () => {
90
90
  el.props.accessibilityLabel === AccessibilityLabel.ADD_SUB_UNIT &&
91
91
  el.type === TouchableOpacity
92
92
  );
93
- act(() => {
93
+ await act(async () => {
94
94
  buttonAddSubUnit.props.onPress();
95
95
  });
96
96
  expect(mockedNavigate).toHaveBeenCalledWith(Routes.AddSubUnitStack, {
@@ -28,14 +28,14 @@ jest.mock('@react-navigation/native', () => {
28
28
  describe('Test Manage Access', () => {
29
29
  const unit = { id: 1, name: 'unit name' };
30
30
 
31
- it('Test init', () => {
31
+ it('Test init', async () => {
32
32
  const { result } = renderHook(() => useManageSubUnit(unit));
33
33
  expect(result.current.stations).toEqual([]);
34
34
  expect(result.current.isLoading).toBeFalsy();
35
35
  expect(result.current.isRefreshing).toBeFalsy();
36
36
  });
37
37
 
38
- it('Test onRefresh', () => {
38
+ it('Test onRefresh', async () => {
39
39
  const { result } = renderHook(() => useManageSubUnit(unit));
40
40
  mock.onGet(API.UNIT.UNIT_DETAIL(unit?.id)).reply(200, [
41
41
  {
@@ -71,16 +71,16 @@ describe('Test Manage Access', () => {
71
71
  ],
72
72
  },
73
73
  ]);
74
- act(() => {
74
+ await act(async () => {
75
75
  result.current.onRefresh();
76
76
  });
77
77
  expect(result.current.isRefreshing).toBeFalsy();
78
78
  });
79
79
 
80
- it('Test get unit failure', () => {
80
+ it('Test get unit failure', async () => {
81
81
  const { result } = renderHook(() => useManageSubUnit(unit));
82
82
  mock.onGet(API.UNIT.UNIT_DETAIL(unit?.id)).reply(400);
83
- act(() => {
83
+ await act(async () => {
84
84
  result.current.onRefresh();
85
85
  });
86
86
  expect(result.current.isRefreshing).toBeFalsy();
@@ -62,7 +62,7 @@ describe('Test Add LG Device', () => {
62
62
  return instance.find((el) => el.props.accessibilityLabel === id);
63
63
  };
64
64
 
65
- test('render', async () => {
65
+ it('render', async () => {
66
66
  await act(async () => {
67
67
  tree = await create(wrapComponent(route));
68
68
  });
@@ -84,7 +84,7 @@ describe('Test Add LG Device', () => {
84
84
  expect(groupCheckBox[0].props.data).toEqual([]);
85
85
  });
86
86
 
87
- test('fetchDetails success', async () => {
87
+ it('fetchDetails success', async () => {
88
88
  const response = {
89
89
  status: 200,
90
90
  data: {
@@ -104,7 +104,7 @@ describe('Test Add LG Device', () => {
104
104
  ]);
105
105
  });
106
106
 
107
- test('fetchDetails fail', async () => {
107
+ it('fetchDetails fail', async () => {
108
108
  mock.onGet(API.UNIT.UNIT_DETAIL(1)).reply(400);
109
109
  await act(async () => {
110
110
  tree = await create(wrapComponent(route));
@@ -120,7 +120,7 @@ describe('Test Add LG Device', () => {
120
120
  ]);
121
121
  });
122
122
 
123
- test('ViewButtonBottom', async () => {
123
+ it('ViewButtonBottom', async () => {
124
124
  await act(async () => {
125
125
  tree = await create(wrapComponent(route));
126
126
  });
@@ -135,7 +135,7 @@ describe('Test Add LG Device', () => {
135
135
  );
136
136
  });
137
137
 
138
- test('ViewButtonBottom onLeftClick', async () => {
138
+ it('ViewButtonBottom onLeftClick', async () => {
139
139
  await act(async () => {
140
140
  tree = await create(wrapComponent(route));
141
141
  });
@@ -147,7 +147,7 @@ describe('Test Add LG Device', () => {
147
147
  expect(mockedGoBack).toHaveBeenCalled();
148
148
  });
149
149
 
150
- test('ViewButtonBottom onRightClick without select stationId', async () => {
150
+ it('ViewButtonBottom onRightClick without select stationId', async () => {
151
151
  await act(async () => {
152
152
  tree = await create(wrapComponent(route));
153
153
  });
@@ -159,7 +159,7 @@ describe('Test Add LG Device', () => {
159
159
  expect(mockedNavigate).toHaveBeenCalled();
160
160
  });
161
161
 
162
- test('ViewButtonBottom onRightClick with stationId', async () => {
162
+ it('ViewButtonBottom onRightClick with stationId', async () => {
163
163
  const response = {
164
164
  status: 200,
165
165
  data: {
@@ -211,7 +211,7 @@ describe('Test Add LG Device', () => {
211
211
  expect(mockedNavigate).toHaveBeenCalledWith(Routes.Dashboard);
212
212
  });
213
213
 
214
- test('ViewButtonBottom onRightClick with stationId but sync failed', async () => {
214
+ it('ViewButtonBottom onRightClick with stationId but sync failed', async () => {
215
215
  const response = {
216
216
  status: 200,
217
217
  data: {
@@ -257,7 +257,7 @@ describe('Test Add LG Device', () => {
257
257
  expect(mockedNavigate).toHaveBeenCalledWith(Routes.Dashboard);
258
258
  });
259
259
 
260
- test('ViewButtonBottom onRightClick with stationId but get token failed, wrong data', async () => {
260
+ it('ViewButtonBottom onRightClick with stationId but get token failed, wrong data', async () => {
261
261
  const response = {
262
262
  status: 200,
263
263
  data: {
@@ -303,7 +303,7 @@ describe('Test Add LG Device', () => {
303
303
  spyToastSuccess.mockRestore();
304
304
  });
305
305
 
306
- test('ViewButtonBottom onRightClick with stationId but get token failed, not success', async () => {
306
+ it('ViewButtonBottom onRightClick with stationId but get token failed, not success', async () => {
307
307
  const response = {
308
308
  status: 200,
309
309
  data: {
@@ -26,10 +26,10 @@ jest.mock('react', () => ({
26
26
  }));
27
27
 
28
28
  describe('Test TDS Guide', () => {
29
- test('render tds guide', () => {
29
+ it('render tds guide', async () => {
30
30
  let tree;
31
- act(() => {
32
- tree = create(wrapComponent());
31
+ await act(async () => {
32
+ tree = await create(wrapComponent());
33
33
  });
34
34
 
35
35
  const instance = tree.root;
@@ -26,10 +26,10 @@ jest.mock('react', () => ({
26
26
  }));
27
27
 
28
28
  describe('Test UV Index Guide', () => {
29
- test('render UV Index Guide', async () => {
29
+ it('render UV Index Guide', async () => {
30
30
  let tree;
31
- act(() => {
32
- tree = create(wrapComponent());
31
+ await act(async () => {
32
+ tree = await create(wrapComponent());
33
33
  });
34
34
 
35
35
  const instance = tree.root;
@@ -17,54 +17,10 @@ import WrapHeaderScrollable from '../../commons/Sharing/WrapHeaderScrollable';
17
17
 
18
18
  import { useIsOwnerOfUnit } from '../../hooks/Common';
19
19
  import { AccessibilityLabel } from '../../configs/Constants';
20
- import { IconOutline } from '@ant-design/icons-react-native';
21
20
  import styles from './ManageUnitStyles';
22
21
  import { useNavigation } from '@react-navigation/native';
23
22
  import { ModalCustom } from '../../commons/Modal';
24
- import { Icon } from '@ant-design/react-native';
25
-
26
- const ButtonWrapper = ({
27
- onPress,
28
- testId,
29
- title,
30
- value,
31
- valueColor,
32
- children,
33
- icon,
34
- }) => {
35
- return (
36
- <TouchableOpacity
37
- onPress={onPress}
38
- accessibilityLabel={testId}
39
- style={styles.buttonWrapper}
40
- >
41
- <View style={styles.buttonInfo}>
42
- <Text type="H4" semibold>
43
- {title}
44
- </Text>
45
- <View style={styles.buttonValue}>
46
- {!icon ? (
47
- <Text
48
- type="Body"
49
- color={valueColor || Colors.Gray7}
50
- style={styles.value}
51
- >
52
- {value}
53
- </Text>
54
- ) : value ? (
55
- <Image source={{ uri: value }} style={styles.avatar} />
56
- ) : (
57
- <View style={styles.avatar}>
58
- <Icon name={'user'} size={27} />
59
- </View>
60
- )}
61
- <IconOutline name="right" size={20} color={Colors.Gray7} />
62
- </View>
63
- </View>
64
- {children}
65
- </TouchableOpacity>
66
- );
67
- };
23
+ import ButtonWrapper from './components/ButtonWrapper';
68
24
 
69
25
  const ManageUnit = ({ route }) => {
70
26
  const t = useTranslations();
@@ -229,6 +185,8 @@ const ManageUnit = ({ route }) => {
229
185
  accessibilityLabel={AccessibilityLabel.MANAGE_UNIT_CHANGE_NAME}
230
186
  title={t('unit_name')}
231
187
  value={unitData.name}
188
+ styleTitle={styles.titleButton}
189
+ styleValue={styles.valueButton}
232
190
  />
233
191
  <ButtonWrapper
234
192
  onPress={goSelectLocation}
@@ -312,6 +270,7 @@ const ManageUnit = ({ route }) => {
312
270
  </Text>
313
271
  </View>
314
272
  <_TextInput
273
+ maxLength={50}
315
274
  defaultValue={unitData?.name}
316
275
  onChange={(value) => setUnitName(value)}
317
276
  textInputStyle={styles.textInputStyle}