@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
@@ -6,14 +6,11 @@ import MockAdapter from 'axios-mock-adapter';
6
6
  import { SCProvider } from '../../../context';
7
7
  import { mockSCStore } from '../../../context/mockStore';
8
8
  import NotificationItem from '../components/NotificationItem';
9
- import {
10
- NOTIFICATION_TYPES,
11
- SENSOR_TYPE,
12
- EMERGENCY_TYPE,
13
- } from '../../../configs/Constants';
9
+ import { NOTIFICATION_TYPES, EMERGENCY_TYPE } from '../../../configs/Constants';
14
10
  import Routes from '../../../utils/Route';
15
11
  import { API } from '../../../configs';
16
12
  import api from '../../../utils/Apis/axios';
13
+ import { AccessibilityLabel } from '../../../configs/Constants';
17
14
 
18
15
  const wrapComponent = (item) => (
19
16
  <SCProvider initState={mockSCStore({})}>
@@ -60,14 +57,14 @@ describe('test NotificationItem', () => {
60
57
  ];
61
58
 
62
59
  for (const content_code of listCase2) {
63
- test(`create ItemNotification ${content_code}`, () => {
60
+ test(`create ItemNotification ${content_code}`, async () => {
64
61
  item.content_code = content_code;
65
- act(() => {
66
- tree = create(wrapComponent(item));
62
+ await act(async () => {
63
+ tree = await create(wrapComponent(item));
67
64
  });
68
65
  const instance = tree.root;
69
66
  const button = instance.findByType(TouchableOpacity);
70
- act(() => {
67
+ await act(async () => {
71
68
  button.props.onPress();
72
69
  });
73
70
  expect(mockNavigate).not.toHaveBeenCalled();
@@ -82,17 +79,17 @@ describe('test NotificationItem', () => {
82
79
  ];
83
80
 
84
81
  for (const content_code of listCaseUnitDetail) {
85
- test(`create ItemNotification ${content_code}`, () => {
82
+ test(`create ItemNotification ${content_code}`, async () => {
86
83
  item.content_code = content_code;
87
84
  item.params = {
88
85
  unit_id: 1,
89
86
  };
90
- act(() => {
91
- tree = create(wrapComponent(item));
87
+ await act(async () => {
88
+ tree = await create(wrapComponent(item));
92
89
  });
93
90
  const instance = tree.root;
94
91
  const button = instance.findByType(TouchableOpacity);
95
- act(() => {
92
+ await act(async () => {
96
93
  button.props.onPress();
97
94
  });
98
95
  expect(mockNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
@@ -107,18 +104,18 @@ describe('test NotificationItem', () => {
107
104
  const listCaseDeviceDetail = [NOTIFICATION_TYPES.NOTIFY_DEVICE_DISCONNECT];
108
105
 
109
106
  for (const content_code of listCaseDeviceDetail) {
110
- test(`create ItemNotification ${content_code}`, () => {
107
+ test(`create ItemNotification ${content_code}`, async () => {
111
108
  item.content_code = content_code;
112
109
  item.params = {
113
110
  unit_id: 1,
114
111
  sensor_id: 1,
115
112
  };
116
- act(() => {
117
- tree = create(wrapComponent(item));
113
+ await act(async () => {
114
+ tree = await create(wrapComponent(item));
118
115
  });
119
116
  const instance = tree.root;
120
117
  const button = instance.findByType(TouchableOpacity);
121
- act(() => {
118
+ await act(async () => {
122
119
  button.props.onPress();
123
120
  });
124
121
  expect(mockNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
@@ -132,26 +129,25 @@ describe('test NotificationItem', () => {
132
129
  }
133
130
 
134
131
  const listSensorType = [
135
- SENSOR_TYPE.AIR_QUALITY,
136
- SENSOR_TYPE.TURBIDITY,
137
- SENSOR_TYPE.PH,
138
- SENSOR_TYPE.CLO,
139
- SENSOR_TYPE.UV,
132
+ NOTIFICATION_TYPES.AIR_QUALITY,
133
+ NOTIFICATION_TYPES.TURBIDITY,
134
+ NOTIFICATION_TYPES.PH,
135
+ NOTIFICATION_TYPES.CLO,
136
+ NOTIFICATION_TYPES.UV,
140
137
  ];
141
- for (const sensorType of listSensorType) {
142
- test(`create ItemNotification NOTIFY_INDICATOR sensor_type ${sensorType}`, () => {
143
- item.content_code = NOTIFICATION_TYPES.NOTIFY_INDICATOR;
138
+ for (const content_code of listSensorType) {
139
+ test(`create ItemNotification ${content_code}`, async () => {
140
+ item.content_code = content_code;
144
141
  item.params = {
145
- sensor_type: sensorType,
146
142
  unit_id: 5,
147
143
  summary_id: 11,
148
144
  };
149
- act(() => {
150
- tree = create(wrapComponent(item));
145
+ await act(async () => {
146
+ tree = await create(wrapComponent(item));
151
147
  });
152
148
  const instance = tree.root;
153
149
  const button = instance.findByType(TouchableOpacity);
154
- act(() => {
150
+ await act(async () => {
155
151
  button.props.onPress();
156
152
  });
157
153
  expect(mockNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
@@ -164,42 +160,26 @@ describe('test NotificationItem', () => {
164
160
  });
165
161
  }
166
162
 
167
- test('test case NOTIFY_INDICATOR no sensor_type', () => {
168
- item.content_code = NOTIFICATION_TYPES.NOTIFY_INDICATOR;
169
- item.params = {
170
- sensor_type: null,
171
- unit_id: 5,
172
- summary_id: 11,
173
- };
174
- act(() => {
175
- tree = create(wrapComponent(item));
176
- });
177
- const instance = tree.root;
178
- const button = instance.findAllByType(TouchableOpacity);
179
- expect(button).toHaveLength(0);
180
- });
181
-
182
163
  const listSensorType2 = [
183
- SENSOR_TYPE.SMOKE,
184
- SENSOR_TYPE.FIRE,
185
- SENSOR_TYPE.SOS,
186
- SENSOR_TYPE.FILTER_WATER,
164
+ NOTIFICATION_TYPES.SMOKE,
165
+ NOTIFICATION_TYPES.FIRE,
166
+ NOTIFICATION_TYPES.SOS,
167
+ NOTIFICATION_TYPES.FILTER_WATER,
187
168
  ];
188
- for (const sensorType of listSensorType2) {
189
- test(`create ItemNotification NOTIFY_INDICATOR sensor_type ${sensorType}`, () => {
190
- item.content_code = NOTIFICATION_TYPES.NOTIFY_INDICATOR;
169
+ for (const content_code of listSensorType2) {
170
+ test(`create ItemNotification ${content_code}`, async () => {
171
+ item.content_code = content_code;
191
172
  item.params = {
192
- sensor_type: sensorType,
193
173
  unit_id: 70,
194
174
  sensor_id: 394,
195
175
  };
196
176
 
197
- act(() => {
198
- tree = create(wrapComponent(item));
177
+ await act(async () => {
178
+ tree = await create(wrapComponent(item));
199
179
  });
200
180
  const instance = tree.root;
201
181
  const button = instance.findByType(TouchableOpacity);
202
- act(() => {
182
+ await act(async () => {
203
183
  button.props.onPress();
204
184
  });
205
185
  expect(mockNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
@@ -212,21 +192,20 @@ describe('test NotificationItem', () => {
212
192
  });
213
193
  }
214
194
 
215
- test('test onClick Item Notify', () => {
216
- item.content_code = NOTIFICATION_TYPES.NOTIFY_INDICATOR;
195
+ test('test onClick Item Notify', async () => {
196
+ item.content_code = NOTIFICATION_TYPES.AIR_QUALITY;
217
197
  item.params = {
218
- sensor_type: 'air_quality',
219
198
  unit_id: 5,
220
199
  summary_id: 11,
221
200
  };
222
201
  item.is_read = false;
223
- act(() => {
224
- tree = create(wrapComponent(item));
202
+ await act(async () => {
203
+ tree = await create(wrapComponent(item));
225
204
  });
226
205
  const instance = tree.root;
227
206
  const button = instance.findByType(TouchableOpacity);
228
207
  mock.onPost(API.NOTIFICATION.SET_READ(1)).reply(200);
229
- act(() => {
208
+ await act(async () => {
230
209
  button.props.onPress();
231
210
  });
232
211
  expect(mockNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
@@ -238,18 +217,18 @@ describe('test NotificationItem', () => {
238
217
  });
239
218
  });
240
219
 
241
- test('test render Notify not in any case', () => {
220
+ it('test render Notify not in any case', async () => {
242
221
  item.content_code = 'NEW CASE';
243
222
  item.params = { unit_id: 1 };
244
- act(() => {
245
- tree = create(wrapComponent(item));
223
+ await act(async () => {
224
+ tree = await create(wrapComponent(item));
246
225
  });
247
226
  const instance = tree.root;
248
227
  const button = instance.findAllByType(TouchableOpacity);
249
228
  expect(button).toHaveLength(0);
250
229
  });
251
230
 
252
- test('test notify emergency ', () => {
231
+ it('test notify emergency ', async () => {
253
232
  item.content_code = NOTIFICATION_TYPES.NOTIFY_EMERGENCY;
254
233
  item.params = {
255
234
  unit_id: 1,
@@ -257,12 +236,12 @@ describe('test NotificationItem', () => {
257
236
  type: EMERGENCY_TYPE.CREATED,
258
237
  };
259
238
 
260
- act(() => {
261
- tree = create(wrapComponent(item));
239
+ await act(async () => {
240
+ tree = await create(wrapComponent(item));
262
241
  });
263
242
  const instance = tree.root;
264
243
  const button = instance.findByType(TouchableOpacity);
265
- act(() => {
244
+ await act(async () => {
266
245
  button.props.onPress();
267
246
  });
268
247
  expect(mockNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
@@ -274,7 +253,7 @@ describe('test NotificationItem', () => {
274
253
  });
275
254
  });
276
255
 
277
- test('test notify emergency_resolve ', () => {
256
+ it('test notify emergency_resolve ', async () => {
278
257
  item.content_code = NOTIFICATION_TYPES.NOTIFY_EMERGENCY;
279
258
  item.params = {
280
259
  unit_id: 1,
@@ -282,12 +261,12 @@ describe('test NotificationItem', () => {
282
261
  type: EMERGENCY_TYPE.RESOLVE,
283
262
  };
284
263
 
285
- act(() => {
286
- tree = create(wrapComponent(item));
264
+ await act(async () => {
265
+ tree = await create(wrapComponent(item));
287
266
  });
288
267
  const instance = tree.root;
289
268
  const button = instance.findByType(TouchableOpacity);
290
- act(() => {
269
+ await act(async () => {
291
270
  button.props.onPress();
292
271
  });
293
272
  expect(mockNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
@@ -299,7 +278,7 @@ describe('test NotificationItem', () => {
299
278
  });
300
279
  });
301
280
 
302
- test('test notify emergency not params type', () => {
281
+ it('test notify emergency not params type', async () => {
303
282
  item.content_code = NOTIFICATION_TYPES.NOTIFY_EMERGENCY;
304
283
  item.params = {
305
284
  unit_id: 1,
@@ -307,11 +286,36 @@ describe('test NotificationItem', () => {
307
286
  type: null,
308
287
  };
309
288
 
310
- act(() => {
311
- tree = create(wrapComponent(item));
289
+ await act(async () => {
290
+ tree = await create(wrapComponent(item));
312
291
  });
313
292
  const instance = tree.root;
314
293
  const button = instance.findAllByType(TouchableOpacity);
315
294
  expect(button).toHaveLength(0);
316
295
  });
296
+
297
+ test('test case NOTIFY_REMOVE_UNIT to unit_onwer', async () => {
298
+ item.content_code = NOTIFICATION_TYPES.NOTIFY_REMOVE_UNIT;
299
+ item.params = {
300
+ unit_id: 1,
301
+ unit_owner_name: 'EoH owner',
302
+ unit_name: 'EoH',
303
+ };
304
+ await act(async () => {
305
+ tree = await create(wrapComponent(item));
306
+ });
307
+ const instance = tree.root;
308
+ const customText = instance.findByProps({
309
+ accessibilityLabel: AccessibilityLabel.CUSTOM_TEXT,
310
+ });
311
+ expect(customText.props.children[0].props.children).toEqual('Unit ');
312
+ expect(customText.props.children[1].props.children).toEqual('EoH');
313
+ expect(customText.props.children[2].props.children).toEqual(
314
+ ' has been removed by '
315
+ );
316
+ expect(customText.props.children[3].props.children).toEqual('EoH owner');
317
+ expect(customText.props.children[4].props.children).toEqual(
318
+ '. You cannot access to this unit anymore.'
319
+ );
320
+ });
317
321
  });
@@ -7,14 +7,11 @@ import styles from '../styles/NotificationItemStyles';
7
7
  import Text from '../../../commons/Text';
8
8
  import { Colors, API, Images } from '../../../configs';
9
9
  import IconComponent from '../../../commons/IconComponent';
10
- import {
11
- NOTIFICATION_TYPES,
12
- SENSOR_TYPE,
13
- EMERGENCY_TYPE,
14
- } from '../../../configs/Constants';
10
+ import { NOTIFICATION_TYPES, EMERGENCY_TYPE } from '../../../configs/Constants';
15
11
  import { useTranslations } from '../../../hooks/Common/useTranslations';
16
12
  import { axiosPost } from '../../../utils/Apis/axios';
17
13
  import Routes from '../../../utils/Route';
14
+ import { AccessibilityLabel } from '../../../configs/Constants';
18
15
 
19
16
  const NotificationItem = memo(({ item }) => {
20
17
  const t = useTranslations();
@@ -63,141 +60,133 @@ const NotificationItem = memo(({ item }) => {
63
60
  />
64
61
  ),
65
62
  };
66
- case NOTIFICATION_TYPES.NOTIFY_INDICATOR:
67
- switch (params?.sensor_type) {
68
- case SENSOR_TYPE.AIR_QUALITY:
69
- return {
70
- content: customColorText(
71
- t('text_notification_content_air_quality_high')
72
- ),
73
- redirect: () =>
74
- navigation.navigate(Routes.UnitStack, {
75
- screen: Routes.UnitSummary,
76
- params: {
77
- summaryId: params?.summary_id,
78
- unitId,
79
- },
80
- }),
81
- iconContent: <Image source={Images.logo} style={styles.logo} />,
82
- };
83
- case SENSOR_TYPE.TURBIDITY:
84
- return {
85
- content: customColorText(
86
- t('text_notification_content_turbility_high')
87
- ),
88
- redirect: () =>
89
- navigation.navigate(Routes.UnitStack, {
90
- screen: Routes.UnitSummary,
91
- params: {
92
- summaryId: params?.summary_id,
93
- unitId,
94
- },
95
- }),
96
- iconContent: <Image source={Images.logo} style={styles.logo} />,
97
- };
98
- case SENSOR_TYPE.PH:
99
- return {
100
- content: customColorText(
101
- t('text_notification_content_pH_index_high')
102
- ),
103
- redirect: () =>
104
- navigation.navigate(Routes.UnitStack, {
105
- screen: Routes.UnitSummary,
106
- params: {
107
- summaryId: params?.summary_id,
108
- unitId,
109
- },
110
- }),
111
- iconContent: <Image source={Images.logo} style={styles.logo} />,
112
- };
113
- case SENSOR_TYPE.CLO:
114
- return {
115
- content: customColorText(t('text_notification_content_clo_high')),
116
- redirect: () =>
117
- navigation.navigate(Routes.UnitStack, {
118
- screen: Routes.UnitSummary,
119
- params: {
120
- summaryId: params?.summary_id,
121
- unitId,
122
- },
123
- }),
124
- iconContent: <Image source={Images.logo} style={styles.logo} />,
125
- };
126
- case SENSOR_TYPE.UV:
127
- return {
128
- content: customColorText(
129
- t('text_notification_content_uv_index_high')
130
- ),
131
- redirect: () =>
132
- navigation.navigate(Routes.UnitStack, {
133
- screen: Routes.UnitSummary,
134
- params: {
135
- summaryId: params?.summary_id,
136
- unitId,
137
- },
138
- }),
139
- iconContent: <Image source={Images.logo} style={styles.logo} />,
140
- };
141
- case SENSOR_TYPE.SMOKE:
142
- return {
143
- content: customColorText(t('text_notification_content_smoke')),
144
- redirect: () =>
145
- navigation.navigate(Routes.UnitStack, {
146
- screen: Routes.DeviceDetail,
147
- params: {
148
- unitId,
149
- sensorId,
150
- },
151
- }),
152
- iconContent: <Image source={Images.logo} style={styles.logo} />,
153
- };
154
- case SENSOR_TYPE.FIRE:
155
- return {
156
- content: customColorText(t('text_notification_content_fire')),
157
- redirect: () =>
158
- navigation.navigate(Routes.UnitStack, {
159
- screen: Routes.DeviceDetail,
160
- params: {
161
- unitId,
162
- sensorId,
163
- },
164
- }),
165
- iconContent: <Image source={Images.logo} style={styles.logo} />,
166
- };
167
- case SENSOR_TYPE.SOS:
168
- return {
169
- content: customColorText(
170
- t('text_notification_content_active_sos')
171
- ),
172
- redirect: () =>
173
- navigation.navigate(Routes.UnitStack, {
174
- screen: Routes.DeviceDetail,
175
- params: {
176
- unitId,
177
- sensorId,
178
- },
179
- }),
180
- iconContent: <Image source={Images.logo} style={styles.logo} />,
181
- };
182
- case SENSOR_TYPE.FILTER_WATER:
183
- return {
184
- content: customColorText(
185
- t('text_notification_content_replace_water_filter')
186
- ),
187
- redirect: () =>
188
- navigation.navigate(Routes.UnitStack, {
189
- screen: Routes.DeviceDetail,
190
- params: {
191
- unitId,
192
- sensorId,
193
- },
194
- }),
195
- iconContent: <Image source={Images.logo} style={styles.logo} />,
196
- };
197
- default:
198
- return null;
199
- }
200
-
63
+ case NOTIFICATION_TYPES.AIR_QUALITY:
64
+ return {
65
+ content: customColorText(
66
+ t('text_notification_content_air_quality_high')
67
+ ),
68
+ redirect: () =>
69
+ navigation.navigate(Routes.UnitStack, {
70
+ screen: Routes.UnitSummary,
71
+ params: {
72
+ summaryId: params?.summary_id,
73
+ unitId,
74
+ },
75
+ }),
76
+ iconContent: <Image source={Images.logo} style={styles.logo} />,
77
+ };
78
+ case NOTIFICATION_TYPES.TURBIDITY:
79
+ return {
80
+ content: customColorText(
81
+ t('text_notification_content_air_quality_high')
82
+ ),
83
+ redirect: () =>
84
+ navigation.navigate(Routes.UnitStack, {
85
+ screen: Routes.UnitSummary,
86
+ params: {
87
+ summaryId: params?.summary_id,
88
+ unitId,
89
+ },
90
+ }),
91
+ iconContent: <Image source={Images.logo} style={styles.logo} />,
92
+ };
93
+ case NOTIFICATION_TYPES.PH:
94
+ return {
95
+ content: customColorText(
96
+ t('text_notification_content_pH_index_high')
97
+ ),
98
+ redirect: () =>
99
+ navigation.navigate(Routes.UnitStack, {
100
+ screen: Routes.UnitSummary,
101
+ params: {
102
+ summaryId: params?.summary_id,
103
+ unitId,
104
+ },
105
+ }),
106
+ iconContent: <Image source={Images.logo} style={styles.logo} />,
107
+ };
108
+ case NOTIFICATION_TYPES.CLO:
109
+ return {
110
+ content: customColorText(t('text_notification_content_clo_high')),
111
+ redirect: () =>
112
+ navigation.navigate(Routes.UnitStack, {
113
+ screen: Routes.UnitSummary,
114
+ params: {
115
+ summaryId: params?.summary_id,
116
+ unitId,
117
+ },
118
+ }),
119
+ iconContent: <Image source={Images.logo} style={styles.logo} />,
120
+ };
121
+ case NOTIFICATION_TYPES.UV:
122
+ return {
123
+ content: customColorText(
124
+ t('text_notification_content_uv_index_high')
125
+ ),
126
+ redirect: () =>
127
+ navigation.navigate(Routes.UnitStack, {
128
+ screen: Routes.UnitSummary,
129
+ params: {
130
+ summaryId: params?.summary_id,
131
+ unitId,
132
+ },
133
+ }),
134
+ iconContent: <Image source={Images.logo} style={styles.logo} />,
135
+ };
136
+ case NOTIFICATION_TYPES.SMOKE:
137
+ return {
138
+ content: customColorText(t('text_notification_content_smoke')),
139
+ redirect: () =>
140
+ navigation.navigate(Routes.UnitStack, {
141
+ screen: Routes.DeviceDetail,
142
+ params: {
143
+ unitId,
144
+ sensorId,
145
+ },
146
+ }),
147
+ iconContent: <Image source={Images.logo} style={styles.logo} />,
148
+ };
149
+ case NOTIFICATION_TYPES.FIRE:
150
+ return {
151
+ content: customColorText(t('text_notification_content_fire')),
152
+ redirect: () =>
153
+ navigation.navigate(Routes.UnitStack, {
154
+ screen: Routes.DeviceDetail,
155
+ params: {
156
+ unitId,
157
+ sensorId,
158
+ },
159
+ }),
160
+ iconContent: <Image source={Images.logo} style={styles.logo} />,
161
+ };
162
+ case NOTIFICATION_TYPES.SOS:
163
+ return {
164
+ content: customColorText(t('text_notification_content_active_sos')),
165
+ redirect: () =>
166
+ navigation.navigate(Routes.UnitStack, {
167
+ screen: Routes.DeviceDetail,
168
+ params: {
169
+ unitId,
170
+ sensorId,
171
+ },
172
+ }),
173
+ iconContent: <Image source={Images.logo} style={styles.logo} />,
174
+ };
175
+ case NOTIFICATION_TYPES.FILTER_WATER:
176
+ return {
177
+ content: customColorText(
178
+ t('text_notification_content_replace_water_filter')
179
+ ),
180
+ redirect: () =>
181
+ navigation.navigate(Routes.UnitStack, {
182
+ screen: Routes.DeviceDetail,
183
+ params: {
184
+ unitId,
185
+ sensorId,
186
+ },
187
+ }),
188
+ iconContent: <Image source={Images.logo} style={styles.logo} />,
189
+ };
201
190
  case NOTIFICATION_TYPES.NOTIFY_REMOVE_UNIT:
202
191
  return {
203
192
  content: customColorText(
@@ -379,7 +368,11 @@ const NotificationItem = memo(({ item }) => {
379
368
  </View>
380
369
 
381
370
  <View style={styles.viewRight}>
382
- <Text type="Body" color={Colors.Gray9}>
371
+ <Text
372
+ type="Body"
373
+ color={Colors.Gray9}
374
+ accessibilityLabel={AccessibilityLabel.CUSTOM_TEXT}
375
+ >
383
376
  {content}
384
377
  </Text>
385
378
  <Text color={Colors.Gray7} type="Label" style={[styles.time]}>
@@ -6,13 +6,13 @@ import Timer from '../Timer';
6
6
  describe('test Timer', () => {
7
7
  let tree;
8
8
  it('Test render', async () => {
9
- await act(() => {
10
- tree = create(<Timer value={100} />);
9
+ await act(async () => {
10
+ tree = await create(<Timer value={100} />);
11
11
  });
12
12
  const instance = tree.root;
13
13
  const Animateds = instance.findAllByType(Animated.ScrollView);
14
14
  expect(Animateds).toHaveLength(1);
15
- act(() => {
15
+ await act(async () => {
16
16
  tree.unmount();
17
17
  });
18
18
  });
@@ -39,24 +39,24 @@ describe('Test QRScan', () => {
39
39
  });
40
40
  let tree;
41
41
 
42
- test('render QRScan', async () => {
43
- act(() => {
44
- tree = create(wrapComponent(data));
42
+ it('render QRScan', async () => {
43
+ await act(async () => {
44
+ tree = await create(wrapComponent(data));
45
45
  });
46
46
  const instance = tree.root;
47
47
  const RNCam = instance.findAllByType(RNCamera);
48
48
  expect(RNCam).toHaveLength(1);
49
49
  });
50
50
 
51
- test('onBarCodeRead', async () => {
52
- act(() => {
53
- tree = create(wrapComponent(data));
51
+ it('onBarCodeRead', async () => {
52
+ await act(async () => {
53
+ tree = await create(wrapComponent(data));
54
54
  });
55
55
  const instance = tree.root;
56
56
  const RNCam = instance.findByType(RNCamera);
57
57
 
58
58
  const e = { data: JSON.stringify({ id: 1 }) };
59
- act(() => {
59
+ await act(async () => {
60
60
  RNCam.props.onBarCodeRead(e);
61
61
  });
62
62
  expect(mockedOnScan).toBeCalled();