@eohjsc/react-native-smart-city 0.3.4 → 0.3.7

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 (293) hide show
  1. package/README.md +15 -36
  2. package/package.json +5 -9
  3. package/react-native-smart-city.podspec +0 -1
  4. package/src/commons/Action/ItemQuickAction.js +4 -16
  5. package/src/commons/Action/__test__/ItemQuickAction.test.js +6 -11
  6. package/src/commons/ActionGroup/ColorPickerTemplate.js +24 -37
  7. package/src/commons/ActionGroup/CurtainButtonTemplate.js +5 -10
  8. package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +31 -12
  9. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +0 -4
  10. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +1 -1
  11. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +0 -14
  12. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +0 -1
  13. package/src/commons/ActionGroup/OnOffTemplate/OnOffButtonTemplate.js +2 -8
  14. package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +10 -10
  15. package/src/commons/ActionGroup/OnOffTemplate/index.js +2 -3
  16. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +9 -7
  17. package/src/commons/ActionGroup/SliderRangeTemplate.js +2 -6
  18. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +3 -7
  19. package/src/commons/ActionGroup/StatesGridActionTemplate.js +8 -22
  20. package/src/commons/ActionGroup/TimerActionTemplate.js +3 -11
  21. package/src/commons/ActionGroup/TwoButtonTemplate/index.js +5 -1
  22. package/src/commons/ActionGroup/__test__/CurtainButtonTemplate.test.js +4 -53
  23. package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +83 -3
  24. package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +14 -14
  25. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +78 -53
  26. package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +20 -36
  27. package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +57 -1
  28. package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +6 -58
  29. package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +1 -49
  30. package/src/commons/ActionGroup/__test__/index.test.js +4 -142
  31. package/src/commons/Auth/AccountList.js +1 -1
  32. package/src/commons/Automate/ItemAutomate.js +3 -1
  33. package/src/commons/Connecting/__test__/Connecting.test.js +2 -19
  34. package/src/commons/ConnectingProcess/DeviceItem/DeviceItem.js +3 -7
  35. package/src/commons/ConnectingProcess/DeviceItem/DeviceItemStyles.js +11 -8
  36. package/src/commons/ConnectingProcess/__test__/Connecting.test.js +3 -136
  37. package/src/commons/ConnectingProcess/__test__/DeviceItem.test.js +2 -3
  38. package/src/commons/ConnectingProcess/index.js +25 -75
  39. package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +13 -16
  40. package/src/commons/Dashboard/MyPinnedSharedUnit/index.js +1 -1
  41. package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +5 -0
  42. package/src/commons/Device/ConnectedViewHeader.js +1 -1
  43. package/src/commons/Device/HistoryChart.js +3 -7
  44. package/src/commons/Device/ItemDevice.js +12 -19
  45. package/src/commons/Device/LinearChart.js +0 -15
  46. package/src/commons/Device/PMSensor/PMSensorIndicatior.js +12 -16
  47. package/src/commons/Device/PMSensor/PMSensorIndicatorStyles.js +0 -3
  48. package/src/commons/Device/SonosSpeaker/index.js +1 -1
  49. package/src/commons/Device/WaterQualitySensor/ListQualityIndicator.js +0 -1
  50. package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +2 -7
  51. package/src/commons/Explore/__test__/CityItem.test.js +54 -33
  52. package/src/commons/Form/CurrencyInput.js +1 -15
  53. package/src/commons/Form/TextInputPassword.js +1 -1
  54. package/src/commons/FullLoading/index.js +1 -2
  55. package/src/commons/Header/HeaderCustom.js +1 -2
  56. package/src/commons/HeaderAni/index.js +1 -6
  57. package/src/commons/HorizontalPicker/index.js +2 -2
  58. package/src/commons/MediaPlayerDetail/Styles/MediaPlayerDetailStyles.js +6 -0
  59. package/src/commons/MediaPlayerDetail/index.js +47 -25
  60. package/src/commons/MenuActionAddnew/index.js +0 -1
  61. package/src/commons/MenuActionList/index.js +0 -1
  62. package/src/commons/MenuActionMore/index.js +1 -1
  63. package/src/commons/PreventAccess/index.js +1 -9
  64. package/src/commons/Sharing/MemberList.js +2 -10
  65. package/src/commons/Sharing/WrapHeaderScrollable.js +0 -2
  66. package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +1 -0
  67. package/src/commons/SubUnit/Favorites/index.js +3 -2
  68. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +35 -8
  69. package/src/commons/SubUnit/OneTap/index.js +2 -1
  70. package/src/commons/SubUnit/ShortDetail.js +9 -25
  71. package/src/commons/SubUnit/__test__/Item.test.js +1 -0
  72. package/src/commons/SubUnit/__test__/ShortDetail.test.js +2 -9
  73. package/src/commons/Unit/SharedUnit.js +0 -1
  74. package/src/commons/Unit/__test__/SharedUnit.test.js +183 -38
  75. package/src/commons/UnitSummary/ConfigHistoryChart/index.js +13 -2
  76. package/src/commons/UnitSummary/ConfigHistoryChart.js +13 -22
  77. package/src/commons/WheelDateTimePicker/index.js +3 -4
  78. package/src/configs/API.js +143 -87
  79. package/src/configs/Constants.js +2 -57
  80. package/src/configs/SCConfig.js +0 -4
  81. package/src/context/actionType.ts +0 -8
  82. package/src/context/mockStore.ts +0 -10
  83. package/src/context/reducer.ts +2 -38
  84. package/src/hooks/Common/index.js +0 -2
  85. package/src/hooks/Common/useGetIdUser.js +5 -1
  86. package/src/hooks/Common/useSensorsStatus.js +4 -4
  87. package/src/hooks/useReceiveNotifications.js +5 -9
  88. package/src/iot/Monitor.js +2 -3
  89. package/src/iot/RemoteControl/Bluetooth.js +1 -1
  90. package/src/iot/RemoteControl/GoogleHome.js +49 -75
  91. package/src/iot/RemoteControl/Internet.js +1 -1
  92. package/src/iot/RemoteControl/__test__/GoogleHome.test.js +48 -95
  93. package/src/iot/RemoteControl/__test__/Internet.test.js +7 -18
  94. package/src/iot/RemoteControl/__test__/LgThinq.test.js +177 -36
  95. package/src/iot/RemoteControl/index.js +52 -52
  96. package/src/navigations/UnitStack.js +20 -11
  97. package/src/screens/AQIGuide/index.js +1 -1
  98. package/src/screens/ActivityLog/FilterPopup.js +0 -2
  99. package/src/screens/ActivityLog/__test__/index.test.js +23 -38
  100. package/src/screens/ActivityLog/hooks/__test__/index.test.js +90 -51
  101. package/src/screens/ActivityLog/hooks/index.js +1 -1
  102. package/src/screens/ActivityLog/index.js +2 -2
  103. package/src/screens/AddCommon/SelectSubUnit.js +0 -1
  104. package/src/screens/AddCommon/SelectUnit.js +0 -1
  105. package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +24 -13
  106. package/src/screens/AddCommon/__test__/SelectUnit.test.js +33 -9
  107. package/src/screens/AddLocationMaps/index.js +5 -9
  108. package/src/screens/AddNewAction/SelectAction.js +8 -8
  109. package/src/screens/AddNewAction/SelectSensorDevices.js +2 -8
  110. package/src/screens/AddNewAction/SetupSensor.js +7 -7
  111. package/src/screens/AddNewAction/__test__/SelectAction.test.js +91 -10
  112. package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +26 -40
  113. package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +1 -3
  114. package/src/screens/AddNewAutoSmart/index.js +2 -5
  115. package/src/screens/AddNewDevice/ConnectingDevices.js +3 -3
  116. package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +34 -42
  117. package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +4 -0
  118. package/src/screens/AddNewDevice/__test__/ConnectingDevices.test.js +22 -22
  119. package/src/screens/AddNewDevice/hooks/ConnectDevices.js +1 -1
  120. package/src/screens/AddNewDevice/index.js +0 -1
  121. package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +17 -23
  122. package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +4 -7
  123. package/src/screens/AddNewGateway/SelectGateway.js +0 -1
  124. package/src/screens/AddNewGateway/SetupGatewayWifi.js +0 -2
  125. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +6 -4
  126. package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +4 -0
  127. package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +29 -5
  128. package/src/screens/AddNewGateway/__test__/SelectGateway.test.js +4 -0
  129. package/src/screens/AddNewGateway/__test__/SetupGateway.test.js +4 -0
  130. package/src/screens/AddNewGateway/index.js +0 -1
  131. package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +24 -10
  132. package/src/screens/AddNewOneTap/index.js +2 -3
  133. package/src/screens/AllCamera/index.js +4 -4
  134. package/src/screens/Automate/MultiUnits.js +8 -8
  135. package/src/screens/Automate/__test__/MultiUnits.test.js +9 -6
  136. package/src/screens/Automate/__test__/index.test.js +12 -7
  137. package/src/screens/Automate/index.js +3 -5
  138. package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +8 -36
  139. package/src/screens/ConfirmUnitDeletion/index.js +1 -7
  140. package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +22 -71
  141. package/src/screens/Device/EditDevice/index.js +15 -17
  142. package/src/screens/Device/__test__/detail.test.js +86 -33
  143. package/src/screens/Device/components/DetailHistoryChart.js +1 -1
  144. package/src/screens/Device/components/SensorConnectStatusViewHeader.js +0 -1
  145. package/src/screens/Device/components/SensorDisplayItem.js +2 -5
  146. package/src/screens/Device/detail.js +24 -80
  147. package/src/screens/Device/hooks/useDisconnectedDevice.js +4 -4
  148. package/src/screens/Device/hooks/useFavoriteDevice.js +9 -5
  149. package/src/screens/DeviceInfo/__test__/index.test.js +2 -0
  150. package/src/screens/EditActionsList/index.js +1 -1
  151. package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +3 -6
  152. package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +19 -7
  153. package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +2 -20
  154. package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +23 -40
  155. package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
  156. package/src/screens/EmergencySetting/index.js +1 -4
  157. package/src/screens/EnterPassword/__test__/EnterPassword.test.js +25 -41
  158. package/src/screens/Explore/index.js +0 -2
  159. package/src/screens/GuestInfo/__test__/index.test.js +41 -14
  160. package/src/screens/GuestInfo/components/RecurringDetail.js +0 -1
  161. package/src/screens/GuestInfo/components/TemporaryDetail.js +2 -2
  162. package/src/screens/HanetCamera/Detail.js +1 -1
  163. package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +12 -8
  164. package/src/screens/HanetCamera/__test__/Detail.test.js +42 -27
  165. package/src/screens/HanetCamera/__test__/ManageAccess.test.js +5 -8
  166. package/src/screens/HanetCamera/__test__/MemberInfo.test.js +32 -10
  167. package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -3
  168. package/src/screens/HanetCamera/hooks/__test__/useHanetCheckinData.test.js +35 -43
  169. package/src/screens/HanetCamera/hooks/__test__/useHanetPlaceMembers.test.js +21 -10
  170. package/src/screens/HanetCamera/hooks/useHanetCheckinData.js +11 -11
  171. package/src/screens/HanetCamera/hooks/useHanetPlaceMembers.js +11 -11
  172. package/src/screens/ManageAccess/__test__/ManageAccess.test.js +22 -33
  173. package/src/screens/ManageAccess/hooks/__test__/useManageAccess.test.js +45 -44
  174. package/src/screens/ManageAccess/hooks/index.js +4 -7
  175. package/src/screens/ManageAccess/index.js +1 -2
  176. package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +12 -35
  177. package/src/screens/MoveToAnotherSubUnit/index.js +6 -6
  178. package/src/screens/Notification/__test__/Notification.test.js +25 -14
  179. package/src/screens/Notification/__test__/NotificationItem.test.js +7 -8
  180. package/src/screens/Notification/components/NotificationItem.js +20 -17
  181. package/src/screens/Notification/index.js +2 -9
  182. package/src/screens/PlayBackCamera/Timer.js +2 -2
  183. package/src/screens/PlayBackCamera/__test__/index.test.js +2 -87
  184. package/src/screens/PlayBackCamera/index.js +6 -22
  185. package/src/screens/ScanChipQR/__test__/ScanChipQR.test.js +20 -7
  186. package/src/screens/ScanChipQR/components/QRScan/index.js +0 -1
  187. package/src/screens/ScanChipQR/hooks/index.js +16 -15
  188. package/src/screens/ScanSensorQR/__test__/ScanSensorQR.test.js +24 -8
  189. package/src/screens/ScriptDetail/__test__/index.test.js +86 -17
  190. package/src/screens/ScriptDetail/index.js +14 -19
  191. package/src/screens/SelectUnit/__test__/index.test.js +55 -12
  192. package/src/screens/SelectUnit/index.js +4 -9
  193. package/src/screens/SetSchedule/index.js +11 -15
  194. package/src/screens/SharedUnit/__test__/TabHeader.test.js +2 -0
  195. package/src/screens/SharedUnit/index.js +0 -2
  196. package/src/screens/Sharing/Components/SensorItem.js +12 -10
  197. package/src/screens/Sharing/InfoMemberUnit.js +1 -1
  198. package/src/screens/Sharing/MemberList.js +11 -12
  199. package/src/screens/Sharing/SelectPermission.js +76 -121
  200. package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +29 -47
  201. package/src/screens/Sharing/__test__/MemberList.test.js +127 -13
  202. package/src/screens/Sharing/__test__/SelectPermission.test.js +38 -28
  203. package/src/screens/Sharing/__test__/SelectUser.test.js +38 -17
  204. package/src/screens/Sharing/hooks/index.js +0 -3
  205. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +2 -3
  206. package/src/screens/SmartIr/components/SelectBrand.js +1 -1
  207. package/src/screens/SubUnit/AddSubUnit.js +17 -23
  208. package/src/screens/SubUnit/Detail.js +2 -1
  209. package/src/screens/SubUnit/EditSubUnit.js +13 -15
  210. package/src/screens/SubUnit/ManageSubUnit.js +7 -13
  211. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +89 -29
  212. package/src/screens/SubUnit/__test__/Detail.test.js +8 -31
  213. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +89 -21
  214. package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +1 -27
  215. package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +45 -48
  216. package/src/screens/SubUnit/hooks/useManageSubUnit.js +7 -7
  217. package/src/screens/SyncLGDevice/AddLGDevice.js +0 -1
  218. package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +91 -22
  219. package/src/screens/TDSGuide/index.js +1 -4
  220. package/src/screens/UVIndexGuide/index.js +1 -1
  221. package/src/screens/Unit/ChooseLocation.js +14 -7
  222. package/src/screens/Unit/Detail.js +75 -30
  223. package/src/screens/Unit/ManageUnit.js +0 -1
  224. package/src/screens/Unit/SelectAddress.js +23 -45
  225. package/src/screens/Unit/SmartAccount.js +4 -4
  226. package/src/screens/Unit/Station/index.js +0 -4
  227. package/src/screens/Unit/Summaries.js +2 -18
  228. package/src/screens/Unit/__test__/CheckSendEmail.test.js +29 -24
  229. package/src/screens/Unit/__test__/ChooseLocation.test.js +14 -27
  230. package/src/screens/Unit/__test__/Detail.test.js +200 -99
  231. package/src/screens/Unit/__test__/ManageUnit.test.js +42 -18
  232. package/src/screens/Unit/__test__/SelectAddress.test.js +49 -159
  233. package/src/screens/Unit/__test__/SmartAccount.test.js +9 -17
  234. package/src/screens/Unit/__test__/SmartAccountItem.test.js +1 -0
  235. package/src/screens/Unit/components/MyUnitDevice/index.js +4 -4
  236. package/src/screens/Unit/components/SharedUnit/index.js +0 -1
  237. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
  238. package/src/screens/Unit/components/__test__/SharedUnit.test.js +34 -31
  239. package/src/screens/Unit/styles.js +0 -4
  240. package/src/screens/UnitSummary/__test__/index.test.js +30 -91
  241. package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +2 -31
  242. package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/__test__/index.test.js +4 -7
  243. package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/index.js +13 -2
  244. package/src/screens/UnitSummary/components/PowerConsumption/__test__/ItemPower.test.js +1 -0
  245. package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +16 -14
  246. package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +2 -11
  247. package/src/screens/UnitSummary/components/RunningDevices/index.js +10 -7
  248. package/src/screens/UnitSummary/components/Temperature/index.js +4 -4
  249. package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +2 -10
  250. package/src/screens/UnitSummary/index.js +1 -15
  251. package/src/screens/WaterQualityGuide/index.js +1 -1
  252. package/src/utils/Apis/axios.js +31 -54
  253. package/src/utils/Converter/time.js +18 -0
  254. package/src/utils/I18n/translations/en.json +1 -7
  255. package/src/utils/I18n/translations/vi.json +1 -8
  256. package/src/utils/Route/index.js +0 -1
  257. package/src/utils/Utils.js +7 -11
  258. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/ItemPasscode.test.js +0 -24
  259. package/src/commons/ActionGroup/__test__/NumberUpDownTemplateWithNullConfigValue.test.js +0 -60
  260. package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +0 -77
  261. package/src/commons/Calendar/__test__/Calendar.test.js +0 -33
  262. package/src/commons/Device/Hanet/ItemHanetDevice.test.js +0 -58
  263. package/src/commons/FieldTemplate/ChooseUserField/ChooseFieldStyles.js +0 -25
  264. package/src/commons/FieldTemplate/ChooseUserField/ChoosePopup.js +0 -96
  265. package/src/commons/FieldTemplate/ChooseUserField/ChoosePopupStyles.js +0 -39
  266. package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +0 -118
  267. package/src/commons/FieldTemplate/ChooseUserField/index.js +0 -62
  268. package/src/commons/FieldTemplate/PasscodeField/PasscodeFieldStyles.js +0 -30
  269. package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +0 -90
  270. package/src/commons/FieldTemplate/PasscodeField/index.js +0 -43
  271. package/src/commons/FieldTemplate/ScheduleField/ScheduleFieldStyles.js +0 -13
  272. package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +0 -179
  273. package/src/commons/FieldTemplate/ScheduleField/index.js +0 -176
  274. package/src/commons/PreventAccess/__test__/PreventAccess.test.js +0 -62
  275. package/src/hooks/Common/useGGHomeDeviceConnected.js +0 -16
  276. package/src/hooks/IoT/__test__/useGGHomeConnection.test.js +0 -198
  277. package/src/hooks/IoT/__test__/useRemoteControl.test.js +0 -198
  278. package/src/hooks/IoT/index.js +0 -4
  279. package/src/hooks/IoT/useGGHomeConnection.js +0 -91
  280. package/src/hooks/IoT/useRemoteControl.js +0 -79
  281. package/src/hooks/index.js +0 -4
  282. package/src/navigations/UnitStackStyles.js +0 -21
  283. package/src/screens/Sharing/__test__/MemberList2.test.js +0 -80
  284. package/src/screens/SideMenuDetail/SideMenuDetailStyles.js +0 -28
  285. package/src/screens/SideMenuDetail/__test__/index.test.js +0 -154
  286. package/src/screens/SideMenuDetail/index.js +0 -148
  287. package/src/screens/Unit/__test__/Summaries.test.js +0 -100
  288. package/src/screens/Unit/components/MyAllUnit/__test__/MyAllUnit.test.js +0 -36
  289. package/src/screens/Unit/components/MyAllUnit/__test__/index.test.js +0 -54
  290. package/src/screens/Unit/hook/useUnitConnectRemoteDevices.js +0 -50
  291. package/src/utils/Permission/common.js +0 -67
  292. package/src/utils/Setting/Location.js +0 -30
  293. package/src/utils/__test__/Utils.test.js +0 -12
@@ -8,14 +8,11 @@ export default (unit, sensor) => {
8
8
  const [isLoading, setIsLoading] = useState(false);
9
9
  const fetchData = useCallback(async () => {
10
10
  setIsLoading(true);
11
- const { success, data: accessData } = await axiosGet(
12
- API.UNIT.MANAGE_ACCESS(unit.id),
13
- {
14
- params: { sensor_id: sensor.id },
15
- }
16
- );
11
+ const { success, data } = await axiosGet(API.UNIT.MANAGE_ACCESS(unit.id), {
12
+ params: { sensor_id: sensor.id },
13
+ });
17
14
  if (success) {
18
- setData(accessData);
15
+ setData(data);
19
16
  }
20
17
  setIsLoading(false);
21
18
  }, [unit.id, sensor.id]);
@@ -19,7 +19,7 @@ import { RowItem } from '../../commons/RowItem';
19
19
  const ManageAccessScreen = memo(({ route }) => {
20
20
  const t = useTranslations();
21
21
  const { params = {} } = route;
22
- const { unit = {}, sensor = {} } = params;
22
+ const { unit, sensor } = params;
23
23
  const { navigate } = useNavigation();
24
24
  const isFocused = useIsFocused();
25
25
  const { data, isRefresh, isLoading, onRefresh } = useManageAccess(
@@ -46,7 +46,6 @@ const ManageAccessScreen = memo(({ route }) => {
46
46
  refreshControl={
47
47
  <RefreshControl refreshing={false} onRefresh={onRefresh} />
48
48
  }
49
- scrollIndicatorInsets={{ right: 1 }}
50
49
  >
51
50
  <View style={styles.container}>
52
51
  <Text semibold style={styles.titleGuest}>
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import MockAdapter from 'axios-mock-adapter';
2
+ import axios from 'axios';
3
3
  import { create } from 'react-test-renderer';
4
4
  import { act } from '@testing-library/react-hooks';
5
- import { TouchableOpacity } from 'react-native';
6
5
 
7
6
  import { TESTID } from '../../../configs/Constants';
8
7
  import { API } from '../../../configs';
@@ -10,20 +9,8 @@ import MoveToAnotherSubUnit from '../';
10
9
  import { SCProvider } from '../../../context';
11
10
  import { mockSCStore } from '../../../context/mockStore';
12
11
  import BottomButtonView from '../../../commons/BottomButtonView';
13
- import api from '../../../utils/Apis/axios';
14
-
15
- const mock = new MockAdapter(api.axiosInstance);
16
-
17
- const mockNavigate = jest.fn();
18
- jest.mock('@react-navigation/native', () => {
19
- return {
20
- ...jest.requireActual('@react-navigation/native'),
21
- useNavigation: () => ({
22
- navigate: mockNavigate,
23
- }),
24
- };
25
- });
26
12
 
13
+ jest.mock('axios');
27
14
  jest.mock('react', () => {
28
15
  return {
29
16
  ...jest.requireActual('react'),
@@ -98,17 +85,6 @@ describe('Test Render ListSubUnit', () => {
98
85
  },
99
86
  };
100
87
 
101
- it('render ListSubUnit with out params', async () => {
102
- await act(async () => {
103
- tree = await create(wrapComponent({}));
104
- });
105
- const instance = tree.root;
106
- const rowSubUnit = instance.findAll(
107
- (el) => el.props.testID === TESTID.ROW_SUB_UNIT
108
- );
109
- expect(rowSubUnit).toHaveLength(0);
110
- });
111
-
112
88
  it('render ListSubUnit', async () => {
113
89
  await act(async () => {
114
90
  tree = await create(wrapComponent(route));
@@ -136,14 +112,15 @@ describe('Test Render ListSubUnit', () => {
136
112
  sensors: [],
137
113
  });
138
114
  });
139
- mock.onPatch(API.DEVICE.CHANGE_SUB_UNIT(200, 3, 73)).reply(200);
140
- await bottomButtonView.props.onPressMain();
141
- expect(mockNavigate).toBeCalled();
142
- const TouchableOpacities = instance.findAllByType(TouchableOpacity);
143
- await TouchableOpacities[2].props.onPress();
144
- mockNavigate.mockClear();
145
- mock.onPatch(API.DEVICE.CHANGE_SUB_UNIT(200, 3, 73)).reply(400);
146
- await bottomButtonView.props.onPressMain();
147
- expect(mockNavigate).not.toBeCalled();
115
+ act(() => {
116
+ bottomButtonView.props.onPressMain();
117
+ });
118
+
119
+ expect(axios.patch).toHaveBeenCalledWith(
120
+ API.SENSOR.CHANGE_SUB_UNIT(200, 3, 73),
121
+ {
122
+ station_id: 4,
123
+ }
124
+ );
148
125
  });
149
126
  });
@@ -36,12 +36,12 @@ const MoveToAnotherSubUnit = memo(({ route }) => {
36
36
  const { unit, sensor, station } = params;
37
37
  const { navigate } = useNavigation();
38
38
  const [selectedSubUnit, setSelectedSubUnit] = useState(
39
- unit?.stations?.find((subUnit) => subUnit.id === station.id)
39
+ unit.stations?.find((subUnit) => subUnit.id === station.id)
40
40
  );
41
41
 
42
42
  const listStationUnit = useMemo(() => {
43
- return unit?.stations.slice(2) || [];
44
- }, [unit?.stations]);
43
+ return unit.stations.slice(2);
44
+ }, [unit.stations]);
45
45
 
46
46
  const handleOnSelect = useCallback((item) => {
47
47
  setSelectedSubUnit(item);
@@ -49,7 +49,7 @@ const MoveToAnotherSubUnit = memo(({ route }) => {
49
49
 
50
50
  const onSubmit = useCallback(async () => {
51
51
  const { success } = await axiosPatch(
52
- API.DEVICE.CHANGE_SUB_UNIT(unit.id, station.id, sensor.id),
52
+ API.SENSOR.CHANGE_SUB_UNIT(unit.id, station.id, sensor.id),
53
53
  {
54
54
  station_id: selectedSubUnit.id,
55
55
  }
@@ -57,12 +57,12 @@ const MoveToAnotherSubUnit = memo(({ route }) => {
57
57
  if (success) {
58
58
  navigate(Routes.UnitDetail);
59
59
  }
60
- }, [navigate, selectedSubUnit?.id, sensor?.id, station?.id, unit?.id]);
60
+ }, [navigate, selectedSubUnit.id, sensor.id, station.id, unit.id]);
61
61
 
62
62
  return (
63
63
  <View style={styles.wrap}>
64
64
  <HeaderCustom title={t('move_to_another_sub_unit')} isShowSeparator />
65
- <ScrollView scrollIndicatorInsets={{ right: 1 }}>
65
+ <ScrollView>
66
66
  <View style={styles.container}>
67
67
  <View>
68
68
  {listStationUnit.map((item, index) => (
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { act, create } from 'react-test-renderer';
3
- import MockAdapter from 'axios-mock-adapter';
3
+ import axios from 'axios';
4
4
  import { Animated, RefreshControl } from 'react-native';
5
5
 
6
6
  import { SCProvider } from '../../../context';
@@ -8,7 +8,6 @@ import { mockSCStore } from '../../../context/mockStore';
8
8
  import Notification from '../index';
9
9
  import NotificationItem from '../components/NotificationItem';
10
10
  import { API } from '../../../configs';
11
- import api from '../../../utils/Apis/axios';
12
11
 
13
12
  const wrapComponent = () => (
14
13
  <SCProvider initState={mockSCStore({})}>
@@ -16,7 +15,7 @@ const wrapComponent = () => (
16
15
  </SCProvider>
17
16
  );
18
17
 
19
- const mock = new MockAdapter(api.axiosInstance);
18
+ jest.mock('axios');
20
19
 
21
20
  jest.mock('react', () => {
22
21
  return {
@@ -54,9 +53,9 @@ describe('test Notification', () => {
54
53
  ],
55
54
  },
56
55
  };
57
- mock
58
- .onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''))
59
- .reply(200, response.data);
56
+ axios.get.mockImplementation(async () => {
57
+ return response;
58
+ });
60
59
  await act(async () => {
61
60
  tree = await create(wrapComponent());
62
61
  });
@@ -64,6 +63,10 @@ describe('test Notification', () => {
64
63
  const notificationItem = instance.findAllByType(NotificationItem);
65
64
 
66
65
  expect(notificationItem).toHaveLength(2);
66
+ expect(axios.get).toHaveBeenCalledWith(
67
+ API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''),
68
+ {}
69
+ );
67
70
  });
68
71
 
69
72
  test('test handleOnLoadMore', async () => {
@@ -92,18 +95,22 @@ describe('test Notification', () => {
92
95
  ],
93
96
  },
94
97
  };
95
- mock
96
- .onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''))
97
- .reply(200, response.data);
98
+ axios.get.mockImplementation(async () => {
99
+ return response;
100
+ });
98
101
  await act(async () => {
99
102
  tree = await create(wrapComponent());
100
103
  });
101
104
  const instance = tree.root;
102
105
  const scrollView = instance.findByType(Animated.ScrollView);
106
+
103
107
  act(() => {
104
108
  scrollView.props.onMomentumScrollEnd();
105
109
  });
106
- expect(scrollView).toBeDefined();
110
+ expect(axios.get).toHaveBeenCalledWith(
111
+ API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''),
112
+ {}
113
+ );
107
114
  });
108
115
 
109
116
  test('test onRefresh', async () => {
@@ -132,17 +139,21 @@ describe('test Notification', () => {
132
139
  ],
133
140
  },
134
141
  };
135
- mock
136
- .onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''))
137
- .reply(200, response.data);
142
+ axios.get.mockImplementation(async () => {
143
+ return response;
144
+ });
138
145
  await act(async () => {
139
146
  tree = await create(wrapComponent());
140
147
  });
141
148
  const instance = tree.root;
142
149
  const refreshControl = instance.findByType(RefreshControl);
150
+
143
151
  act(() => {
144
152
  refreshControl.props.onRefresh();
145
153
  });
146
- expect(refreshControl).toBeDefined();
154
+ expect(axios.get).toHaveBeenCalledWith(
155
+ API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''),
156
+ {}
157
+ );
147
158
  });
148
159
  });
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { act, create } from 'react-test-renderer';
3
3
  import { TouchableOpacity } from 'react-native';
4
- import MockAdapter from 'axios-mock-adapter';
4
+ import axios from 'axios';
5
5
 
6
6
  import { SCProvider } from '../../../context';
7
7
  import { mockSCStore } from '../../../context/mockStore';
@@ -9,7 +9,6 @@ import NotificationItem from '../components/NotificationItem';
9
9
  import { NOTIFICATION_TYPES, SENSOR_TYPE } from '../../../configs/Constants';
10
10
  import Routes from '../../../utils/Route';
11
11
  import { API } from '../../../configs';
12
- import api from '../../../utils/Apis/axios';
13
12
 
14
13
  const wrapComponent = (item) => (
15
14
  <SCProvider initState={mockSCStore({})}>
@@ -17,7 +16,7 @@ const wrapComponent = (item) => (
17
16
  </SCProvider>
18
17
  );
19
18
 
20
- const mock = new MockAdapter(api.axiosInstance);
19
+ jest.mock('axios');
21
20
 
22
21
  const mockNavigate = jest.fn();
23
22
  jest.mock('@react-navigation/native', () => {
@@ -239,10 +238,10 @@ describe('test NotificationItem', () => {
239
238
  });
240
239
  const instance = tree.root;
241
240
  const button = instance.findByType(TouchableOpacity);
242
- mock.onPost(API.NOTIFICATION.SET_READ(1)).reply(200);
243
241
  act(() => {
244
242
  button.props.onPress();
245
243
  });
244
+ expect(axios.post).toHaveBeenCalledWith(API.NOTIFICATION.SET_READ(1));
246
245
  expect(mockNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
247
246
  screen: Routes.UnitSummary,
248
247
  params: {
@@ -254,10 +253,10 @@ describe('test NotificationItem', () => {
254
253
 
255
254
  test('test render Notify not in any case', () => {
256
255
  item.content_code = 'NEW CASE';
257
- item.params = "{ 'unit_id': 1 }";
258
- act(() => {
259
- tree = create(wrapComponent(item));
260
- });
256
+ (item.params = "{ 'unit_id': 1 }"),
257
+ act(() => {
258
+ tree = create(wrapComponent(item));
259
+ });
261
260
  const instance = tree.root;
262
261
  const button = instance.findByType(TouchableOpacity);
263
262
  act(() => {
@@ -41,7 +41,7 @@ const NotificationItem = memo(({ item }) => {
41
41
  return values;
42
42
  }, [paramsJSON]);
43
43
 
44
- const customColorText = (text, colorParams) => {
44
+ const customColorText = (text, params) => {
45
45
  return text.split('**').map((str, i) =>
46
46
  i % 2 === 0 ? (
47
47
  <Text type="Body" key={i} style={styles.textNotification}>
@@ -49,7 +49,7 @@ const NotificationItem = memo(({ item }) => {
49
49
  </Text>
50
50
  ) : (
51
51
  <Text type="Body" bold key={i} style={styles.textNotification}>
52
- {colorParams[(i - 1) / 2]}
52
+ {params[(i - 1) / 2]}
53
53
  </Text>
54
54
  )
55
55
  );
@@ -167,6 +167,7 @@ const NotificationItem = memo(({ item }) => {
167
167
  }),
168
168
  };
169
169
  case NOTIFICATION_TYPES.BOOKING_EXPIRED_AND_VIOLATION_CREATED:
170
+ const violated_booking_id = paramsJSON.violated_booking_id;
170
171
  return {
171
172
  content: customColorText(
172
173
  t(
@@ -177,7 +178,7 @@ const NotificationItem = memo(({ item }) => {
177
178
  redirect: () =>
178
179
  navigation.navigate(Routes.SmartParkingStack, {
179
180
  screen: Routes.SmartParkingBookingDetails,
180
- params: { id: paramsJSON.violated_booking_id || booking_id },
181
+ params: { id: violated_booking_id || booking_id },
181
182
  }),
182
183
  };
183
184
  case NOTIFICATION_TYPES.MOVE_CAR_WITHOUT_PAY_VIOLATION:
@@ -205,6 +206,7 @@ const NotificationItem = memo(({ item }) => {
205
206
  }),
206
207
  };
207
208
  case NOTIFICATION_TYPES.PAY_FINE_AND_EXTEND_SUCCESSFULLY:
209
+ const new_booking_id = paramsJSON.booking_id_new;
208
210
  return {
209
211
  content: customColorText(
210
212
  t('text_notification_content_pay_fine_and_extend_successfully'),
@@ -213,7 +215,7 @@ const NotificationItem = memo(({ item }) => {
213
215
  redirect: () =>
214
216
  navigation.navigate(Routes.SmartParkingStack, {
215
217
  screen: Routes.SmartParkingBookingDetails,
216
- params: { id: paramsJSON.booking_id_new },
218
+ params: { id: new_booking_id },
217
219
  }),
218
220
  };
219
221
  case NOTIFICATION_TYPES.STOP_VIOLATION_FREE_PARKING_ZONE:
@@ -229,7 +231,8 @@ const NotificationItem = memo(({ item }) => {
229
231
  }),
230
232
  };
231
233
  case NOTIFICATION_TYPES.NOTIFY_INDICATOR:
232
- switch (paramsJSON.sensor_type) {
234
+ const { sensor_type, summary_id } = paramsJSON;
235
+ switch (sensor_type) {
233
236
  case SENSOR_TYPE.AIR_QUALITY:
234
237
  return {
235
238
  content: customColorText(
@@ -240,7 +243,7 @@ const NotificationItem = memo(({ item }) => {
240
243
  navigation.navigate(Routes.UnitStack, {
241
244
  screen: Routes.UnitSummary,
242
245
  params: {
243
- summaryId: paramsJSON.summary_id,
246
+ summaryId: summary_id,
244
247
  unitId,
245
248
  },
246
249
  }),
@@ -256,7 +259,7 @@ const NotificationItem = memo(({ item }) => {
256
259
  navigation.navigate(Routes.UnitStack, {
257
260
  screen: Routes.UnitSummary,
258
261
  params: {
259
- summaryId: paramsJSON.summary_id,
262
+ summaryId: summary_id,
260
263
  unitId,
261
264
  },
262
265
  }),
@@ -272,7 +275,7 @@ const NotificationItem = memo(({ item }) => {
272
275
  navigation.navigate(Routes.UnitStack, {
273
276
  screen: Routes.UnitSummary,
274
277
  params: {
275
- summaryId: paramsJSON.summary_id,
278
+ summaryId: summary_id,
276
279
  unitId,
277
280
  },
278
281
  }),
@@ -288,7 +291,7 @@ const NotificationItem = memo(({ item }) => {
288
291
  navigation.navigate(Routes.UnitStack, {
289
292
  screen: Routes.UnitSummary,
290
293
  params: {
291
- summaryId: paramsJSON.summary_id,
294
+ summaryId: summary_id,
292
295
  unitId,
293
296
  },
294
297
  }),
@@ -304,7 +307,7 @@ const NotificationItem = memo(({ item }) => {
304
307
  navigation.navigate(Routes.UnitStack, {
305
308
  screen: Routes.UnitSummary,
306
309
  params: {
307
- summaryId: paramsJSON.summary_id,
310
+ summaryId: summary_id,
308
311
  unitId,
309
312
  },
310
313
  }),
@@ -385,13 +388,12 @@ const NotificationItem = memo(({ item }) => {
385
388
  }
386
389
 
387
390
  case NOTIFICATION_TYPES.NOTIFY_REMOVE_UNIT:
391
+ const unitOwerName = paramsJSON?.unit_owner_name;
392
+ const textNotify = unitOwerName
393
+ ? t('text_notification_content_remove_unit_to_member')
394
+ : t('text_notification_content_remove_unit_to_owner');
388
395
  return {
389
- content: customColorText(
390
- paramsJSON?.unit_owner_name
391
- ? t('text_notification_content_remove_unit_to_member')
392
- : t('text_notification_content_remove_unit_to_owner'),
393
- arrParams
394
- ),
396
+ content: customColorText(textNotify, arrParams),
395
397
  redirect: () => null,
396
398
  iconContent: (
397
399
  <IconComponent icon={'home'} style={styles.backgroundSummer} />
@@ -472,6 +474,7 @@ const NotificationItem = memo(({ item }) => {
472
474
  ),
473
475
  };
474
476
  case NOTIFICATION_TYPES.NOTIFY_RENAME_SUB_UNIT:
477
+ const stationId = paramsJSON?.sub_unit_id;
475
478
  return {
476
479
  content: customColorText(
477
480
  t('text_notification_content_rename_sub_unit'),
@@ -482,7 +485,7 @@ const NotificationItem = memo(({ item }) => {
482
485
  screen: Routes.UnitDetail,
483
486
  params: {
484
487
  unitId,
485
- stationId: paramsJSON?.sub_unit_id,
488
+ stationId,
486
489
  },
487
490
  });
488
491
  },
@@ -13,7 +13,6 @@ import {
13
13
  unwatchNotificationData,
14
14
  } from '../../utils/Monitor';
15
15
  import { useSCContextSelector } from '../../context';
16
- import { notImplemented } from '../../utils/Utils';
17
16
 
18
17
  let page = 1;
19
18
 
@@ -27,18 +26,12 @@ const Notification = memo(() => {
27
26
  <View style={styles.rightComponent}>
28
27
  <TouchableOpacity
29
28
  style={styles.iconPlus}
30
- onPress={() => {
31
- notImplemented(t);
32
- }}
29
+ onPress={() => alert(t('feature_under_development'))}
33
30
  >
34
31
  <Icon name={'plus'} size={27} color={Colors.Black} />
35
32
  </TouchableOpacity>
36
33
 
37
- <TouchableOpacity
38
- onPress={() => {
39
- notImplemented(t);
40
- }}
41
- >
34
+ <TouchableOpacity onPress={() => alert(t('feature_under_development'))}>
42
35
  <Icon name={'search'} size={27} color={Colors.Black} />
43
36
  </TouchableOpacity>
44
37
  </View>
@@ -70,8 +70,8 @@ const Timer = ({
70
70
  }, []);
71
71
 
72
72
  useEffect(() => {
73
- const scrollListener = scrollX.addListener(({ value: timeValue }) => {
74
- !isFirstTime && onChangeValue && onChangeValue(timeValue, selected);
73
+ const scrollListener = scrollX.addListener(({ value }) => {
74
+ !isFirstTime && onChangeValue && onChangeValue(value, selected);
75
75
  });
76
76
  return () => scrollX.removeListener(scrollListener);
77
77
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -1,11 +1,7 @@
1
- import moment from 'moment';
2
1
  import React from 'react';
3
- import { Animated, TouchableOpacity } from 'react-native';
4
2
  import { act, create } from 'react-test-renderer';
5
3
  import PlayBackCamera from '..';
6
4
  import { ModalCustom } from '../../../commons/Modal';
7
- import Text from '../../../commons/Text';
8
- import { TESTID } from '../../../configs/Constants';
9
5
  import { SCProvider } from '../../../context';
10
6
  import { mockSCStore } from '../../../context/mockStore';
11
7
 
@@ -30,95 +26,14 @@ const wrapComponent = () => (
30
26
  </SCProvider>
31
27
  );
32
28
 
33
- const mockSetState = jest.fn();
34
- jest.mock('react', () => {
35
- return {
36
- ...jest.requireActual('react'),
37
- useState: jest.fn((init) => [init, mockSetState]),
38
- memo: (x) => x,
39
- };
40
- });
41
-
42
- let dateTemp = moment().format('YYYY-MM-DD');
43
-
44
29
  describe('Test PlayBackCamera', () => {
45
30
  let tree;
46
- jest.useFakeTimers();
47
-
48
31
  it('Test render', async () => {
49
- await act(async () => {
50
- tree = await create(wrapComponent());
32
+ await act(() => {
33
+ tree = create(wrapComponent());
51
34
  });
52
35
  const instance = tree.root;
53
36
  const HeaderCustoms = instance.findAllByType(ModalCustom);
54
37
  expect(HeaderCustoms).toHaveLength(2);
55
- const textOpenModal = instance.findAll(
56
- (el) => el.props.testID === TESTID.OPEN_DATE_MODAL && el.type === Text
57
- );
58
- await textOpenModal[0].props.onPress();
59
- expect(mockSetState).toBeCalledWith(true);
60
-
61
- mockSetState.mockClear();
62
- const buttonCancel = instance.findAll(
63
- (el) =>
64
- el.props.testID === TESTID.ON_PRESS_CANCEL &&
65
- el.type === TouchableOpacity
66
- );
67
- await buttonCancel[0].props.onPress();
68
- expect(mockSetState).toBeCalledWith(false);
69
- expect(mockSetState).toBeCalledWith(dateTemp);
70
-
71
- mockSetState.mockClear();
72
- const buttonOK = instance.findAll(
73
- (el) =>
74
- el.props.testID === TESTID.ON_PRESS_OK && el.type === TouchableOpacity
75
- );
76
- await buttonOK[0].props.onPress();
77
- expect(mockSetState).toBeCalledWith(false);
78
-
79
- mockSetState.mockClear();
80
- const buttonAddDate = instance.findAll(
81
- (el) =>
82
- el.props.testID === TESTID.ON_PRESS_ADD_DATE &&
83
- el.type === TouchableOpacity
84
- );
85
- await buttonAddDate[0].props.onPress();
86
- expect(mockSetState).not.toBeCalled();
87
-
88
- mockSetState.mockClear();
89
- const buttonSubDate = instance.findAll(
90
- (el) =>
91
- el.props.testID === TESTID.ON_PRESS_SUB_DATE &&
92
- el.type === TouchableOpacity
93
- );
94
- await buttonSubDate[0].props.onPress();
95
- expect(mockSetState).toBeCalledWith(
96
- moment(dateTemp).subtract(1, 'days').format('YYYY-MM-DD')
97
- );
98
-
99
- mockSetState.mockClear();
100
- const timer = instance.findAllByType(Animated.ScrollView);
101
- //NOTE: isFirstTime = true
102
- timer[0].props.onScroll({
103
- nativeEvent: {
104
- contentInset: { bottom: 10, left: 10, right: 10, top: 10 },
105
- contentOffset: { x: 10, y: 0 },
106
- contentSize: { height: 10, width: 10 },
107
- layoutMeasurement: { height: 10, width: 10 },
108
- zoomScale: 1,
109
- },
110
- });
111
- jest.runAllTimers();
112
- //NOTE: isFirstTime = false
113
- timer[0].props.onScroll({
114
- nativeEvent: {
115
- contentInset: { bottom: 10, left: 10, right: 10, top: 10 },
116
- contentOffset: { x: 60, y: 0 },
117
- contentSize: { height: 10, width: 10 },
118
- layoutMeasurement: { height: 10, width: 10 },
119
- zoomScale: 1,
120
- },
121
- });
122
- expect(mockSetState).toBeCalledWith({ h: '00', m: '37', s: 30 });
123
38
  });
124
39
  });
@@ -13,7 +13,6 @@ import Text from '../../commons/Text';
13
13
  import Timer from './Timer';
14
14
  import { useStatusBarPreview } from '../../hooks/Common/useStatusBar';
15
15
  import MediaPlayerFull from '../../commons/MediaPlayerDetail/MediaPlayerFull';
16
- import { TESTID } from '../../configs/Constants';
17
16
 
18
17
  let dateTemp = moment().format('YYYY-MM-DD');
19
18
  let isFirstTime = true;
@@ -62,7 +61,7 @@ const PlayBackCamera = () => {
62
61
  dateTemp = date;
63
62
  }, [selected]);
64
63
 
65
- const onChangeValue = (value, selectedTime) => {
64
+ const onChangeValue = (value, selected) => {
66
65
  if (!isFirstTime) {
67
66
  const currentTime =
68
67
  parseFloat(arrHourTemp[0]) +
@@ -78,11 +77,11 @@ const PlayBackCamera = () => {
78
77
  const m = t4[0] < 10 ? '0' + t4[0] : t4[0];
79
78
  const s = t5 < 10 ? '0' + t5 : t5;
80
79
  setHour({ h, m, s });
81
- if (value + 0.5 > currentTime * 96 && selectedTime === now) {
80
+ if (value + 0.5 > currentTime * 96 && selected === now) {
82
81
  setUri(item?.configuration?.uri);
83
82
  } else {
84
83
  const playback = item?.configuration?.playback || '';
85
- const date = selectedTime.split('-');
84
+ const date = selected.split('-');
86
85
  setUri(
87
86
  `${playback.split('=')[0]}=${date[0]}${date[1]}${
88
87
  date[2]
@@ -152,18 +151,12 @@ const PlayBackCamera = () => {
152
151
  <View style={styles.container}>
153
152
  <View style={styles.row}>
154
153
  <TouchableOpacity
155
- testID={TESTID.ON_PRESS_SUB_DATE}
156
154
  onPress={onSubtractDate}
157
155
  style={styles.commomButton}
158
156
  >
159
157
  <Image source={Images.arrowLeft} />
160
158
  </TouchableOpacity>
161
- <Text
162
- testID={TESTID.OPEN_DATE_MODAL}
163
- onPress={onOpenDateModal}
164
- style={styles.textDate}
165
- type="h4"
166
- >
159
+ <Text onPress={onOpenDateModal} style={styles.textDate} type="h4">
167
160
  {moment(selected).format('DD/MM/YYYY')}
168
161
  </Text>
169
162
  <TouchableOpacity
@@ -172,11 +165,7 @@ const PlayBackCamera = () => {
172
165
  >
173
166
  <Image source={Images.file} style={styles.iconDate} />
174
167
  </TouchableOpacity>
175
- <TouchableOpacity
176
- testID={TESTID.ON_PRESS_ADD_DATE}
177
- onPress={onAddDate}
178
- style={styles.commomButton}
179
- >
168
+ <TouchableOpacity onPress={onAddDate} style={styles.commomButton}>
180
169
  <Image source={Images.arrowLeft} style={styles.arrowRight} />
181
170
  </TouchableOpacity>
182
171
  </View>
@@ -242,17 +231,12 @@ const PlayBackCamera = () => {
242
231
  <TouchableOpacity
243
232
  onPress={onPressCancel}
244
233
  style={styles.commomButton}
245
- testID={TESTID.ON_PRESS_CANCEL}
246
234
  >
247
235
  <Text type="h4" semibold hilight>
248
236
  {t('cancel')}
249
237
  </Text>
250
238
  </TouchableOpacity>
251
- <TouchableOpacity
252
- testID={TESTID.ON_PRESS_OK}
253
- onPress={onPressOk}
254
- style={styles.commomButton}
255
- >
239
+ <TouchableOpacity onPress={onPressOk} style={styles.commomButton}>
256
240
  <Text type="h4" semibold hilight>
257
241
  {t('done')}
258
242
  </Text>