@eohjsc/react-native-smart-city 0.6.2 → 0.7.3-rc1

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 (338) hide show
  1. package/README.md +3 -3
  2. package/android/build.gradle +7 -10
  3. package/assets/images/Automation-fill.svg +85 -0
  4. package/assets/images/Scenario-filled.svg +22 -0
  5. package/assets/images/schedule-fill.svg +48 -0
  6. package/package.json +53 -70
  7. package/src/commons/Action/ItemQuickAction.js +1 -1
  8. package/src/commons/Action/__test__/ItemQuickAction.test.js +2 -2
  9. package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +3 -3
  10. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +3 -3
  11. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/ItemPasscode.test.js +2 -2
  12. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +3 -3
  13. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +3 -3
  14. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
  15. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +0 -15
  16. package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +2 -2
  17. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +2 -2
  18. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +2 -2
  19. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +5 -5
  20. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +5 -5
  21. package/src/commons/ActionGroup/TerminalBoxTemplate.js +2 -2
  22. package/src/commons/ActionGroup/TextBoxTemplate.js +2 -2
  23. package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonTemplate.test.js +4 -4
  24. package/src/commons/ActionGroup/TimerActionTemplate.js +4 -5
  25. package/src/commons/ActionGroup/TwoButtonTemplate/index.js +2 -2
  26. package/src/commons/ActionGroup/__test__/ColorPickerTemplate.test.js +4 -9
  27. package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +2 -9
  28. package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +4 -11
  29. package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +2 -9
  30. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +4 -18
  31. package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +2 -2
  32. package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +1 -8
  33. package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +0 -7
  34. package/src/commons/ActionGroup/__test__/SwitchButtonTemplate.test.js +4 -15
  35. package/src/commons/ActionGroup/__test__/TerminalBoxTemplate.test.js +0 -7
  36. package/src/commons/ActionGroup/__test__/TextBoxTemplate.test.js +1 -8
  37. package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +8 -15
  38. package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +2 -10
  39. package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +3 -20
  40. package/src/commons/ActionGroup/__test__/index.test.js +15 -23
  41. package/src/commons/ActionTemplate/__test__/index.test.js +2 -0
  42. package/src/commons/ActionTemplate/__test__/utils.js +21 -0
  43. package/src/commons/ActionTemplate/index.js +1 -2
  44. package/src/commons/BackDefault/index.js +2 -2
  45. package/src/commons/ButtonPopup/index.js +2 -2
  46. package/src/commons/Calendar/__test__/Calendar.test.js +0 -7
  47. package/src/commons/CircleButton/__test__/CircleButton.test.js +2 -2
  48. package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +11 -25
  49. package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +27 -20
  50. package/src/commons/Dashboard/MyUnit/index.js +0 -1
  51. package/src/commons/DateTimeRangeChange/DateTimeButton.js +2 -2
  52. package/src/commons/DateTimeRangeChange/__test__/DateTimeButton.test.js +4 -4
  53. package/src/commons/DateTimeRangeChange/index.js +3 -3
  54. package/src/commons/Device/ConnectedViewHeader.js +2 -2
  55. package/src/commons/Device/DisconnectedView.js +2 -2
  56. package/src/commons/Device/Emergency/EmergencyDetail.js +3 -3
  57. package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +2 -2
  58. package/src/commons/Device/FlatListItems.js +3 -3
  59. package/src/commons/Device/Hanet/ItemHanetDevice.js +3 -3
  60. package/src/commons/Device/Hanet/ItemHanetDevice.test.js +3 -11
  61. package/src/commons/Device/ItemAddNew/index.js +2 -2
  62. package/src/commons/Device/ItemDevice.js +5 -21
  63. package/src/commons/Device/SonosSpeaker/index.js +3 -3
  64. package/src/commons/Device/WaterPurifierStatus/AlertStatusMachine.js +2 -2
  65. package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +2 -6
  66. package/src/commons/DisplayChecking/index.js +2 -2
  67. package/src/commons/EmergencyButton/AlertSendConfirm.js +2 -2
  68. package/src/commons/EmergencyButton/AlertSent.js +6 -2
  69. package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
  70. package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +5 -5
  71. package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +9 -9
  72. package/src/commons/Form/CurrencyInput.js +1 -15
  73. package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +1 -22
  74. package/src/commons/Header/HeaderCustom.js +8 -3
  75. package/src/commons/HeaderAni/index.js +2 -2
  76. package/src/commons/IconComponent/index.js +3 -3
  77. package/src/commons/MediaPlayerDetail/MediaPlayerFull.js +1 -1
  78. package/src/commons/MediaPlayerDetail/__test__/MediaPlayerFull.test.js +12 -48
  79. package/src/commons/MenuActionAddnew/__test__/MenuActionAddNew.test.js +1 -1
  80. package/src/commons/MenuActionList/__test__/MenuActionList.test.js +1 -0
  81. package/src/commons/MenuActionMore/MenuActionMoreStyles.js +2 -1
  82. package/src/commons/MenuActionMore/index.js +1 -1
  83. package/src/commons/NavBar/NavBarStyles.js +1 -1
  84. package/src/commons/NavBar/index.js +2 -2
  85. package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +3 -3
  86. package/src/commons/PreventAccess/__test__/PreventAccess.test.js +1 -13
  87. package/src/commons/Processing/__test__/Connecting.test.js +3 -14
  88. package/src/commons/SearchLocation/index.js +3 -3
  89. package/src/commons/SelectActionCard/index.js +2 -2
  90. package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +1 -18
  91. package/src/commons/SelectSubUnit/index.js +2 -2
  92. package/src/commons/SelectUnit/__test__/SelectUnit.test.js +1 -13
  93. package/src/commons/Sharing/BtnRemoveMember.js +2 -2
  94. package/src/commons/Sharing/StationDevicePermissions.js +2 -2
  95. package/src/commons/Sharing/WrapHeaderScrollable.js +1 -1
  96. package/src/commons/Sharing/__test__/ButtonRemoveMember.test.js +2 -2
  97. package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +1 -1
  98. package/src/commons/SubUnit/DeviceTemplate/ConfigAndEvaluation/ConfigAndEvaluation.js +2 -2
  99. package/src/commons/SubUnit/DeviceTemplate/ConfigValue/ConfigValue.js +2 -2
  100. package/src/commons/SubUnit/DeviceTemplate/EvaluationOverConfig/EvaluationOverConfig.js +2 -2
  101. package/src/commons/SubUnit/Item/index.js +3 -3
  102. package/src/commons/SubUnit/OneTap/ItemOneTap.js +5 -5
  103. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +11 -8
  104. package/src/commons/SubUnit/__test__/Favorites.test.js +1 -13
  105. package/src/commons/SubUnit/__test__/ShortDetail.test.js +5 -16
  106. package/src/commons/SummaryItem/index.js +22 -23
  107. package/src/commons/Tabbar/__test__/index.test.js +0 -11
  108. package/src/commons/Unit/HeaderUnit/index.js +93 -85
  109. package/src/commons/Unit/SharedUnit.js +7 -7
  110. package/src/commons/Unit/__test__/HeaderUnit.test.js +29 -52
  111. package/src/commons/Unit/__test__/SharedUnit.test.js +94 -105
  112. package/src/commons/UnitSummary/AirQuality/SegmentedRoundDisplay/index.js +11 -30
  113. package/src/commons/Widgets/IFrameWithConfig/IFrameWithConfig.js +44 -1
  114. package/src/commons/Widgets/IFrameWithConfig/__tests__/IFrameWithConfig.test.js +69 -0
  115. package/src/commons/WrapParallaxScrollView/index.js +20 -50
  116. package/src/configs/API.js +1 -2
  117. package/src/configs/Constants.js +3 -3
  118. package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +4 -15
  119. package/src/hooks/Common/useIsOwnerOfUnit.js +1 -1
  120. package/src/hooks/IoT/__test__/useRemoteControl.test.js +1 -1
  121. package/src/hooks/IoT/__test__/useWatchConfigs.test.js +6 -21
  122. package/src/iot/RemoteControl/HomeAssistant.js +1 -1
  123. package/src/iot/RemoteControl/__test__/Bluetooth.test.js +234 -232
  124. package/src/navigations/AddDeviceStack.js +2 -2
  125. package/src/navigations/AddGatewayStack.js +2 -2
  126. package/src/navigations/AddLGDeviceStack.js +2 -2
  127. package/src/navigations/AddMemberStack.js +2 -2
  128. package/src/navigations/AddSubUnitStack.js +2 -2
  129. package/src/navigations/AddUnitStack.js +2 -2
  130. package/src/navigations/AllGatewayStack.js +2 -2
  131. package/src/navigations/AutomateStack.js +4 -4
  132. package/src/navigations/EmergencyContactsStack.js +4 -4
  133. package/src/navigations/GatewayStack.js +2 -2
  134. package/src/navigations/HanetCameraStack.js +2 -2
  135. package/src/navigations/Main.js +2 -2
  136. package/src/navigations/NotificationStack.js +2 -2
  137. package/src/navigations/SharedStack.js +8 -6
  138. package/src/navigations/SmartAccountStack.js +2 -2
  139. package/src/navigations/SmartIrStack.js +2 -2
  140. package/src/navigations/SmartLockStack.js +2 -2
  141. package/src/navigations/SmartStack.js +2 -2
  142. package/src/navigations/TemplateStack.js +2 -2
  143. package/src/navigations/UnitStack.js +4 -12
  144. package/src/navigations/utils.js +1 -4
  145. package/src/screens/ActivityLog/hooks/index.js +7 -4
  146. package/src/screens/ActivityLog/index.js +2 -2
  147. package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +4 -21
  148. package/src/screens/AddCommon/__test__/SelectUnit.test.js +7 -19
  149. package/src/screens/AddLocationMaps/__test__/index.test.js +3 -13
  150. package/src/screens/AddLocationMaps/index.js +11 -6
  151. package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +3 -20
  152. package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +11 -18
  153. package/src/screens/AddNewGateway/PlugAndPlay/__test__/ZigbeeDeviceConnectGuide.test.js +4 -21
  154. package/src/screens/AddNewGateway/RenameNewDevices.js +2 -2
  155. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +3 -3
  156. package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +0 -17
  157. package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +4 -19
  158. package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +3 -15
  159. package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +31 -51
  160. package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +9 -22
  161. package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +12 -19
  162. package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +6 -16
  163. package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +4 -15
  164. package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +3 -3
  165. package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +18 -10
  166. package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +1 -1
  167. package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +12 -9
  168. package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +12 -9
  169. package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +7 -21
  170. package/src/screens/AllGateway/DetailConfigActionInternal/__test__/index.test.js +0 -20
  171. package/src/screens/AllGateway/DetailConfigActionModbus/__test__/index.test.js +7 -24
  172. package/src/screens/AllGateway/DeviceGatewayInfo/__test__/index.test.js +0 -17
  173. package/src/screens/AllGateway/DeviceInternalDetail/__test__/index.test.js +84 -100
  174. package/src/screens/AllGateway/DeviceModbusDetail/__test__/index.test.js +64 -82
  175. package/src/screens/AllGateway/DeviceZigbeeDetail/__test__/index.test.js +36 -55
  176. package/src/screens/AllGateway/GatewayConnectionMethods/__test__/index.test.js +9 -18
  177. package/src/screens/AllGateway/GatewayDetail/__test__/index.test.js +10 -37
  178. package/src/screens/AllGateway/GatewayInfo/__test__/index.test.js +7 -32
  179. package/src/screens/AllGateway/__test__/index.test.js +1 -14
  180. package/src/screens/AllGateway/components/GatewayItem/__test__/index.test.js +0 -12
  181. package/src/screens/AllGateway/components/TabPaneCT/__test__/index.test.js +1 -13
  182. package/src/screens/AllGateway/components/TabPaneCT/index.js +1 -1
  183. package/src/screens/AllGateway/hooks/__test__/index.test.js +1 -8
  184. package/src/screens/AllGateway/test-utils.js +1 -1
  185. package/src/screens/Automate/AddNewAction/NewActionWrapper.js +2 -2
  186. package/src/screens/Automate/AddNewAction/SetupConfigCondition.js +27 -28
  187. package/src/screens/Automate/AddNewAction/__test__/ChooseAction.test.js +3 -3
  188. package/src/screens/Automate/AddNewAction/__test__/ChooseConfig.test.js +8 -5
  189. package/src/screens/Automate/AddNewAction/__test__/SelectControlDevices.test.js +2 -2
  190. package/src/screens/Automate/AddNewAction/__test__/SelectMonitorDevices.test.js +1 -18
  191. package/src/screens/Automate/AddNewAction/__test__/SetupConfigCondition.test.js +17 -15
  192. package/src/screens/Automate/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +4 -4
  193. package/src/screens/Automate/EditActionsList/__tests__/UpdateActionScript.test.js +38 -55
  194. package/src/screens/Automate/EditActionsList/__tests__/UpdateDelayScript.test.js +0 -18
  195. package/src/screens/Automate/EditActionsList/__tests__/UpdateNotifyScript.test.js +1 -19
  196. package/src/screens/Automate/EditActionsList/__tests__/index.test.js +14 -11
  197. package/src/screens/Automate/OneTap/__test__/AddNewOneTap.test.js +3 -3
  198. package/src/screens/Automate/Scenario/__test__/AddNewOneTap.test.js +2 -2
  199. package/src/screens/Automate/ScriptDetail/Components/AddActionScript.js +2 -2
  200. package/src/screens/Automate/ScriptDetail/__test__/index.test.js +33 -25
  201. package/src/screens/Automate/ScriptDetail/index.js +6 -6
  202. package/src/screens/Automate/SetSchedule/__test__/index.test.js +4 -4
  203. package/src/screens/Automate/SetSchedule/components/RowItem.js +3 -3
  204. package/src/screens/Automate/Styles/indexStyles.js +6 -0
  205. package/src/screens/Automate/__test__/MultiUnits.test.js +7 -7
  206. package/src/screens/Automate/__test__/index.test.js +9 -34
  207. package/src/screens/Automate/index.js +50 -33
  208. package/src/screens/ChangePosition/__test__/index.test.js +1 -14
  209. package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +1 -23
  210. package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +1 -11
  211. package/src/screens/Device/EditDevice/index.js +2 -2
  212. package/src/screens/Device/__test__/detail.test.js +11 -11
  213. package/src/screens/Device/__test__/sensorDisplayItem.test.js +0 -12
  214. package/src/screens/Device/detail.js +14 -12
  215. package/src/screens/Drawer/Drawer.test.js +3 -11
  216. package/src/screens/Drawer/index.js +3 -4
  217. package/src/screens/EmergencyContacts/EmergencyContactsList.js +4 -8
  218. package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +3 -3
  219. package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +4 -17
  220. package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +3 -14
  221. package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +0 -10
  222. package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
  223. package/src/screens/EnterPassword/__test__/EnterPassword.test.js +4 -17
  224. package/src/screens/GuestInfo/__test__/index.test.js +0 -11
  225. package/src/screens/GuestInfo/components/RowGuestInfo.js +2 -2
  226. package/src/screens/GuestInfo/index.js +2 -2
  227. package/src/screens/HanetCamera/Detail.js +6 -2
  228. package/src/screens/HanetCamera/ManageAccess.js +3 -4
  229. package/src/screens/HanetCamera/MemberInfo.js +4 -4
  230. package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +2 -16
  231. package/src/screens/HanetCamera/__test__/Detail.test.js +1 -12
  232. package/src/screens/HanetCamera/__test__/ManageAccess.test.js +5 -16
  233. package/src/screens/HanetCamera/__test__/MemberInfo.test.js +5 -18
  234. package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
  235. package/src/screens/ManageAccess/__test__/ManageAccess.test.js +3 -19
  236. package/src/screens/ManageAccess/index.js +3 -3
  237. package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +7 -7
  238. package/src/screens/Notification/__test__/Notification.test.js +5 -15
  239. package/src/screens/Notification/__test__/NotificationItem.test.js +9 -19
  240. package/src/screens/Notification/index.js +5 -5
  241. package/src/screens/PlayBackCamera/__test__/index.test.js +13 -22
  242. package/src/screens/PlayBackCamera/index.js +2 -2
  243. package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +0 -11
  244. package/src/screens/ScanChipQR/components/QRScan/index.js +3 -3
  245. package/src/screens/SelectUnit/__test__/index.test.js +9 -29
  246. package/src/screens/SelectUnit/index.js +2 -2
  247. package/src/screens/SharedUnit/TabHeader.js +2 -2
  248. package/src/screens/SharedUnit/index.js +5 -0
  249. package/src/screens/Sharing/Components/EndDevice.js +3 -3
  250. package/src/screens/Sharing/SelectUser.js +5 -4
  251. package/src/screens/Sharing/UnitMemberList.js +7 -6
  252. package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +9 -4
  253. package/src/screens/Sharing/__test__/SelectShareDevice.test.js +2 -15
  254. package/src/screens/Sharing/__test__/SelectUser.test.js +2 -22
  255. package/src/screens/Sharing/__test__/UnitMemberList.test.js +2 -2
  256. package/src/screens/Sharing/__test__/UpdateShareDevice.test.js +4 -17
  257. package/src/screens/Sharing/hooks/__test__/index.test.js +2 -13
  258. package/src/screens/SmartAccount/Connecting/index.js +0 -2
  259. package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +3 -18
  260. package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +11 -21
  261. package/src/screens/SmartAccount/SuccessfullyConnected/index.js +3 -4
  262. package/src/screens/SmartAccount/__test__/Connecting.test.js +30 -36
  263. package/src/screens/SmartAccount/__test__/SmartAccount.test.js +12 -21
  264. package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +8 -17
  265. package/src/screens/SmartIr/__test__/SelectBrand.test.js +1 -11
  266. package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +1 -12
  267. package/src/screens/SmartIr/__test__/SmartIr.test.js +3 -11
  268. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +6 -5
  269. package/src/screens/SmartIr/components/SelectBrand.js +2 -2
  270. package/src/screens/SubUnit/AddSubUnit.js +1 -0
  271. package/src/screens/SubUnit/EditSubUnit.js +3 -2
  272. package/src/screens/SubUnit/ManageSubUnit.js +5 -5
  273. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +9 -31
  274. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +12 -30
  275. package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +2 -2
  276. package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +0 -12
  277. package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +7 -20
  278. package/src/screens/Template/__test__/EditTemplate.test.js +4 -15
  279. package/src/screens/Template/__test__/GatewayList.test.js +0 -9
  280. package/src/screens/Template/__test__/detail.test.js +8 -8
  281. package/src/screens/Template/__test__/index.test.js +3 -14
  282. package/src/screens/Template/detail.js +2 -2
  283. package/src/screens/Unit/Detail.js +10 -55
  284. package/src/screens/Unit/MoreMenu.js +6 -5
  285. package/src/screens/Unit/SelectAddToFavorites.js +2 -2
  286. package/src/screens/Unit/SelectAddress.js +9 -4
  287. package/src/screens/Unit/SmartAccountItem.js +2 -2
  288. package/src/screens/Unit/Station/__test__/index.test.js +2 -2
  289. package/src/screens/Unit/Summaries.js +24 -29
  290. package/src/screens/Unit/__test__/AddMenu.test.js +5 -2
  291. package/src/screens/Unit/__test__/CheckSendEmail.test.js +0 -12
  292. package/src/screens/Unit/__test__/ChooseLocation.test.js +1 -4
  293. package/src/screens/Unit/__test__/Detail.test.js +14 -12
  294. package/src/screens/Unit/__test__/ManageUnit.test.js +2 -17
  295. package/src/screens/Unit/__test__/MoreMenu.test.js +6 -12
  296. package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +3 -14
  297. package/src/screens/Unit/__test__/SelectAddress.test.js +4 -17
  298. package/src/screens/Unit/__test__/SmartAccount.test.js +14 -11
  299. package/src/screens/Unit/__test__/SmartAccountItem.test.js +0 -11
  300. package/src/screens/Unit/__test__/Summaries.test.js +2 -14
  301. package/src/screens/Unit/components/AutomateScript/index.js +5 -5
  302. package/src/screens/Unit/components/ButtonWrapper/index.js +3 -4
  303. package/src/screens/Unit/components/Header/index.js +5 -4
  304. package/src/screens/Unit/components/SharedUnit/index.js +5 -5
  305. package/src/screens/Unit/components/__test__/Header.test.js +1 -14
  306. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +1 -11
  307. package/src/screens/Unit/components/__test__/SharedUnit.test.js +1 -11
  308. package/src/screens/UnitSummary/__test__/index.test.js +51 -17
  309. package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +8 -25
  310. package/src/screens/UnitSummary/components/AirQuality/__test__/index.test.js +1 -7
  311. package/src/screens/UnitSummary/components/AirQuality/index.js +8 -3
  312. package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +0 -11
  313. package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +1 -16
  314. package/src/screens/UnitSummary/components/Temperature/index.js +5 -1
  315. package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +0 -8
  316. package/src/screens/UnitSummary/components/UvIndex/index.js +6 -2
  317. package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +3 -3
  318. package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +14 -18
  319. package/src/screens/UnitSummary/components/__test__/UnitSummary.test.js +8 -8
  320. package/src/screens/UnitSummary/index.js +6 -6
  321. package/src/utils/Apis/axios.js +4 -2
  322. package/src/utils/Converter/__test__/timer.test.js +8 -0
  323. package/src/utils/Functions/preloadImages.js +13 -14
  324. package/src/utils/Monitor.js +2 -3
  325. package/src/utils/Route/index.js +0 -1
  326. package/src/utils/Storage.js +1 -1
  327. package/assets/images/OneTap.svg +0 -14
  328. package/assets/images/Schedule.svg +0 -39
  329. package/assets/images/ValueChange.svg +0 -49
  330. package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +0 -48
  331. package/src/commons/Device/WindSpeed/LinearChart/index.js +0 -155
  332. package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +0 -27
  333. package/src/screens/AddNewGateway/hooks/index.js +0 -31
  334. package/src/screens/SubUnit/Detail.js +0 -150
  335. package/src/screens/SubUnit/__test__/Detail.test.js +0 -125
  336. package/src/screens/UnitSummary/components/Temperature/ChartAverage/index.js +0 -62
  337. package/src/screens/UnitSummary/components/Temperature/__test__/ChartAverage.test.js +0 -17
  338. package/src/utils/dateHelper/getTickValues.js +0 -22
@@ -13,18 +13,6 @@ const wrapComponent = (props) => (
13
13
  </SCProvider>
14
14
  );
15
15
 
16
- const mockNavigate = jest.fn();
17
- jest.mock('@react-navigation/native', () => {
18
- return {
19
- ...jest.requireActual('@react-navigation/native'),
20
- useNavigation: () => ({
21
- navigate: mockNavigate,
22
- }),
23
- useIsFocused: () => true,
24
- useFocusEffect: jest.fn(),
25
- };
26
- });
27
-
28
16
  describe('test ShortDetail Subunit', () => {
29
17
  let tree;
30
18
  let props;
@@ -58,7 +46,7 @@ describe('test ShortDetail Subunit', () => {
58
46
  {
59
47
  action: {
60
48
  color: '#00979D',
61
- icon: 'caret-up',
49
+ icon: 'caretup',
62
50
  id: 1,
63
51
  key: '',
64
52
  },
@@ -27,17 +27,6 @@ jest.mock('react-native-permissions', () => {
27
27
  return mock;
28
28
  });
29
29
 
30
- const mockedNavigate = jest.fn();
31
- jest.mock('@react-navigation/native', () => {
32
- return {
33
- ...jest.requireActual('@react-navigation/native'),
34
- useNavigation: () => ({
35
- navigate: mockedNavigate,
36
- }),
37
- useIsFocused: () => true,
38
- useFocusEffect: jest.fn((handler) => handler()),
39
- };
40
- });
41
30
  jest.mock('../../../iot/states', () => ({
42
31
  useConfigGlobalState: () => [{}, null],
43
32
  }));
@@ -135,7 +124,7 @@ describe('test ShortDetail Subunit', () => {
135
124
  {
136
125
  action: {
137
126
  color: '#00979D',
138
- icon: 'caret-up',
127
+ icon: 'caretup',
139
128
  id: 1,
140
129
  key: '',
141
130
  },
@@ -167,7 +156,7 @@ describe('test ShortDetail Subunit', () => {
167
156
  {
168
157
  action: {
169
158
  color: '#00979D',
170
- icon: 'caret-up',
159
+ icon: 'caretup',
171
160
  id: 1,
172
161
  key: '',
173
162
  },
@@ -212,7 +201,7 @@ describe('test ShortDetail Subunit', () => {
212
201
  {
213
202
  action: {
214
203
  color: '#00979D',
215
- icon: 'caret-up',
204
+ icon: 'caretup',
216
205
  id: 1,
217
206
  key: '',
218
207
  },
@@ -263,7 +252,7 @@ describe('test ShortDetail Subunit', () => {
263
252
  device_type: 'HANET',
264
253
  action: {
265
254
  color: '#00979D',
266
- icon: 'caret-up',
255
+ icon: 'caretup',
267
256
  id: 1,
268
257
  key: '',
269
258
  },
@@ -299,7 +288,7 @@ describe('test ShortDetail Subunit', () => {
299
288
  buttonAddNew.props.onAddNew();
300
289
  });
301
290
  await mock.request(keyPermission.CAMERA);
302
- expect(mockedNavigate).toHaveBeenCalledWith(Routes.AddGatewayStack, {
291
+ expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.AddGatewayStack, {
303
292
  screen: Routes.SelectDeviceType,
304
293
  params: {
305
294
  unit: props.unit,
@@ -1,4 +1,4 @@
1
- import React, { memo } from 'react';
1
+ import React, { memo, useCallback, useMemo } from 'react';
2
2
  import { View, TouchableOpacity } from 'react-native';
3
3
  import styles from './styles';
4
4
  import { Colors } from '../../configs';
@@ -11,38 +11,37 @@ import WaterQuality from '../../../assets/images/WaterQuality.svg';
11
11
  import Device from '../../../assets/images/Device.svg';
12
12
  import { AccessibilityLabel } from '../../configs/Constants';
13
13
 
14
+ const iconMap = {
15
+ air_quality: AirQuality,
16
+ water_quality: WaterQuality,
17
+ temperature: Temperature,
18
+ uv_index: UVIndex,
19
+ three_phase_power_consumption: PowerMeter,
20
+ power_consumption: PowerMeter,
21
+ default: Device,
22
+ };
23
+
14
24
  const SummaryItem = memo(({ item, goToSummary }) => {
15
- const Icon = (() => {
16
- switch (item.template) {
17
- case 'air_quality':
18
- return AirQuality; /* istanbul ignore next */
19
- case 'water_quality':
20
- return WaterQuality; /* istanbul ignore next */
21
- case 'temperature':
22
- return Temperature; /* istanbul ignore next */
23
- case 'uv_index':
24
- return UVIndex; /* istanbul ignore next */
25
- case 'three_phase_power_consumption':
26
- return PowerMeter; /* istanbul ignore next */
27
- case 'power_consumption':
28
- return PowerMeter; /* istanbul ignore next */
29
- default:
30
- return Device; /* istanbul ignore next */
31
- }
32
- })();
25
+ const { template, left_text, left_value, id } = item;
26
+ const Icon = useMemo(() => iconMap[template] || iconMap.default, [template]);
27
+
28
+ const handlePress = useCallback(() => {
29
+ goToSummary(item);
30
+ }, [goToSummary, item]);
31
+
33
32
  return (
34
33
  <TouchableOpacity
35
- onPress={() => goToSummary(item)}
34
+ onPress={handlePress}
36
35
  style={styles.wrapSummaryItem}
37
- accessibilityLabel={`${AccessibilityLabel.UNIT_DETAIL_UNIT_SUMMARY_ITEM}-${item?.id}`}
36
+ accessibilityLabel={`${AccessibilityLabel.UNIT_DETAIL_UNIT_SUMMARY_ITEM}-${id}`}
38
37
  >
39
38
  <View style={styles.summaryItem}>
40
39
  <Icon />
41
40
  <Text type="Body" color={Colors.Gray7} style={styles.summaryText}>
42
- {item.left_text}
41
+ {left_text}
43
42
  </Text>
44
43
  <Text color={Colors.Gray9} bold>
45
- {item.left_value}
44
+ {left_value}
46
45
  </Text>
47
46
  </View>
48
47
  <View style={styles.dashItem} />
@@ -12,17 +12,6 @@ const wrapComponent = (props) => (
12
12
  </SCProvider>
13
13
  );
14
14
 
15
- const mockNavigate = jest.fn();
16
- jest.mock('@react-navigation/native', () => {
17
- return {
18
- ...jest.requireActual('@react-navigation/native'),
19
- useRoute: jest.fn(),
20
- useNavigation: () => ({
21
- navigate: mockNavigate,
22
- }),
23
- };
24
- });
25
-
26
15
  describe('Test HanetCameraDetail', () => {
27
16
  Date.now = jest.fn(() => new Date('2021-09-09T10:00:00.000Z'));
28
17
  let tree, props;
@@ -1,106 +1,114 @@
1
- import React, { memo, useCallback, useRef } from 'react';
2
- import { View, TouchableOpacity, StyleSheet, StatusBar } from 'react-native';
3
- import { Icon } from '@ant-design/react-native';
4
- import { useNavigation } from '@react-navigation/native';
1
+ import React, { memo, useCallback, useMemo, useRef } from 'react';
2
+ import { StatusBar, StyleSheet, TouchableOpacity, View } from 'react-native';
3
+ import AntDesign from 'react-native-vector-icons/AntDesign';
4
+ import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
5
+ import { useNavigation, useRoute } from '@react-navigation/native';
5
6
  import { getStatusBarHeight } from 'react-native-iphone-x-helper';
6
7
 
7
8
  import { Colors, Device } from '../../../configs';
8
- import Text from '../../Text';
9
9
  import { AccessibilityLabel } from '../../../configs/Constants';
10
+ import { useTranslations } from '../../../hooks/Common/useTranslations';
11
+ import {
12
+ useBoolean,
13
+ useIsOwnerOfUnit,
14
+ usePopover,
15
+ } from '../../../hooks/Common';
16
+ import AddMenu from '../../../screens/Unit/AddMenu';
17
+ import MoreMenu from '../../../screens/Unit/MoreMenu';
18
+ import Text from '../../Text';
19
+
20
+ const HeaderUnit = memo(({ transparent, unit }) => {
21
+ const { user_id, name = '' } = unit;
22
+ const { goBack, navigate } = useNavigation();
23
+ const { routeName } = useRoute().params || {};
24
+ const buttonMoreRef = useRef(null);
25
+ const t = useTranslations();
26
+
27
+ const [showAdd, setShowAdd, setHideAdd] = useBoolean();
28
+ const { isOwner } = useIsOwnerOfUnit(user_id);
10
29
 
11
- const HeaderUnit = memo(
12
- ({
13
- transparent,
14
- onBack,
15
- title,
16
- onAdd,
17
- onMore,
18
- hideRight,
19
- hideRightPlus,
20
- styleBoxTitle,
21
- bottomBorder,
22
- idButtonMore = AccessibilityLabel.HEADER_UNIT_BUTTON_MORE,
23
- }) => {
24
- const { goBack } = useNavigation();
25
- const buttonMoreRef = useRef(null);
30
+ const { childRef, showingPopover, showPopoverWithRef, hidePopover } =
31
+ usePopover();
26
32
 
27
- const onPressBack = useCallback(() => {
28
- if (onBack) {
29
- onBack();
30
- } else {
31
- goBack();
32
- }
33
- }, [goBack, onBack]);
33
+ const onPressMore = useCallback(() => {
34
+ showPopoverWithRef(buttonMoreRef);
35
+ }, [showPopoverWithRef]);
34
36
 
35
- const onPressAdd = useCallback(() => {
36
- onAdd && onAdd();
37
- }, [onAdd]);
37
+ const handleGoBack = useCallback(() => {
38
+ if (routeName) {
39
+ navigate(routeName);
40
+ } else {
41
+ goBack();
42
+ }
43
+ }, [goBack, navigate, routeName]);
38
44
 
39
- const onPressMore = useCallback(() => {
40
- onMore && onMore(buttonMoreRef);
41
- }, [onMore]);
45
+ const colorHeader = useMemo(() => {
46
+ return transparent ? Colors.White : Colors.Black;
47
+ }, [transparent]);
42
48
 
43
- return (
44
- <View style={[styles.container, bottomBorder && styles.bottomBorder]}>
49
+ return (
50
+ <View style={styles.container}>
51
+ <TouchableOpacity
52
+ accessibilityLabel={AccessibilityLabel.HEADER_UNIT_BUTTON_BACK}
53
+ onPress={handleGoBack}
54
+ >
55
+ <View style={styles.btnLeft}>
56
+ <AntDesign name={'left'} size={27} color={colorHeader} />
57
+ </View>
58
+ </TouchableOpacity>
59
+ {!transparent && (
60
+ <View style={styles.boxTitle}>
61
+ <Text semibold style={styles.txtHeader} numberOfLines={1}>
62
+ {t('Welcome {name}', { name: name })}
63
+ </Text>
64
+ </View>
65
+ )}
66
+
67
+ <View style={styles.boxRight}>
68
+ {isOwner && (
69
+ <TouchableOpacity
70
+ accessibilityLabel={AccessibilityLabel.HEADER_UNIT_BUTTON_ADD}
71
+ onPress={setShowAdd}
72
+ >
73
+ <View style={styles.btnAdd}>
74
+ <AntDesign name={'plus'} size={27} color={colorHeader} />
75
+ </View>
76
+ </TouchableOpacity>
77
+ )}
45
78
  <TouchableOpacity
46
- accessibilityLabel={AccessibilityLabel.HEADER_UNIT_BUTTON_BACK}
47
- onPress={onPressBack}
79
+ onPress={onPressMore}
80
+ ref={buttonMoreRef}
81
+ accessibilityLabel={AccessibilityLabel.HEADER_UNIT_BUTTON_MORE}
48
82
  >
49
- <View style={styles.btnLeft}>
50
- <Icon
51
- name={'left'}
52
- size={27}
53
- color={transparent ? Colors.White : Colors.Black}
54
- />
83
+ <View style={styles.btnMore}>
84
+ <MaterialIcons name={'more-vert'} size={27} color={colorHeader} />
55
85
  </View>
56
86
  </TouchableOpacity>
57
- <View style={[styles.boxTitle, styleBoxTitle]}>
58
- {title && (
59
- <Text semibold style={styles.txtHeader} numberOfLines={1}>
60
- {title}
61
- </Text>
62
- )}
63
- </View>
64
-
65
- {!hideRight && (
66
- <View style={styles.boxRight}>
67
- {!hideRightPlus && (
68
- <TouchableOpacity
69
- accessibilityLabel={AccessibilityLabel.HEADER_UNIT_BUTTON_ADD}
70
- onPress={onPressAdd}
71
- >
72
- <View style={styles.btnAdd}>
73
- <Icon
74
- name={'plus'}
75
- size={27}
76
- color={transparent ? Colors.White : Colors.Black}
77
- />
78
- </View>
79
- </TouchableOpacity>
80
- )}
81
- <TouchableOpacity
82
- onPress={onPressMore}
83
- ref={buttonMoreRef}
84
- accessibilityLabel={idButtonMore}
85
- >
86
- <View style={styles.btnMore}>
87
- <Icon
88
- name={'more'}
89
- size={27}
90
- color={transparent ? Colors.White : Colors.Black}
91
- />
92
- </View>
93
- </TouchableOpacity>
94
- </View>
95
- )}
96
87
  </View>
97
- );
98
- }
99
- );
88
+ <AddMenu
89
+ unit={unit}
90
+ afterItemClick={hidePopover}
91
+ showAdd={showAdd}
92
+ setHideAdd={setHideAdd}
93
+ />
94
+ <MoreMenu
95
+ unit={unit}
96
+ hidePopover={hidePopover}
97
+ isOwner={isOwner}
98
+ childRef={childRef}
99
+ showingPopover={showingPopover}
100
+ idLabelPopover={AccessibilityLabel.UNIT_DETAIL_POPUP_MORE}
101
+ idLabelItem={AccessibilityLabel.UNIT_DETAIL_POPUP_MORE_ITEM}
102
+ />
103
+ </View>
104
+ );
105
+ });
100
106
 
101
107
  export default HeaderUnit;
108
+
102
109
  const stickyHeaderHeight =
103
110
  Device.TopbarHeight + (Device.isIOS ? 0 : StatusBar.currentHeight);
111
+
104
112
  const styles = StyleSheet.create({
105
113
  container: {
106
114
  flexDirection: 'row',
@@ -1,7 +1,7 @@
1
1
  import React, { Fragment, useCallback } from 'react';
2
2
  import { View, Image, TouchableOpacity } from 'react-native';
3
3
  import { useTranslations } from '../../hooks/Common/useTranslations';
4
- import { IconOutline, IconFill } from '@ant-design/icons-react-native';
4
+ import AntDesign from 'react-native-vector-icons/AntDesign';
5
5
 
6
6
  import { API, Colors, Images } from '../../configs';
7
7
  import Text from '../../commons/Text';
@@ -91,7 +91,7 @@ const SharedUnit = ({
91
91
  {isOptions && (
92
92
  <Fragment>
93
93
  {item.is_pin ? (
94
- <IconFill
94
+ <AntDesign
95
95
  name="pushpin"
96
96
  size={20}
97
97
  color={Colors.Blue10}
@@ -99,15 +99,15 @@ const SharedUnit = ({
99
99
  accessibilityLabel={`${AccessibilityLabel.ICON_REMOVE_PIN_SHARED_UNIT}-${item.id}`}
100
100
  />
101
101
  ) : (
102
- <IconOutline
103
- name="pushpin"
102
+ <AntDesign
103
+ name="pushpino"
104
104
  size={20}
105
105
  onPress={addPinSharedUnit}
106
106
  accessibilityLabel={`${AccessibilityLabel.ICON_ADD_PIN_SHARED_UNIT}-${item.id}`}
107
107
  />
108
108
  )}
109
109
  {item.is_star ? (
110
- <IconFill
110
+ <AntDesign
111
111
  name="star"
112
112
  size={20}
113
113
  color={Colors.Yellow6}
@@ -115,8 +115,8 @@ const SharedUnit = ({
115
115
  accessibilityLabel={`${AccessibilityLabel.ICON_REMOVE_STAR_SHARED_UNIT}-${item.id}`}
116
116
  />
117
117
  ) : (
118
- <IconOutline
119
- name="star"
118
+ <AntDesign
119
+ name="staro"
120
120
  size={20}
121
121
  onPress={addStarSharedUnit}
122
122
  accessibilityLabel={`${AccessibilityLabel.ICON_ADD_STAR_SHARED_UNIT}-${item.id}`}
@@ -1,37 +1,19 @@
1
- import React from 'react';
1
+ import React, { useContext } from 'react';
2
2
  import { act, create } from 'react-test-renderer';
3
3
  import { AccessibilityLabel } from '../../../configs/Constants';
4
4
  import HeaderUnit from '../HeaderUnit/index';
5
-
6
- const mockedGoBack = jest.fn();
7
-
8
- jest.mock('@react-navigation/native', () => {
9
- return {
10
- ...jest.requireActual('@react-navigation/native'),
11
- useNavigation: () => ({
12
- goBack: mockedGoBack,
13
- }),
14
- };
15
- });
5
+ import { useNavigation } from '@react-navigation/native';
6
+ import MoreMenu from '../../../screens/Unit/MoreMenu';
7
+ import AddMenu from '../../../screens/Unit/AddMenu';
16
8
 
17
9
  describe('Test HeaderUnit', () => {
18
- afterEach(() => {
19
- mockedGoBack.mockClear();
20
- });
21
10
  let tree;
22
- const mockedFunc = jest.fn();
23
- const mockedOnBack = jest.fn();
11
+ const unit = { id: 1 };
12
+ const { goBack } = useNavigation();
13
+
24
14
  it('HeaderUnit onPress', async () => {
25
- let title = 'title';
26
15
  await act(async () => {
27
- tree = await create(
28
- <HeaderUnit
29
- title={title}
30
- onBack={mockedOnBack}
31
- onAdd={mockedFunc}
32
- onMore={mockedFunc}
33
- />
34
- );
16
+ tree = await create(<HeaderUnit unit={unit} />);
35
17
  });
36
18
  const instance = tree.root;
37
19
  const item = instance.find(
@@ -39,22 +21,16 @@ describe('Test HeaderUnit', () => {
39
21
  el.props.accessibilityLabel ===
40
22
  AccessibilityLabel.HEADER_UNIT_BUTTON_BACK
41
23
  );
24
+
42
25
  await act(async () => {
43
26
  item.props.onPress();
44
27
  });
45
- expect(mockedOnBack).toHaveBeenCalled();
28
+ expect(global.mockedGoBack).toHaveBeenCalled();
46
29
  });
47
30
 
48
31
  it('HeaderUnit onPress goBack', async () => {
49
32
  await act(async () => {
50
- tree = await create(
51
- <HeaderUnit
52
- title="title"
53
- onBack={false}
54
- onAdd={mockedFunc}
55
- onMore={mockedFunc}
56
- />
57
- );
33
+ tree = await create(<HeaderUnit unit={unit} />);
58
34
  });
59
35
  const instance = tree.root;
60
36
  const item = instance.find(
@@ -65,37 +41,38 @@ describe('Test HeaderUnit', () => {
65
41
  await act(async () => {
66
42
  item.props.onPress();
67
43
  });
68
- expect(mockedGoBack).toHaveBeenCalled();
44
+ expect(goBack).toHaveBeenCalled();
69
45
  });
70
46
 
71
47
  it('HeaderUnit onPressAdd onPressMore', async () => {
48
+ useContext.mockReturnValue({
49
+ stateData: { auth: { account: { user: { id: 1 } } } },
50
+ setAction: jest.fn(),
51
+ });
72
52
  await act(async () => {
73
- tree = await create(
74
- <HeaderUnit
75
- title="title"
76
- onBack={false}
77
- hideRight={false}
78
- hideRightPlus={false}
79
- onAdd={mockedFunc}
80
- onMore={mockedFunc}
81
- />
82
- );
53
+ tree = await create(<HeaderUnit unit={{ ...unit, user_id: 1 }} />);
83
54
  });
84
55
  const instance = tree.root;
85
- const buttonAdd = instance.find(
56
+ const buttonMore = instance.find(
86
57
  (el) =>
87
58
  el.props.accessibilityLabel ===
88
- AccessibilityLabel.HEADER_UNIT_BUTTON_ADD
59
+ AccessibilityLabel.HEADER_UNIT_BUTTON_MORE
89
60
  );
90
- const buttonMore = instance.find(
61
+ expect(instance.findByType(MoreMenu).props.showingPopover).toBeFalsy();
62
+ await act(async () => {
63
+ buttonMore.props.onPress();
64
+ });
65
+ expect(instance.findByType(MoreMenu).props.showingPopover).toBeTruthy();
66
+
67
+ const buttonAdd = instance.find(
91
68
  (el) =>
92
69
  el.props.accessibilityLabel ===
93
- AccessibilityLabel.HEADER_UNIT_BUTTON_MORE
70
+ AccessibilityLabel.HEADER_UNIT_BUTTON_ADD
94
71
  );
72
+ expect(instance.findByType(AddMenu).props.showAdd).toBeFalsy();
95
73
  await act(async () => {
96
74
  buttonAdd.props.onPress();
97
- buttonMore.props.onPress();
98
75
  });
99
- expect(mockedFunc).toHaveBeenCalled();
76
+ expect(instance.findByType(AddMenu).props.showAdd).toBeTruthy();
100
77
  });
101
78
  });