@eohjsc/react-native-smart-city 0.5.9 → 0.6.0-rc2

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 (305) hide show
  1. package/README.md +1 -1
  2. package/android/build.gradle +8 -10
  3. package/package.json +52 -69
  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__/index.test.js +3 -3
  8. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +3 -3
  9. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
  10. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +0 -15
  11. package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +2 -2
  12. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +2 -2
  13. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +2 -2
  14. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +5 -5
  15. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +3 -3
  16. package/src/commons/ActionGroup/TerminalBoxTemplate.js +2 -2
  17. package/src/commons/ActionGroup/TextBoxTemplate.js +2 -2
  18. package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonTemplate.test.js +4 -4
  19. package/src/commons/ActionGroup/TimerActionTemplate.js +3 -4
  20. package/src/commons/ActionGroup/TwoButtonTemplate/index.js +2 -2
  21. package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +2 -9
  22. package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +4 -11
  23. package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +2 -9
  24. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +4 -18
  25. package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +2 -2
  26. package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +1 -8
  27. package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +0 -7
  28. package/src/commons/ActionGroup/__test__/SwitchButtonTemplate.test.js +4 -15
  29. package/src/commons/ActionGroup/__test__/TerminalBoxTemplate.test.js +0 -7
  30. package/src/commons/ActionGroup/__test__/TextBoxTemplate.test.js +1 -8
  31. package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +1 -8
  32. package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +1 -8
  33. package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +2 -9
  34. package/src/commons/ActionGroup/__test__/index.test.js +14 -21
  35. package/src/commons/ActionTemplate/__test__/index.test.js +2 -0
  36. package/src/commons/ActionTemplate/__test__/utils.js +21 -0
  37. package/src/commons/ActionTemplate/index.js +1 -2
  38. package/src/commons/BackDefault/index.js +2 -2
  39. package/src/commons/ButtonPopup/index.js +2 -2
  40. package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +1 -12
  41. package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +27 -20
  42. package/src/commons/Dashboard/MyUnit/index.js +0 -1
  43. package/src/commons/DateTimeRangeChange/DateTimeButton.js +2 -2
  44. package/src/commons/Device/ConnectedViewHeader.js +2 -2
  45. package/src/commons/Device/DisconnectedView.js +2 -2
  46. package/src/commons/Device/Emergency/EmergencyDetail.js +3 -3
  47. package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +2 -2
  48. package/src/commons/Device/FlatListItems.js +3 -3
  49. package/src/commons/Device/Hanet/ItemHanetDevice.js +3 -3
  50. package/src/commons/Device/Hanet/ItemHanetDevice.test.js +3 -11
  51. package/src/commons/Device/HorizontalBarChart.js +1 -1
  52. package/src/commons/Device/ItemAddNew/index.js +2 -2
  53. package/src/commons/Device/ItemDevice.js +2 -2
  54. package/src/commons/Device/PowerConsumptionChart.js +154 -0
  55. package/src/commons/Device/SonosSpeaker/index.js +3 -3
  56. package/src/commons/Device/WaterPurifierStatus/AlertStatusMachine.js +2 -2
  57. package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +2 -6
  58. package/src/commons/DisplayChecking/index.js +2 -2
  59. package/src/commons/EmergencyButton/AlertSendConfirm.js +2 -2
  60. package/src/commons/EmergencyButton/AlertSent.js +2 -2
  61. package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
  62. package/src/commons/Form/CurrencyInput.js +1 -15
  63. package/src/commons/Header/HeaderCustom.js +3 -3
  64. package/src/commons/HeaderAni/index.js +2 -2
  65. package/src/commons/IconComponent/index.js +3 -3
  66. package/src/commons/MenuActionAddnew/__test__/MenuActionAddNew.test.js +1 -1
  67. package/src/commons/MenuActionList/__test__/MenuActionList.test.js +1 -0
  68. package/src/commons/NavBar/index.js +2 -2
  69. package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +3 -3
  70. package/src/commons/PreventAccess/__test__/PreventAccess.test.js +1 -13
  71. package/src/commons/Processing/__test__/Connecting.test.js +3 -14
  72. package/src/commons/SearchLocation/index.js +2 -2
  73. package/src/commons/SelectActionCard/index.js +2 -2
  74. package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +1 -18
  75. package/src/commons/SelectSubUnit/index.js +2 -2
  76. package/src/commons/SelectUnit/__test__/SelectUnit.test.js +1 -13
  77. package/src/commons/Sharing/BtnRemoveMember.js +2 -2
  78. package/src/commons/Sharing/StationDevicePermissions.js +2 -2
  79. package/src/commons/Sharing/WrapHeaderScrollable.js +1 -1
  80. package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +1 -1
  81. package/src/commons/SubUnit/DeviceTemplate/ConfigAndEvaluation/ConfigAndEvaluation.js +2 -2
  82. package/src/commons/SubUnit/DeviceTemplate/ConfigValue/ConfigValue.js +2 -2
  83. package/src/commons/SubUnit/DeviceTemplate/EvaluationOverConfig/EvaluationOverConfig.js +2 -2
  84. package/src/commons/SubUnit/Item/index.js +2 -2
  85. package/src/commons/SubUnit/OneTap/ItemOneTap.js +2 -2
  86. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +11 -8
  87. package/src/commons/SubUnit/__test__/Favorites.test.js +1 -13
  88. package/src/commons/SubUnit/__test__/ShortDetail.test.js +5 -16
  89. package/src/commons/Tabbar/__test__/index.test.js +0 -11
  90. package/src/commons/Unit/HeaderUnit/index.js +4 -4
  91. package/src/commons/Unit/SharedUnit.js +5 -5
  92. package/src/commons/Unit/__test__/HeaderUnit.test.js +3 -15
  93. package/src/commons/Unit/__test__/SharedUnit.test.js +94 -105
  94. package/src/commons/UnitSummary/AirQuality/SegmentedRoundDisplay/index.js +11 -30
  95. package/src/commons/UnitSummary/ConfigHistoryChart/index.js +6 -61
  96. package/src/commons/Widgets/IFrame/IFrame.js +54 -0
  97. package/src/commons/Widgets/IFrame/IFrameStyles.js +35 -0
  98. package/src/commons/Widgets/IFrame/__tests__/IFrame.test.js +74 -0
  99. package/src/commons/Widgets/IFrame/index.js +0 -0
  100. package/src/commons/Widgets/IFrameWithConfig/IFrameWithConfig.js +163 -0
  101. package/src/commons/Widgets/IFrameWithConfig/IFrameWithConfigStyles.js +9 -0
  102. package/src/commons/Widgets/IFrameWithConfig/__tests__/IFrameWithConfig.test.js +284 -0
  103. package/src/commons/Widgets/IFrameWithConfig/index.js +0 -0
  104. package/src/commons/Widgets/Widget.js +0 -0
  105. package/src/commons/Widgets/index.js +0 -0
  106. package/src/configs/Constants.js +5 -0
  107. package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +4 -15
  108. package/src/hooks/Common/useDevicesStatus.js +23 -23
  109. package/src/hooks/IoT/__test__/useRemoteControl.test.js +1 -1
  110. package/src/hooks/IoT/__test__/useWatchConfigs.test.js +0 -7
  111. package/src/iot/RemoteControl/HomeAssistant.js +1 -1
  112. package/src/iot/RemoteControl/__test__/Bluetooth.test.js +234 -232
  113. package/src/navigations/AutomateStack.js +2 -2
  114. package/src/navigations/EmergencyContactsStack.js +2 -2
  115. package/src/navigations/SharedStack.js +2 -2
  116. package/src/navigations/UnitStack.js +2 -2
  117. package/src/screens/ActivityLog/hooks/index.js +7 -4
  118. package/src/screens/ActivityLog/index.js +2 -2
  119. package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +4 -21
  120. package/src/screens/AddCommon/__test__/SelectUnit.test.js +7 -19
  121. package/src/screens/AddLocationMaps/__test__/index.test.js +3 -13
  122. package/src/screens/AddLocationMaps/index.js +4 -4
  123. package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +3 -20
  124. package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +11 -18
  125. package/src/screens/AddNewGateway/PlugAndPlay/__test__/ZigbeeDeviceConnectGuide.test.js +4 -21
  126. package/src/screens/AddNewGateway/RenameNewDevices.js +2 -2
  127. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +3 -3
  128. package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +0 -17
  129. package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +4 -19
  130. package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +3 -15
  131. package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +31 -51
  132. package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +9 -22
  133. package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +12 -19
  134. package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +6 -16
  135. package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +4 -15
  136. package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +3 -3
  137. package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +18 -10
  138. package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +1 -1
  139. package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +12 -9
  140. package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +12 -9
  141. package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +7 -21
  142. package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +1 -10
  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 +5 -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 +5 -5
  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 +0 -12
  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 +3 -15
  186. package/src/screens/Device/components/SensorDisplayItem.js +23 -5
  187. package/src/screens/Device/components/__test__/VisualChart.test.js +2 -9
  188. package/src/screens/Device/detail.js +11 -10
  189. package/src/screens/Drawer/Drawer.test.js +3 -11
  190. package/src/screens/Drawer/index.js +3 -4
  191. package/src/screens/EmergencyContacts/EmergencyContactsList.js +4 -8
  192. package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +3 -3
  193. package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +4 -17
  194. package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +3 -14
  195. package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +0 -10
  196. package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
  197. package/src/screens/EnterPassword/__test__/EnterPassword.test.js +4 -17
  198. package/src/screens/GuestInfo/__test__/index.test.js +0 -11
  199. package/src/screens/GuestInfo/components/RowGuestInfo.js +2 -2
  200. package/src/screens/GuestInfo/index.js +2 -2
  201. package/src/screens/HanetCamera/Detail.js +2 -2
  202. package/src/screens/HanetCamera/ManageAccess.js +3 -4
  203. package/src/screens/HanetCamera/MemberInfo.js +4 -4
  204. package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +2 -16
  205. package/src/screens/HanetCamera/__test__/Detail.test.js +1 -12
  206. package/src/screens/HanetCamera/__test__/ManageAccess.test.js +5 -16
  207. package/src/screens/HanetCamera/__test__/MemberInfo.test.js +5 -18
  208. package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
  209. package/src/screens/ManageAccess/__test__/ManageAccess.test.js +3 -19
  210. package/src/screens/ManageAccess/index.js +3 -3
  211. package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +5 -5
  212. package/src/screens/Notification/__test__/NotificationItem.test.js +9 -19
  213. package/src/screens/Notification/index.js +3 -3
  214. package/src/screens/PlayBackCamera/Styles/index.js +2 -4
  215. package/src/screens/PlayBackCamera/Timer.js +65 -47
  216. package/src/screens/PlayBackCamera/__test__/index.test.js +32 -33
  217. package/src/screens/PlayBackCamera/index.js +115 -112
  218. package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +0 -11
  219. package/src/screens/ScanChipQR/components/QRScan/index.js +3 -3
  220. package/src/screens/SelectUnit/__test__/index.test.js +1 -21
  221. package/src/screens/SelectUnit/index.js +2 -2
  222. package/src/screens/SharedUnit/TabHeader.js +2 -2
  223. package/src/screens/Sharing/Components/EndDevice.js +3 -3
  224. package/src/screens/Sharing/UnitMemberList.js +2 -2
  225. package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +9 -4
  226. package/src/screens/Sharing/__test__/SelectShareDevice.test.js +2 -15
  227. package/src/screens/Sharing/__test__/SelectUser.test.js +2 -22
  228. package/src/screens/Sharing/__test__/UnitMemberList.test.js +2 -2
  229. package/src/screens/Sharing/__test__/UpdateShareDevice.test.js +4 -17
  230. package/src/screens/Sharing/hooks/__test__/index.test.js +2 -13
  231. package/src/screens/SmartAccount/Connecting/index.js +0 -2
  232. package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +3 -18
  233. package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +11 -21
  234. package/src/screens/SmartAccount/SuccessfullyConnected/index.js +3 -4
  235. package/src/screens/SmartAccount/__test__/Connecting.test.js +30 -36
  236. package/src/screens/SmartAccount/__test__/SmartAccount.test.js +12 -21
  237. package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +7 -17
  238. package/src/screens/SmartIr/__test__/SelectBrand.test.js +1 -11
  239. package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +1 -12
  240. package/src/screens/SmartIr/__test__/SmartIr.test.js +3 -11
  241. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +3 -3
  242. package/src/screens/SmartIr/components/SelectBrand.js +2 -2
  243. package/src/screens/SubUnit/AddSubUnit.js +1 -0
  244. package/src/screens/SubUnit/EditSubUnit.js +3 -2
  245. package/src/screens/SubUnit/ManageSubUnit.js +4 -5
  246. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +9 -31
  247. package/src/screens/SubUnit/__test__/Detail.test.js +4 -28
  248. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +12 -30
  249. package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +2 -2
  250. package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +0 -12
  251. package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +7 -20
  252. package/src/screens/Template/__test__/EditTemplate.test.js +2 -13
  253. package/src/screens/Template/__test__/GatewayList.test.js +0 -9
  254. package/src/screens/Template/__test__/detail.test.js +4 -4
  255. package/src/screens/Template/__test__/index.test.js +1 -12
  256. package/src/screens/Template/detail.js +2 -2
  257. package/src/screens/Unit/SelectAddToFavorites.js +2 -2
  258. package/src/screens/Unit/SelectAddress.js +4 -4
  259. package/src/screens/Unit/SmartAccountItem.js +2 -2
  260. package/src/screens/Unit/Summaries.js +3 -2
  261. package/src/screens/Unit/__test__/AddMenu.test.js +5 -2
  262. package/src/screens/Unit/__test__/CheckSendEmail.test.js +0 -12
  263. package/src/screens/Unit/__test__/ChooseLocation.test.js +1 -4
  264. package/src/screens/Unit/__test__/Detail.test.js +5 -5
  265. package/src/screens/Unit/__test__/ManageUnit.test.js +2 -17
  266. package/src/screens/Unit/__test__/MoreMenu.test.js +1 -11
  267. package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +3 -14
  268. package/src/screens/Unit/__test__/SelectAddress.test.js +4 -17
  269. package/src/screens/Unit/__test__/SmartAccount.test.js +14 -11
  270. package/src/screens/Unit/__test__/SmartAccountItem.test.js +0 -11
  271. package/src/screens/Unit/__test__/Summaries.test.js +2 -14
  272. package/src/screens/Unit/components/AutomateScript/index.js +2 -2
  273. package/src/screens/Unit/components/ButtonWrapper/index.js +3 -4
  274. package/src/screens/Unit/components/Header/index.js +3 -3
  275. package/src/screens/Unit/components/SharedUnit/index.js +5 -5
  276. package/src/screens/Unit/components/__test__/Header.test.js +1 -14
  277. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +1 -11
  278. package/src/screens/Unit/components/__test__/SharedUnit.test.js +1 -11
  279. package/src/screens/UnitSummary/__test__/index.test.js +51 -17
  280. package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +0 -12
  281. package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +10 -23
  282. package/src/screens/UnitSummary/components/AirQuality/__test__/index.test.js +1 -7
  283. package/src/screens/UnitSummary/components/AirQuality/index.js +3 -3
  284. package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +38 -14
  285. package/src/screens/UnitSummary/components/PowerConsumption/index.js +21 -30
  286. package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +1 -16
  287. package/src/screens/UnitSummary/components/Temperature/index.js +5 -1
  288. package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +0 -8
  289. package/src/screens/UnitSummary/components/UvIndex/index.js +2 -2
  290. package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +2 -2
  291. package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +14 -18
  292. package/src/screens/UnitSummary/index.js +4 -8
  293. package/src/utils/Converter/__test__/timer.test.js +8 -0
  294. package/src/utils/Functions/preloadImages.js +13 -14
  295. package/src/utils/Monitor.js +4 -4
  296. package/src/utils/Storage.js +1 -1
  297. package/src/commons/Device/HistoryChart.js +0 -225
  298. package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +0 -48
  299. package/src/commons/Device/WindSpeed/LinearChart/index.js +0 -155
  300. package/src/commons/UnitSummary/ConfigHistoryChart/__test__/ConfigHistoryChart.test.js +0 -289
  301. package/src/screens/Device/__test__/DetailHistoryChart.test.js +0 -69
  302. package/src/screens/Device/components/DetailHistoryChart.js +0 -118
  303. package/src/screens/UnitSummary/components/Temperature/ChartAverage/index.js +0 -62
  304. package/src/screens/UnitSummary/components/Temperature/__test__/ChartAverage.test.js +0 -17
  305. 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={'plus-circle'} 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');
@@ -18,18 +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
21
  const mockSetState = jest.fn();
34
22
  jest.mock('react', () => {
35
23
  return {
@@ -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,21 +31,9 @@ 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
- it('render DetailHistoryChart', async () => {
36
+ it('render visualChart', async () => {
49
37
  const item = {
50
38
  id: 10452,
51
39
  order: 0,
@@ -74,8 +62,8 @@ describe('Test SensorDisplayItem', () => {
74
62
  tree = await renderer.create(wrapComponent({ item, sensor }));
75
63
  });
76
64
  const instance = tree.root;
77
- const detailHistoryChart = instance.findAllByType(VisualChart);
78
- expect(detailHistoryChart).toHaveLength(1);
65
+ const visualChart = instance.findAllByType(VisualChart);
66
+ expect(visualChart).toHaveLength(1);
79
67
  });
80
68
 
81
69
  it('render ActionGroup', async () => {
@@ -13,18 +13,19 @@ import ListQualityIndicator from '../../../commons/Device/WaterQualitySensor/Lis
13
13
  import Compass from '../../../commons/Device/WindDirection/Compass';
14
14
  import Anemometer from '../../../commons/Device/WindSpeed/Anemometer';
15
15
  import MediaPlayerDetail from '../../../commons/MediaPlayerDetail';
16
- import { AccessibilityLabel } from '../../../configs/Constants';
16
+ import { AccessibilityLabel, WIDGET_TYPE } from '../../../configs/Constants';
17
17
  import { useSCContextSelector } from '../../../context';
18
18
  import { useRemoteControl } from '../../../hooks/IoT';
19
19
  import { useConfigGlobalState } from '../../../iot/states';
20
20
  import SmartIr from '../../../screens/SmartIr';
21
21
  import { useEvaluateValue } from '../hooks/useEvaluateValue';
22
22
  import styles from '../styles';
23
- import { DetailHistoryChart } from './DetailHistoryChart';
24
23
  import VisualChart from './VisualChart';
25
24
  import { standardizeCameraScreenSize } from '../../../utils/Utils';
26
25
  import { Device } from '../../../configs';
27
26
  import DonutCharts from './DonutChart';
27
+ import IFrame from '../../../commons/Widgets/IFrame/IFrame';
28
+ import IFrameWithConfig from '../../../commons/Widgets/IFrameWithConfig/IFrameWithConfig';
28
29
 
29
30
  const { standardizeWidth, standardizeHeight } = standardizeCameraScreenSize(
30
31
  Device.screenWidth - 32
@@ -176,10 +177,27 @@ export const SensorDisplayItem = ({
176
177
  isWidgetOrder={isWidgetOrder}
177
178
  />
178
179
  );
180
+ case WIDGET_TYPE.iframe:
181
+ return (
182
+ <IFrame
183
+ doAction={doAction}
184
+ sensor={sensor}
185
+ id={idTemplate}
186
+ item={item}
187
+ isWidgetOrder={isWidgetOrder}
188
+ />
189
+ );
190
+ case WIDGET_TYPE.iframeWithConfig:
191
+ return (
192
+ <IFrameWithConfig
193
+ doAction={doAction}
194
+ sensor={sensor}
195
+ id={idTemplate}
196
+ item={item}
197
+ isWidgetOrder={isWidgetOrder}
198
+ />
199
+ );
179
200
  case 'history':
180
- if (configuration?.config === 'power_consumption') {
181
- return <DetailHistoryChart item={item} sensor={sensor} />;
182
- }
183
201
  return (
184
202
  <VisualChart
185
203
  item={item}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import MockAdapter from 'axios-mock-adapter';
3
3
  import moment from 'moment';
4
- import { act, create } from 'react-test-renderer';
4
+ import { act } from 'react-test-renderer';
5
5
 
6
6
  import VisualChart from '../VisualChart';
7
7
  import { API } from '../../../../configs';
@@ -11,14 +11,7 @@ import api from '../../../../utils/Apis/axios';
11
11
  import ChartAggregationOption from '../../../../commons/ChartAggregationOption';
12
12
  import DateTimeRangeChange from '../../../../commons/DateTimeRangeChange';
13
13
  import Highcharts from '../../../../commons/Highcharts';
14
-
15
- const render = async (component) => {
16
- let tree;
17
- await act(async () => {
18
- tree = await create(component);
19
- });
20
- return tree;
21
- };
14
+ import { render } from '../../../../../jest/render';
22
15
 
23
16
  const mockAxios = new MockAdapter(api.axiosInstance);
24
17
 
@@ -8,8 +8,7 @@ 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';
13
12
  import moment from 'moment';
14
13
 
15
14
  import { SCContext } from '../../context';
@@ -215,7 +214,7 @@ const DeviceDetail = ({ route }) => {
215
214
 
216
215
  useEffect(() => {
217
216
  if (
218
- unit.remote_control_options &&
217
+ unit?.remote_control_options &&
219
218
  unit.remote_control_options.googlehome?.length &&
220
219
  isNetworkConnected
221
220
  ) {
@@ -685,9 +684,9 @@ const DeviceDetail = ({ route }) => {
685
684
  >
686
685
  <View style={styles.buttonStar}>
687
686
  {isFavorite ? (
688
- <IconFill name="star" size={25} color={Colors.Yellow6} />
687
+ <AntDesign name="star" size={25} color={Colors.Yellow6} />
689
688
  ) : (
690
- <IconOutline name="star" size={25} />
689
+ <AntDesign name="star" size={25} />
691
690
  )}
692
691
  </View>
693
692
  </TouchableOpacity>
@@ -695,7 +694,7 @@ const DeviceDetail = ({ route }) => {
695
694
  {isShowSetupEmergencyContact && (
696
695
  <TouchableOpacity onPress={onPressSetting}>
697
696
  <View style={styles.button}>
698
- <Icon name="setting" size={25} color={Colors.Black} />
697
+ <AntDesign name="setting" size={25} color={Colors.Black} />
699
698
  </View>
700
699
  </TouchableOpacity>
701
700
  )}
@@ -706,7 +705,7 @@ const DeviceDetail = ({ route }) => {
706
705
  ref={refMenuAction}
707
706
  accessibilityLabel={AccessibilityLabel.HEADER_DEVICE_BUTTON_MORE}
708
707
  >
709
- <Icon name={'more'} size={27} color={Colors.Black} />
708
+ <AntDesign name={'more'} size={27} color={Colors.Black} />
710
709
  </TouchableOpacity>
711
710
  </View>
712
711
  ),
@@ -791,7 +790,9 @@ const DeviceDetail = ({ route }) => {
791
790
  canManageSubUnit && (
792
791
  <BottomButtonView
793
792
  style={styles.bottomButtonEmergencyContact}
794
- mainIcon={<Icon name="plus" size={16} color={Colors.Primary} />}
793
+ mainIcon={
794
+ <AntDesign name="plus" size={16} color={Colors.Primary} />
795
+ }
795
796
  mainTitle={t('setup_my_emergency_contact')}
796
797
  onPressMain={onSetupContacts}
797
798
  typeMain="primaryBorder"
@@ -825,7 +826,7 @@ const DeviceDetail = ({ route }) => {
825
826
  {isShowEmergencyResolve && !isEmergencyPopupScreen && (
826
827
  <BottomButtonView
827
828
  style={styles.bottomButtonEmergencyResolve}
828
- mainIcon={<IconFill name="tool" size={15} color={Colors.Gray6} />}
829
+ mainIcon={<AntDesign name="tool" size={15} color={Colors.Gray6} />}
829
830
  mainTitle={t('resolve_situation')}
830
831
  onPressMain={onPressResolveSituationConfirm}
831
832
  topComponent={
@@ -865,7 +866,7 @@ const DeviceDetail = ({ route }) => {
865
866
  >
866
867
  {unit?.name} - {sensor?.station?.name}
867
868
  </Text>
868
- <IconFill
869
+ <AntDesign
869
870
  accessibilityLabel={AccessibilityLabel.BUTTON_POPUP_RESOLVED_ICON}
870
871
  name="check-circle"
871
872
  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 && (