@eohjsc/react-native-smart-city 0.6.2-rc9 → 0.7.0

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 (304) hide show
  1. package/README.md +1 -1
  2. package/android/build.gradle +10 -19
  3. package/package.json +53 -70
  4. package/src/commons/Action/__test__/ItemQuickAction.test.js +2 -2
  5. package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +3 -3
  6. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +3 -3
  7. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/ItemPasscode.test.js +2 -2
  8. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +3 -3
  9. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +3 -3
  10. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
  11. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +0 -15
  12. package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +2 -2
  13. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +2 -2
  14. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +2 -2
  15. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +5 -5
  16. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +5 -5
  17. package/src/commons/ActionGroup/TerminalBoxTemplate.js +2 -2
  18. package/src/commons/ActionGroup/TextBoxTemplate.js +2 -2
  19. package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonTemplate.test.js +4 -4
  20. package/src/commons/ActionGroup/TimerActionTemplate.js +4 -5
  21. package/src/commons/ActionGroup/TwoButtonTemplate/index.js +2 -2
  22. package/src/commons/ActionGroup/__test__/ColorPickerTemplate.test.js +4 -9
  23. package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +2 -9
  24. package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +4 -11
  25. package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +2 -9
  26. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +4 -18
  27. package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +2 -2
  28. package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +1 -8
  29. package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +0 -7
  30. package/src/commons/ActionGroup/__test__/SwitchButtonTemplate.test.js +4 -15
  31. package/src/commons/ActionGroup/__test__/TerminalBoxTemplate.test.js +0 -7
  32. package/src/commons/ActionGroup/__test__/TextBoxTemplate.test.js +1 -8
  33. package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +8 -15
  34. package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +2 -10
  35. package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +3 -20
  36. package/src/commons/ActionGroup/__test__/index.test.js +15 -23
  37. package/src/commons/ActionTemplate/__test__/index.test.js +2 -0
  38. package/src/commons/ActionTemplate/__test__/utils.js +21 -0
  39. package/src/commons/ActionTemplate/index.js +1 -2
  40. package/src/commons/BackDefault/index.js +2 -2
  41. package/src/commons/ButtonPopup/index.js +2 -2
  42. package/src/commons/Calendar/__test__/Calendar.test.js +0 -7
  43. package/src/commons/CircleButton/__test__/CircleButton.test.js +2 -2
  44. package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +11 -25
  45. package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +27 -20
  46. package/src/commons/Dashboard/MyUnit/index.js +0 -1
  47. package/src/commons/DateTimeRangeChange/DateTimeButton.js +2 -2
  48. package/src/commons/DateTimeRangeChange/__test__/DateTimeButton.test.js +4 -4
  49. package/src/commons/DateTimeRangeChange/index.js +2 -2
  50. package/src/commons/Device/ConnectedViewHeader.js +2 -2
  51. package/src/commons/Device/DisconnectedView.js +2 -2
  52. package/src/commons/Device/Emergency/EmergencyDetail.js +3 -3
  53. package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +2 -2
  54. package/src/commons/Device/FlatListItems.js +3 -3
  55. package/src/commons/Device/Hanet/ItemHanetDevice.js +3 -3
  56. package/src/commons/Device/Hanet/ItemHanetDevice.test.js +3 -11
  57. package/src/commons/Device/ItemAddNew/index.js +2 -2
  58. package/src/commons/Device/ItemDevice.js +2 -2
  59. package/src/commons/Device/SonosSpeaker/index.js +3 -3
  60. package/src/commons/Device/WaterPurifierStatus/AlertStatusMachine.js +2 -2
  61. package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +2 -6
  62. package/src/commons/DisplayChecking/index.js +2 -2
  63. package/src/commons/EmergencyButton/AlertSendConfirm.js +2 -2
  64. package/src/commons/EmergencyButton/AlertSent.js +6 -2
  65. package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
  66. package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +5 -5
  67. package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +9 -9
  68. package/src/commons/Form/CurrencyInput.js +1 -15
  69. package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +1 -22
  70. package/src/commons/Header/HeaderCustom.js +8 -3
  71. package/src/commons/HeaderAni/index.js +2 -2
  72. package/src/commons/IconComponent/index.js +3 -3
  73. package/src/commons/MediaPlayerDetail/MediaPlayerFull.js +1 -1
  74. package/src/commons/MediaPlayerDetail/__test__/MediaPlayerFull.test.js +12 -48
  75. package/src/commons/MenuActionAddnew/__test__/MenuActionAddNew.test.js +1 -1
  76. package/src/commons/MenuActionList/__test__/MenuActionList.test.js +1 -0
  77. package/src/commons/NavBar/index.js +2 -2
  78. package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +3 -3
  79. package/src/commons/PreventAccess/__test__/PreventAccess.test.js +1 -13
  80. package/src/commons/Processing/__test__/Connecting.test.js +3 -14
  81. package/src/commons/SearchLocation/index.js +3 -3
  82. package/src/commons/SelectActionCard/index.js +2 -2
  83. package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +1 -18
  84. package/src/commons/SelectSubUnit/index.js +2 -2
  85. package/src/commons/SelectUnit/__test__/SelectUnit.test.js +1 -13
  86. package/src/commons/Sharing/BtnRemoveMember.js +2 -2
  87. package/src/commons/Sharing/StationDevicePermissions.js +2 -2
  88. package/src/commons/Sharing/WrapHeaderScrollable.js +1 -1
  89. package/src/commons/Sharing/__test__/ButtonRemoveMember.test.js +2 -2
  90. package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +1 -1
  91. package/src/commons/SubUnit/DeviceTemplate/ConfigAndEvaluation/ConfigAndEvaluation.js +2 -2
  92. package/src/commons/SubUnit/DeviceTemplate/ConfigValue/ConfigValue.js +2 -2
  93. package/src/commons/SubUnit/DeviceTemplate/EvaluationOverConfig/EvaluationOverConfig.js +2 -2
  94. package/src/commons/SubUnit/Item/index.js +3 -3
  95. package/src/commons/SubUnit/OneTap/ItemOneTap.js +2 -2
  96. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +11 -8
  97. package/src/commons/SubUnit/__test__/Favorites.test.js +1 -13
  98. package/src/commons/SubUnit/__test__/ShortDetail.test.js +5 -16
  99. package/src/commons/SummaryItem/index.js +22 -23
  100. package/src/commons/Tabbar/__test__/index.test.js +0 -11
  101. package/src/commons/Unit/HeaderUnit/index.js +84 -84
  102. package/src/commons/Unit/SharedUnit.js +7 -7
  103. package/src/commons/Unit/__test__/HeaderUnit.test.js +29 -52
  104. package/src/commons/Unit/__test__/SharedUnit.test.js +94 -105
  105. package/src/commons/UnitSummary/AirQuality/SegmentedRoundDisplay/index.js +11 -30
  106. package/src/commons/WrapParallaxScrollView/index.js +21 -50
  107. package/src/configs/API.js +1 -2
  108. package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +4 -15
  109. package/src/hooks/Common/useIsOwnerOfUnit.js +1 -1
  110. package/src/hooks/IoT/__test__/useRemoteControl.test.js +1 -1
  111. package/src/hooks/IoT/__test__/useWatchConfigs.test.js +6 -21
  112. package/src/iot/RemoteControl/HomeAssistant.js +1 -1
  113. package/src/iot/RemoteControl/__test__/Bluetooth.test.js +234 -232
  114. package/src/navigations/AutomateStack.js +2 -2
  115. package/src/navigations/EmergencyContactsStack.js +2 -2
  116. package/src/navigations/SharedStack.js +6 -4
  117. package/src/navigations/UnitStack.js +2 -10
  118. package/src/screens/ActivityLog/hooks/index.js +7 -4
  119. package/src/screens/ActivityLog/index.js +2 -2
  120. package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +4 -21
  121. package/src/screens/AddCommon/__test__/SelectUnit.test.js +7 -19
  122. package/src/screens/AddLocationMaps/__test__/index.test.js +3 -13
  123. package/src/screens/AddLocationMaps/index.js +11 -6
  124. package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +3 -20
  125. package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +11 -18
  126. package/src/screens/AddNewGateway/PlugAndPlay/__test__/ZigbeeDeviceConnectGuide.test.js +4 -21
  127. package/src/screens/AddNewGateway/RenameNewDevices.js +2 -2
  128. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +3 -3
  129. package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +0 -17
  130. package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +4 -19
  131. package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +3 -15
  132. package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +31 -51
  133. package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +9 -22
  134. package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +12 -19
  135. package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +6 -16
  136. package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +4 -15
  137. package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +3 -3
  138. package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +18 -10
  139. package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +1 -1
  140. package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +12 -9
  141. package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +12 -9
  142. package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +7 -21
  143. package/src/screens/AllGateway/DetailConfigActionInternal/__test__/index.test.js +0 -20
  144. package/src/screens/AllGateway/DetailConfigActionModbus/__test__/index.test.js +7 -24
  145. package/src/screens/AllGateway/DeviceGatewayInfo/__test__/index.test.js +0 -17
  146. package/src/screens/AllGateway/DeviceInternalDetail/__test__/index.test.js +84 -100
  147. package/src/screens/AllGateway/DeviceModbusDetail/__test__/index.test.js +64 -82
  148. package/src/screens/AllGateway/DeviceZigbeeDetail/__test__/index.test.js +36 -55
  149. package/src/screens/AllGateway/GatewayConnectionMethods/__test__/index.test.js +9 -18
  150. package/src/screens/AllGateway/GatewayDetail/__test__/index.test.js +10 -37
  151. package/src/screens/AllGateway/GatewayInfo/__test__/index.test.js +7 -32
  152. package/src/screens/AllGateway/__test__/index.test.js +1 -14
  153. package/src/screens/AllGateway/components/GatewayItem/__test__/index.test.js +0 -12
  154. package/src/screens/AllGateway/components/TabPaneCT/__test__/index.test.js +1 -13
  155. package/src/screens/AllGateway/components/TabPaneCT/index.js +1 -1
  156. package/src/screens/AllGateway/hooks/__test__/index.test.js +1 -8
  157. package/src/screens/AllGateway/test-utils.js +1 -1
  158. package/src/screens/Automate/AddNewAction/NewActionWrapper.js +2 -2
  159. package/src/screens/Automate/AddNewAction/SetupConfigCondition.js +27 -28
  160. package/src/screens/Automate/AddNewAction/__test__/ChooseAction.test.js +3 -3
  161. package/src/screens/Automate/AddNewAction/__test__/ChooseConfig.test.js +8 -5
  162. package/src/screens/Automate/AddNewAction/__test__/SelectControlDevices.test.js +2 -2
  163. package/src/screens/Automate/AddNewAction/__test__/SelectMonitorDevices.test.js +1 -18
  164. package/src/screens/Automate/AddNewAction/__test__/SetupConfigCondition.test.js +17 -15
  165. package/src/screens/Automate/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +4 -4
  166. package/src/screens/Automate/EditActionsList/__tests__/UpdateActionScript.test.js +38 -55
  167. package/src/screens/Automate/EditActionsList/__tests__/UpdateDelayScript.test.js +0 -18
  168. package/src/screens/Automate/EditActionsList/__tests__/UpdateNotifyScript.test.js +1 -19
  169. package/src/screens/Automate/EditActionsList/__tests__/index.test.js +14 -11
  170. package/src/screens/Automate/OneTap/__test__/AddNewOneTap.test.js +3 -3
  171. package/src/screens/Automate/Scenario/__test__/AddNewOneTap.test.js +2 -2
  172. package/src/screens/Automate/ScriptDetail/Components/AddActionScript.js +2 -2
  173. package/src/screens/Automate/ScriptDetail/__test__/index.test.js +33 -25
  174. package/src/screens/Automate/ScriptDetail/index.js +6 -6
  175. package/src/screens/Automate/SetSchedule/__test__/index.test.js +4 -4
  176. package/src/screens/Automate/SetSchedule/components/RowItem.js +3 -3
  177. package/src/screens/Automate/__test__/MultiUnits.test.js +7 -7
  178. package/src/screens/Automate/__test__/index.test.js +6 -6
  179. package/src/screens/Automate/index.js +2 -2
  180. package/src/screens/ChangePosition/__test__/index.test.js +1 -14
  181. package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +1 -23
  182. package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +1 -11
  183. package/src/screens/Device/EditDevice/index.js +2 -2
  184. package/src/screens/Device/__test__/detail.test.js +11 -11
  185. package/src/screens/Device/__test__/sensorDisplayItem.test.js +0 -12
  186. package/src/screens/Device/detail.js +14 -12
  187. package/src/screens/Drawer/Drawer.test.js +3 -11
  188. package/src/screens/Drawer/index.js +3 -4
  189. package/src/screens/EmergencyContacts/EmergencyContactsList.js +4 -8
  190. package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +3 -3
  191. package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +4 -17
  192. package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +3 -14
  193. package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +0 -10
  194. package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
  195. package/src/screens/EnterPassword/__test__/EnterPassword.test.js +4 -17
  196. package/src/screens/GuestInfo/__test__/index.test.js +0 -11
  197. package/src/screens/GuestInfo/components/RowGuestInfo.js +2 -2
  198. package/src/screens/GuestInfo/index.js +2 -2
  199. package/src/screens/HanetCamera/Detail.js +6 -2
  200. package/src/screens/HanetCamera/ManageAccess.js +3 -4
  201. package/src/screens/HanetCamera/MemberInfo.js +4 -4
  202. package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +2 -16
  203. package/src/screens/HanetCamera/__test__/Detail.test.js +1 -12
  204. package/src/screens/HanetCamera/__test__/ManageAccess.test.js +5 -16
  205. package/src/screens/HanetCamera/__test__/MemberInfo.test.js +5 -18
  206. package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
  207. package/src/screens/ManageAccess/__test__/ManageAccess.test.js +3 -19
  208. package/src/screens/ManageAccess/index.js +3 -3
  209. package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +7 -7
  210. package/src/screens/Notification/__test__/Notification.test.js +5 -15
  211. package/src/screens/Notification/__test__/NotificationItem.test.js +9 -19
  212. package/src/screens/Notification/index.js +5 -5
  213. package/src/screens/PlayBackCamera/__test__/index.test.js +13 -22
  214. package/src/screens/PlayBackCamera/index.js +2 -2
  215. package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +0 -11
  216. package/src/screens/ScanChipQR/components/QRScan/index.js +3 -3
  217. package/src/screens/SelectUnit/__test__/index.test.js +9 -29
  218. package/src/screens/SelectUnit/index.js +2 -2
  219. package/src/screens/SharedUnit/TabHeader.js +2 -2
  220. package/src/screens/Sharing/Components/EndDevice.js +3 -3
  221. package/src/screens/Sharing/SelectUser.js +5 -4
  222. package/src/screens/Sharing/UnitMemberList.js +7 -6
  223. package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +9 -4
  224. package/src/screens/Sharing/__test__/SelectShareDevice.test.js +2 -15
  225. package/src/screens/Sharing/__test__/SelectUser.test.js +2 -22
  226. package/src/screens/Sharing/__test__/UnitMemberList.test.js +2 -2
  227. package/src/screens/Sharing/__test__/UpdateShareDevice.test.js +4 -17
  228. package/src/screens/Sharing/hooks/__test__/index.test.js +2 -13
  229. package/src/screens/SmartAccount/Connecting/index.js +0 -2
  230. package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +3 -18
  231. package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +11 -21
  232. package/src/screens/SmartAccount/SuccessfullyConnected/index.js +3 -4
  233. package/src/screens/SmartAccount/__test__/Connecting.test.js +30 -36
  234. package/src/screens/SmartAccount/__test__/SmartAccount.test.js +12 -21
  235. package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +8 -17
  236. package/src/screens/SmartIr/__test__/SelectBrand.test.js +1 -11
  237. package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +1 -12
  238. package/src/screens/SmartIr/__test__/SmartIr.test.js +3 -11
  239. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +6 -5
  240. package/src/screens/SmartIr/components/SelectBrand.js +2 -2
  241. package/src/screens/SubUnit/AddSubUnit.js +1 -0
  242. package/src/screens/SubUnit/EditSubUnit.js +3 -2
  243. package/src/screens/SubUnit/ManageSubUnit.js +5 -5
  244. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +9 -31
  245. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +12 -30
  246. package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +2 -2
  247. package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +0 -12
  248. package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +7 -20
  249. package/src/screens/Template/__test__/EditTemplate.test.js +4 -15
  250. package/src/screens/Template/__test__/GatewayList.test.js +0 -9
  251. package/src/screens/Template/__test__/detail.test.js +8 -8
  252. package/src/screens/Template/__test__/index.test.js +3 -14
  253. package/src/screens/Template/detail.js +2 -2
  254. package/src/screens/Unit/Detail.js +12 -53
  255. package/src/screens/Unit/SelectAddToFavorites.js +2 -2
  256. package/src/screens/Unit/SelectAddress.js +9 -4
  257. package/src/screens/Unit/SmartAccountItem.js +2 -2
  258. package/src/screens/Unit/Station/__test__/index.test.js +2 -2
  259. package/src/screens/Unit/Summaries.js +24 -29
  260. package/src/screens/Unit/__test__/AddMenu.test.js +5 -2
  261. package/src/screens/Unit/__test__/CheckSendEmail.test.js +0 -12
  262. package/src/screens/Unit/__test__/ChooseLocation.test.js +1 -4
  263. package/src/screens/Unit/__test__/Detail.test.js +14 -12
  264. package/src/screens/Unit/__test__/ManageUnit.test.js +2 -17
  265. package/src/screens/Unit/__test__/MoreMenu.test.js +1 -11
  266. package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +3 -14
  267. package/src/screens/Unit/__test__/SelectAddress.test.js +4 -17
  268. package/src/screens/Unit/__test__/SmartAccount.test.js +14 -11
  269. package/src/screens/Unit/__test__/SmartAccountItem.test.js +0 -11
  270. package/src/screens/Unit/__test__/Summaries.test.js +2 -14
  271. package/src/screens/Unit/components/AutomateScript/index.js +2 -2
  272. package/src/screens/Unit/components/ButtonWrapper/index.js +3 -4
  273. package/src/screens/Unit/components/Header/index.js +5 -4
  274. package/src/screens/Unit/components/SharedUnit/index.js +5 -5
  275. package/src/screens/Unit/components/__test__/Header.test.js +1 -14
  276. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +1 -11
  277. package/src/screens/Unit/components/__test__/SharedUnit.test.js +1 -11
  278. package/src/screens/UnitSummary/__test__/index.test.js +51 -17
  279. package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +8 -25
  280. package/src/screens/UnitSummary/components/AirQuality/__test__/index.test.js +1 -7
  281. package/src/screens/UnitSummary/components/AirQuality/index.js +8 -3
  282. package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +0 -11
  283. package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +1 -16
  284. package/src/screens/UnitSummary/components/Temperature/index.js +5 -1
  285. package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +0 -8
  286. package/src/screens/UnitSummary/components/UvIndex/index.js +6 -2
  287. package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +2 -2
  288. package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +14 -18
  289. package/src/screens/UnitSummary/components/__test__/UnitSummary.test.js +8 -8
  290. package/src/screens/UnitSummary/index.js +4 -8
  291. package/src/utils/Converter/__test__/timer.test.js +8 -0
  292. package/src/utils/Functions/preloadImages.js +13 -14
  293. package/src/utils/Monitor.js +2 -3
  294. package/src/utils/Route/index.js +0 -1
  295. package/src/utils/Storage.js +1 -1
  296. package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +0 -48
  297. package/src/commons/Device/WindSpeed/LinearChart/index.js +0 -155
  298. package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +0 -27
  299. package/src/screens/AddNewGateway/hooks/index.js +0 -31
  300. package/src/screens/SubUnit/Detail.js +0 -150
  301. package/src/screens/SubUnit/__test__/Detail.test.js +0 -125
  302. package/src/screens/UnitSummary/components/Temperature/ChartAverage/index.js +0 -62
  303. package/src/screens/UnitSummary/components/Temperature/__test__/ChartAverage.test.js +0 -17
  304. package/src/utils/dateHelper/getTickValues.js +0 -22
@@ -6,7 +6,7 @@ import React, {
6
6
  useState,
7
7
  } from 'react';
8
8
  import { FlatList, Image, TouchableOpacity, View } from 'react-native';
9
- import { IconFill } from '@ant-design/icons-react-native/es';
9
+ import AntDesign from 'react-native-vector-icons/AntDesign';
10
10
  import {
11
11
  useIsFocused,
12
12
  useNavigation,
@@ -197,7 +197,7 @@ const Automate = () => {
197
197
  /* istanbul ignore next */
198
198
  headerRight: () => (
199
199
  <TouchableOpacity style={styles.buttonAdd}>
200
- <IconFill name={'plus-circle'} size={28} color={Colors.Orange} />
200
+ <AntDesign name={'pluscircle'} size={28} color={Colors.Orange} />
201
201
  </TouchableOpacity>
202
202
  ),
203
203
  });
@@ -13,20 +13,8 @@ import { ToastBottomHelper } from '../../../utils/Utils';
13
13
  import BottomButtonView from '../../../commons/BottomButtonView';
14
14
 
15
15
  const mock = new MockAdapter(api.axiosInstance);
16
- const mockGoBack = jest.fn();
17
16
  const mockSetDisplay = jest.fn();
18
17
 
19
- jest.mock('@react-navigation/native', () => {
20
- return {
21
- ...jest.requireActual('@react-navigation/native'),
22
- useRoute: jest.fn(),
23
-
24
- useNavigation: () => ({
25
- goBack: mockGoBack,
26
- }),
27
- };
28
- });
29
-
30
18
  const wrapComponent = ({ ...rest }) => (
31
19
  <SCProvider initState={mockSCStore({})}>
32
20
  <ChangePosition {...rest} />
@@ -38,7 +26,6 @@ describe('Test ChangePosition', () => {
38
26
 
39
27
  beforeEach(() => {
40
28
  useRoute.mockClear();
41
- mockGoBack.mockClear();
42
29
  });
43
30
 
44
31
  it('render ChangePosition', async () => {
@@ -70,7 +57,7 @@ describe('Test ChangePosition', () => {
70
57
  await act(async () => {
71
58
  bottomButtonView[0].props.onPressMain();
72
59
  });
73
- expect(mockGoBack).toHaveBeenCalled();
60
+ expect(global.mockedGoBack).toHaveBeenCalled();
74
61
  expect(mockFetchData).toHaveBeenCalled();
75
62
  expect(mockSetDisplay).toHaveBeenCalled();
76
63
  expect(spyToastSuccess).toBeCalledWith('Updated widget successfully');
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React from 'react';
2
2
  import renderer, { act } from 'react-test-renderer';
3
3
 
4
4
  import { SCProvider } from '../../../context';
@@ -18,26 +18,6 @@ const wrapComponent = (route, navigation) => (
18
18
  </SCProvider>
19
19
  );
20
20
 
21
- const mockNavigate = jest.fn();
22
- const mockGoBack = jest.fn();
23
- jest.mock('@react-navigation/native', () => {
24
- return {
25
- ...jest.requireActual('@react-navigation/native'),
26
- useNavigation: () => ({
27
- navigate: mockNavigate,
28
- goBack: mockGoBack,
29
- }),
30
- };
31
- });
32
-
33
- const mockSetState = jest.fn();
34
- jest.mock('react', () => {
35
- return {
36
- ...jest.requireActual('react'),
37
- useState: jest.fn((init) => [init, mockSetState]),
38
- };
39
- });
40
-
41
21
  describe('Test ConfirmUnitDeletion', () => {
42
22
  let tree;
43
23
  let route;
@@ -53,7 +33,6 @@ describe('Test ConfirmUnitDeletion', () => {
53
33
  });
54
34
 
55
35
  it('test render ConfirmUnitDeletion', async () => {
56
- useState.mockImplementationOnce((init) => ['new_name', mockSetState]);
57
36
  await act(async () => {
58
37
  tree = await renderer.create(wrapComponent(route));
59
38
  });
@@ -65,7 +44,6 @@ describe('Test ConfirmUnitDeletion', () => {
65
44
  });
66
45
  });
67
46
  it('Onpress button ConfirmUnitDeletion ', async () => {
68
- useState.mockImplementationOnce((init) => ['YES', mockSetState]);
69
47
  await act(async () => {
70
48
  tree = await renderer.create(wrapComponent(route));
71
49
  });
@@ -23,17 +23,7 @@ const wrapComponent = (route) => (
23
23
 
24
24
  const mock = new MockAdapter(api.axiosInstance);
25
25
 
26
- const mockPop = jest.fn();
27
26
  const mockSetSensorDetail = jest.fn();
28
- jest.mock('@react-navigation/native', () => {
29
- return {
30
- ...jest.requireActual('@react-navigation/native'),
31
- useRoute: jest.fn(),
32
- useNavigation: () => ({
33
- pop: mockPop,
34
- }),
35
- };
36
- });
37
27
 
38
28
  describe('Test EditDevice', () => {
39
29
  let tree;
@@ -135,7 +125,7 @@ describe('Test EditDevice', () => {
135
125
  await alertAction.props.rightButtonClick();
136
126
  });
137
127
  expect(alertAction.props.visible).toBeFalsy();
138
- expect(mockPop).toHaveBeenCalled();
128
+ expect(global.mockedPop).toHaveBeenCalled();
139
129
  });
140
130
 
141
131
  it('test delete EditDevice failure', async () => {
@@ -2,7 +2,7 @@ import React, { memo, useState, useCallback } from 'react';
2
2
  import { View, TouchableOpacity } from 'react-native';
3
3
  import { useTranslations } from '../../../hooks/Common/useTranslations';
4
4
  import { HeaderCustom } from '../../../commons/Header';
5
- import { IconOutline } from '@ant-design/icons-react-native';
5
+ import AntDesign from 'react-native-vector-icons/AntDesign';
6
6
  import { Colors } from '../../../configs';
7
7
  import Text from '../../../commons/Text';
8
8
  import { useRoute } from '@react-navigation/native';
@@ -92,7 +92,7 @@ const EditDevice = memo(() => {
92
92
  <Text type="Body" Reugular color={Colors.Grey7}>
93
93
  {sensorName}
94
94
  </Text>
95
- <IconOutline
95
+ <AntDesign
96
96
  name="right"
97
97
  size={18}
98
98
  color={Colors.Gray7}
@@ -11,7 +11,7 @@ import { AlertSent } from '../../../commons/EmergencyButton/AlertSent';
11
11
  import { AlertAction, ButtonPopup, MenuActionMore } from '../../../commons';
12
12
  import { AccessibilityLabel } from '../../../configs/Constants';
13
13
  import Text from '../../../commons/Text';
14
- import { IconFill } from '@ant-design/icons-react-native';
14
+ import AntDesign from 'react-native-vector-icons/AntDesign';
15
15
  import CurrentRainSensor from '../../../commons/Device/RainningSensor/CurrentRainSensor';
16
16
  import { getTranslate } from '../../../utils/I18n';
17
17
  import { SCProvider } from '../../../context';
@@ -115,7 +115,7 @@ describe('test DeviceDetail', () => {
115
115
  command_prefer_over_googlehome: false,
116
116
  command_prefer_over_internet: true,
117
117
  googlehome_actions: [],
118
- icon: 'caret-up',
118
+ icon: 'caretup',
119
119
  id: 9,
120
120
  key: '2b949045-8e03-4c07-a855-7794ade2e69c',
121
121
  },
@@ -137,13 +137,13 @@ describe('test DeviceDetail', () => {
137
137
  command_prefer_over_googlehome: false,
138
138
  command_prefer_over_internet: true,
139
139
  googlehome_actions: [],
140
- icon: 'caret-down',
140
+ icon: 'caretdown',
141
141
  id: 10,
142
142
  key: 'a492e08c-8cb1-44ee-8ea0-46aaca4e5141',
143
143
  },
144
- icon1: 'caret-up',
144
+ icon1: 'caretup',
145
145
  icon2: 'stop',
146
- icon3: 'caret-down',
146
+ icon3: 'caretdown',
147
147
  text1: 'UP',
148
148
  text2: 'STOP/UNLOCK',
149
149
  text3: 'DOWN',
@@ -352,7 +352,7 @@ describe('test DeviceDetail', () => {
352
352
  const buttonPopupIcon = instance.find(
353
353
  (el) =>
354
354
  el.props.accessibilityLabel ===
355
- AccessibilityLabel.BUTTON_POPUP_RESOLVED_ICON && el.type === IconFill
355
+ AccessibilityLabel.BUTTON_POPUP_RESOLVED_ICON && el.type === AntDesign
356
356
  );
357
357
  expect(buttonPopupTitle.props.children).toEqual([
358
358
  'Unit name',
@@ -403,16 +403,16 @@ describe('test DeviceDetail', () => {
403
403
  action1: 'a',
404
404
  action2: 'b',
405
405
  action3: 'b',
406
- icon1: 'caret-up',
406
+ icon1: 'caretup',
407
407
  icon2: 'stop',
408
- icon3: 'caret-down',
408
+ icon3: 'caretdown',
409
409
  text1: 'A',
410
410
  text2: 'B',
411
411
  text3: 'C',
412
412
  action1_data: {
413
413
  id: 9,
414
414
  key: 'a',
415
- icon: 'caret-up',
415
+ icon: 'caretup',
416
416
  color: '#00979D',
417
417
  googlehome_actions: [],
418
418
  command_prefer_over_internet: false,
@@ -432,7 +432,7 @@ describe('test DeviceDetail', () => {
432
432
  action3_data: {
433
433
  id: 10,
434
434
  key: 'b',
435
- icon: 'caret-down',
435
+ icon: 'caretdown',
436
436
  color: '#00979D',
437
437
  googlehome_actions: [],
438
438
  command_prefer_over_internet: false,
@@ -728,7 +728,7 @@ describe('test DeviceDetail', () => {
728
728
  await act(async () => {
729
729
  await menu.props.onItemClick(gotoActivityLog);
730
730
  });
731
- expect(mockedNavigate).toHaveBeenCalledWith(Routes.ActivityLog, {
731
+ expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.ActivityLog, {
732
732
  id: route.params.sensorData.id,
733
733
  type: 'action',
734
734
  share: route.params.unitData,
@@ -31,18 +31,6 @@ const wrapComponent = ({ ...rest }) => (
31
31
  </SCProvider>
32
32
  );
33
33
 
34
- const mockNavigate = jest.fn();
35
- jest.mock('@react-navigation/native', () => {
36
- return {
37
- ...jest.requireActual('@react-navigation/native'),
38
- useRoute: jest.fn(),
39
- useNavigation: () => ({
40
- navigate: mockNavigate,
41
- }),
42
- useFocusEffect: (func) => func(),
43
- };
44
- });
45
-
46
34
  describe('Test SensorDisplayItem', () => {
47
35
  let tree;
48
36
  it('render visualChart', async () => {
@@ -8,8 +8,8 @@ import React, {
8
8
  } from 'react';
9
9
  import { View, TouchableOpacity, Platform } from 'react-native';
10
10
  import { useNavigation, useFocusEffect } from '@react-navigation/native';
11
- import { IconFill, IconOutline } from '@ant-design/icons-react-native';
12
- import { Icon } from '@ant-design/react-native';
11
+ import AntDesign from 'react-native-vector-icons/AntDesign';
12
+ import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
13
13
  import moment from 'moment';
14
14
 
15
15
  import { SCContext } from '../../context';
@@ -215,7 +215,7 @@ const DeviceDetail = ({ route }) => {
215
215
 
216
216
  useEffect(() => {
217
217
  if (
218
- unit.remote_control_options &&
218
+ unit?.remote_control_options &&
219
219
  unit.remote_control_options.googlehome?.length &&
220
220
  isNetworkConnected
221
221
  ) {
@@ -685,9 +685,9 @@ const DeviceDetail = ({ route }) => {
685
685
  >
686
686
  <View style={styles.buttonStar}>
687
687
  {isFavorite ? (
688
- <IconFill name="star" size={25} color={Colors.Yellow6} />
688
+ <AntDesign name="star" size={25} color={Colors.Yellow6} />
689
689
  ) : (
690
- <IconOutline name="star" size={25} />
690
+ <AntDesign name="staro" size={25} />
691
691
  )}
692
692
  </View>
693
693
  </TouchableOpacity>
@@ -695,7 +695,7 @@ const DeviceDetail = ({ route }) => {
695
695
  {isShowSetupEmergencyContact && (
696
696
  <TouchableOpacity onPress={onPressSetting}>
697
697
  <View style={styles.button}>
698
- <Icon name="setting" size={25} color={Colors.Black} />
698
+ <AntDesign name="setting" size={25} color={Colors.Black} />
699
699
  </View>
700
700
  </TouchableOpacity>
701
701
  )}
@@ -706,7 +706,7 @@ const DeviceDetail = ({ route }) => {
706
706
  ref={refMenuAction}
707
707
  accessibilityLabel={AccessibilityLabel.HEADER_DEVICE_BUTTON_MORE}
708
708
  >
709
- <Icon name={'more'} size={27} color={Colors.Black} />
709
+ <MaterialIcons name={'more-vert'} size={27} color={Colors.Black} />
710
710
  </TouchableOpacity>
711
711
  </View>
712
712
  ),
@@ -755,7 +755,7 @@ const DeviceDetail = ({ route }) => {
755
755
  >
756
756
  {display.items.map((item, index) => {
757
757
  return (
758
- <>
758
+ <View key={item?.id?.toString()}>
759
759
  {!item.is_configuration_ready && (
760
760
  <Text center>{t('bellow_widget_is_not_configured')}</Text>
761
761
  )}
@@ -779,7 +779,7 @@ const DeviceDetail = ({ route }) => {
779
779
  setShowWindDirection={setShowWindDirection}
780
780
  background={station?.background}
781
781
  />
782
- </>
782
+ </View>
783
783
  );
784
784
  })}
785
785
  </SensorConnectStatusViewHeader>
@@ -791,7 +791,9 @@ const DeviceDetail = ({ route }) => {
791
791
  canManageSubUnit && (
792
792
  <BottomButtonView
793
793
  style={styles.bottomButtonEmergencyContact}
794
- mainIcon={<Icon name="plus" size={16} color={Colors.Primary} />}
794
+ mainIcon={
795
+ <AntDesign name="plus" size={16} color={Colors.Primary} />
796
+ }
795
797
  mainTitle={t('setup_my_emergency_contact')}
796
798
  onPressMain={onSetupContacts}
797
799
  typeMain="primaryBorder"
@@ -825,7 +827,7 @@ const DeviceDetail = ({ route }) => {
825
827
  {isShowEmergencyResolve && !isEmergencyPopupScreen && (
826
828
  <BottomButtonView
827
829
  style={styles.bottomButtonEmergencyResolve}
828
- mainIcon={<IconFill name="tool" size={15} color={Colors.Gray6} />}
830
+ mainIcon={<AntDesign name="tool" size={15} color={Colors.Gray6} />}
829
831
  mainTitle={t('resolve_situation')}
830
832
  onPressMain={onPressResolveSituationConfirm}
831
833
  topComponent={
@@ -865,7 +867,7 @@ const DeviceDetail = ({ route }) => {
865
867
  >
866
868
  {unit?.name} - {sensor?.station?.name}
867
869
  </Text>
868
- <IconFill
870
+ <AntDesign
869
871
  accessibilityLabel={AccessibilityLabel.BUTTON_POPUP_RESOLVED_ICON}
870
872
  name="check-circle"
871
873
  size={42}
@@ -4,16 +4,7 @@ import AccessibilityLabel from '../../configs/AccessibilityLabel';
4
4
  import { SCProvider } from '../../context';
5
5
  import { mockSCStore } from '../../context/mockStore';
6
6
  import Drawer, { Row } from './index';
7
-
8
- const mockDispatch = jest.fn();
9
- jest.mock('@react-navigation/native', () => {
10
- return {
11
- ...jest.requireActual('@react-navigation/native'),
12
- useNavigation: () => ({
13
- dispatch: mockDispatch,
14
- }),
15
- };
16
- });
7
+ import { useNavigation } from '@react-navigation/native';
17
8
 
18
9
  const wrapComponent = (initState = mockSCStore({})) => (
19
10
  <SCProvider initState={initState}>
@@ -24,6 +15,7 @@ const wrapComponent = (initState = mockSCStore({})) => (
24
15
  describe('Drawer', () => {
25
16
  let tree;
26
17
  it('test render with user', async () => {
18
+ const { dispatch } = useNavigation();
27
19
  await act(async () => {
28
20
  tree = await renderer.create(wrapComponent());
29
21
  });
@@ -43,7 +35,7 @@ describe('Drawer', () => {
43
35
  await act(async () => {
44
36
  await rows[2].props.onPress();
45
37
  });
46
- expect(mockDispatch).toBeCalledWith({
38
+ expect(dispatch).toBeCalledWith({
47
39
  payload: { index: 0, routes: [{ name: 'Main' }] },
48
40
  type: 'RESET',
49
41
  });
@@ -1,5 +1,4 @@
1
- import { IconOutline } from '@ant-design/icons-react-native';
2
- import { Icon } from '@ant-design/react-native';
1
+ import AntDesign from 'react-native-vector-icons/AntDesign';
3
2
  import React, { useCallback, useContext } from 'react';
4
3
  import {
5
4
  Image,
@@ -60,7 +59,7 @@ const DrawerContainer = () => {
60
59
  style={styles.avatar}
61
60
  accessibilityLabel={AccessibilityLabel.SIDE_MENU_AVATAR_USER}
62
61
  >
63
- <Icon name={'user'} size={27} />
62
+ <AntDesign name={'user'} size={27} />
64
63
  </View>
65
64
  )}
66
65
  <View style={styles.textContainer}>
@@ -117,7 +116,7 @@ export const Row = ({
117
116
  ]}
118
117
  accessibilityLabel={accessibilityLabel}
119
118
  >
120
- <IconOutline name={image} size={24} />
119
+ <AntDesign name={image} size={24} />
121
120
 
122
121
  <View style={styles.wrapText}>
123
122
  <Text style={[styles.text]}>{name}</Text>
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useEffect } from 'react';
2
2
  import { StyleSheet, TouchableOpacity, View } from 'react-native';
3
- import { IconOutline } from '@ant-design/icons-react-native';
3
+ import AntDesign from 'react-native-vector-icons/AntDesign';
4
4
  import { useIsFocused, useNavigation } from '@react-navigation/native';
5
5
  import { useTranslations } from '../../hooks/Common/useTranslations';
6
6
  import { AlertAction, MenuActionList, Section } from '../../commons';
@@ -99,7 +99,7 @@ export const EmergencyContactsList = ({ route }) => {
99
99
  : 'disable'
100
100
  }
101
101
  leftIcon={
102
- <IconOutline name={'plus'} size={20} color={Colors.White} />
102
+ <AntDesign name={'plus'} size={20} color={Colors.White} />
103
103
  }
104
104
  text={t('add_new')}
105
105
  subtext={t('emergency_max_contacts', {
@@ -113,7 +113,7 @@ export const EmergencyContactsList = ({ route }) => {
113
113
  key={contact.id}
114
114
  index={index}
115
115
  leftIcon={
116
- <IconOutline name={'user'} size={20} color={Colors.White} />
116
+ <AntDesign name={'user'} size={20} color={Colors.White} />
117
117
  }
118
118
  text={contact.name}
119
119
  subtext={contact.phone_number}
@@ -122,11 +122,7 @@ export const EmergencyContactsList = ({ route }) => {
122
122
  style={styles.buttonRemove}
123
123
  onPress={onPressRemoveContact(contact)}
124
124
  >
125
- <IconOutline
126
- name={'minus'}
127
- size={20}
128
- color={Colors.Gray8}
129
- />
125
+ <AntDesign name={'minus'} size={20} color={Colors.Gray8} />
130
126
  </TouchableOpacity>
131
127
  }
132
128
  />
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useEffect, useState } from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
- import { IconOutline } from '@ant-design/icons-react-native';
3
+ import AntDesign from 'react-native-vector-icons/AntDesign';
4
4
  import { useNavigation } from '@react-navigation/native';
5
5
  import { useTranslations } from '../../hooks/Common/useTranslations';
6
6
  import { Section, ViewButtonBottom } from '../../commons';
@@ -81,7 +81,7 @@ export const EmergencyContactsSelectContacts = ({ route }) => {
81
81
  }
82
82
  index={index}
83
83
  leftIcon={
84
- <IconOutline name={'user'} size={20} color={Colors.White} />
84
+ <AntDesign name={'user'} size={20} color={Colors.White} />
85
85
  }
86
86
  text={contact.name}
87
87
  subtext={contact.phone_number}
@@ -91,7 +91,7 @@ export const EmergencyContactsSelectContacts = ({ route }) => {
91
91
  {currentContacts.some(
92
92
  (item) => item?.name === contact?.name
93
93
  ) && (
94
- <IconOutline
94
+ <AntDesign
95
95
  name={'check-circle'}
96
96
  size={20}
97
97
  color={Colors.Primary}
@@ -20,19 +20,8 @@ const wrapComponent = (route) => (
20
20
 
21
21
  jest.mock('react-native-toast-message');
22
22
 
23
- const mockedGoBack = jest.fn();
24
-
25
23
  const mock = new MockAdapter(api.axiosInstance);
26
24
 
27
- jest.mock('@react-navigation/native', () => {
28
- return {
29
- ...jest.requireActual('@react-navigation/native'),
30
- useNavigation: () => ({
31
- goBack: mockedGoBack,
32
- }),
33
- };
34
- });
35
-
36
25
  describe('test EmergencyContactAddNew', () => {
37
26
  let route;
38
27
  beforeEach(() => {
@@ -44,9 +33,7 @@ describe('test EmergencyContactAddNew', () => {
44
33
  },
45
34
  },
46
35
  };
47
- mockedGoBack.mockClear();
48
- });
49
- afterEach(() => {
36
+ global.mockedGoBack.mockClear();
50
37
  Toast.show.mockClear();
51
38
  });
52
39
 
@@ -105,7 +92,7 @@ describe('test EmergencyContactAddNew', () => {
105
92
  viewButtonBottom.props.onLeftClick();
106
93
  });
107
94
 
108
- expect(mockedGoBack).toHaveBeenCalledTimes(1);
95
+ expect(global.mockedGoBack).toHaveBeenCalledTimes(1);
109
96
  });
110
97
 
111
98
  it('onSave success', async () => {
@@ -129,7 +116,7 @@ describe('test EmergencyContactAddNew', () => {
129
116
  await viewButtonBottom.props.onRightClick();
130
117
  });
131
118
 
132
- expect(mockedGoBack).toHaveBeenCalledTimes(1);
119
+ expect(global.mockedGoBack).toHaveBeenCalledTimes(1);
133
120
  });
134
121
 
135
122
  it('onSave failed', async () => {
@@ -159,7 +146,7 @@ describe('test EmergencyContactAddNew', () => {
159
146
  text1: getTranslate('en', 'create_contact_failed'),
160
147
  visibilityTime: 1000,
161
148
  });
162
- expect(mockedGoBack).not.toHaveBeenCalled();
149
+ expect(global.mockedGoBack).not.toHaveBeenCalled();
163
150
  });
164
151
 
165
152
  it('invalid phone number', async () => {
@@ -13,6 +13,7 @@ import { SCProvider } from '../../../context';
13
13
  import { mockSCStore } from '../../../context/mockStore';
14
14
  import api from '../../../utils/Apis/axios';
15
15
  import { RowUser } from '../../../commons/RowUser';
16
+ import { useNavigation } from '@react-navigation/native';
16
17
 
17
18
  const mock = new MockAdapter(api.axiosInstance);
18
19
 
@@ -22,18 +23,6 @@ const wrapComponent = (route) => (
22
23
  </SCProvider>
23
24
  );
24
25
 
25
- const mockedNavigate = jest.fn();
26
-
27
- jest.mock('@react-navigation/native', () => {
28
- return {
29
- ...jest.requireActual('@react-navigation/native'),
30
- useNavigation: () => ({
31
- navigate: mockedNavigate,
32
- }),
33
- useIsFocused: () => true,
34
- };
35
- });
36
-
37
26
  describe('test EmergencyContactList', () => {
38
27
  let route;
39
28
 
@@ -44,7 +33,6 @@ describe('test EmergencyContactList', () => {
44
33
  group: 1,
45
34
  },
46
35
  };
47
- mockedNavigate.mockClear();
48
36
  mock.reset();
49
37
  });
50
38
  let tree;
@@ -137,6 +125,7 @@ describe('test EmergencyContactList', () => {
137
125
  });
138
126
 
139
127
  it('onItemAddClick select unit members', async () => {
128
+ const { navigate } = useNavigation();
140
129
  await act(async () => {
141
130
  tree = await create(wrapComponent(route));
142
131
  });
@@ -159,7 +148,7 @@ describe('test EmergencyContactList', () => {
159
148
  buttonsMenuActionList[1].props.onPress();
160
149
  });
161
150
 
162
- expect(mockedNavigate).toHaveBeenCalledWith(
151
+ expect(navigate).toHaveBeenCalledWith(
163
152
  Routes.EmergencyContactsSelectContacts,
164
153
  {
165
154
  unitId: route.params.unitId,
@@ -14,16 +14,6 @@ import { getTranslate } from '../../../utils/I18n';
14
14
 
15
15
  const mock = new MockAdapter(api.axiosInstance);
16
16
 
17
- const mockedNavigate = jest.fn();
18
- jest.mock('@react-navigation/native', () => {
19
- return {
20
- ...jest.requireActual('@react-navigation/native'),
21
- useNavigation: () => ({
22
- navigate: mockedNavigate,
23
- }),
24
- };
25
- });
26
-
27
17
  const wrapComponent = (route) => (
28
18
  <SCProvider initState={mockSCStore({})}>
29
19
  <EmergencyContactsSelectContacts route={route} />
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useState } from 'react';
2
2
  import { View, TouchableOpacity } from 'react-native';
3
- import { IconFill } from '@ant-design/icons-react-native';
3
+ import AntDesign from 'react-native-vector-icons/AntDesign';
4
4
 
5
5
  import Text from '../../../commons/Text';
6
6
  import styles from '../styles/DropDownItem';
@@ -29,7 +29,7 @@ const DropDownItem = ({ label, data, onSelectItem, isOpen, onOpen, index }) => {
29
29
  <View style={styles.dropDownContainer}>
30
30
  <TouchableOpacity style={styles.dropDownStyle} onPress={handleOnOpen}>
31
31
  <Text>{selecteValue?.label}</Text>
32
- <IconFill name="caret-down" size={18} color={Colors.Gray8} />
32
+ <AntDesign name="caretdown" size={18} color={Colors.Gray8} />
33
33
  </TouchableOpacity>
34
34
 
35
35
  {isOpen && (
@@ -9,6 +9,7 @@ import EnterPassword from '../index';
9
9
  import { AccessibilityLabel } from '../../../configs/Constants';
10
10
  import { API } from '../../../configs';
11
11
  import api from '../../../utils/Apis/axios';
12
+ import { useNavigation } from '@react-navigation/native';
12
13
 
13
14
  const mock = new MockAdapter(api.axiosInstance);
14
15
 
@@ -18,19 +19,9 @@ const wrapComponent = (route) => (
18
19
  </SCProvider>
19
20
  );
20
21
 
21
- const mockNavigate = jest.fn();
22
- jest.mock('@react-navigation/native', () => {
23
- return {
24
- ...jest.requireActual('@react-navigation/native'),
25
- useNavigation: () => ({
26
- navigate: mockNavigate,
27
- }),
28
- useIsFocused: jest.fn(),
29
- };
30
- });
31
-
32
22
  describe('Test EnterPassword', () => {
33
23
  let tree;
24
+ const { navigate } = useNavigation();
34
25
  const buttonDone = (instance) => {
35
26
  return instance.findAll(
36
27
  (el) =>
@@ -40,10 +31,6 @@ describe('Test EnterPassword', () => {
40
31
  );
41
32
  };
42
33
 
43
- beforeEach(() => {
44
- mockNavigate.mockClear();
45
- });
46
-
47
34
  it('test render EnterPassword button done', async () => {
48
35
  const route = {
49
36
  params: { dataParams: {}, type: '' },
@@ -116,7 +103,7 @@ describe('Test EnterPassword', () => {
116
103
  await act(async () => {
117
104
  await button[0].props.onPress();
118
105
  });
119
- expect(mockNavigate).toBeCalled();
106
+ expect(navigate).toBeCalled();
120
107
  });
121
108
 
122
109
  it('test EnterPassword button failure', async () => {
@@ -138,6 +125,6 @@ describe('Test EnterPassword', () => {
138
125
  await act(async () => {
139
126
  await button[0].props.onPress();
140
127
  });
141
- expect(mockNavigate).not.toBeCalled();
128
+ expect(navigate).not.toBeCalled();
142
129
  });
143
130
  });