@eohjsc/react-native-smart-city 0.7.3-rc2 → 0.7.3-rc20

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 (239) hide show
  1. package/package.json +17 -15
  2. package/src/commons/Action/__test__/ItemQuickAction.test.js +6 -6
  3. package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +3 -3
  4. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +3 -3
  5. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +5 -5
  6. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +3 -3
  7. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
  8. package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +2 -2
  9. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +2 -2
  10. package/src/commons/ActionGroup/SliderRangeTemplate.js +7 -7
  11. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +2 -2
  12. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +5 -5
  13. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +5 -5
  14. package/src/commons/ActionGroup/TerminalBoxTemplate.js +2 -2
  15. package/src/commons/ActionGroup/TextBoxTemplate.js +2 -2
  16. package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonCircle.test.js +2 -2
  17. package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonDefault.test.js +2 -2
  18. package/src/commons/ActionGroup/TimerActionTemplate.js +6 -3
  19. package/src/commons/ActionGroup/TwoButtonTemplate/index.js +2 -2
  20. package/src/commons/ActionGroup/__test__/ColorPickerTemplate.test.js +9 -10
  21. package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +5 -5
  22. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +5 -5
  23. package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +8 -8
  24. package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +3 -3
  25. package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +6 -6
  26. package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +1 -1
  27. package/src/commons/ActionGroup/__test__/index.test.js +6 -6
  28. package/src/commons/ActionTemplate/__test__/index.test.js +4 -4
  29. package/src/commons/Automate/ItemAutomate.js +8 -7
  30. package/src/commons/Automate/__test__/ItemAutomate.test.js +2 -2
  31. package/src/commons/BackDefault/index.js +2 -2
  32. package/src/commons/ButtonPopup/index.js +2 -2
  33. package/src/commons/ChartAggregationOption/__test__/FourButtonFilterHistory.test.js +2 -2
  34. package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +8 -9
  35. package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +7 -7
  36. package/src/commons/DateTimeRangeChange/DateTimeButton.js +3 -3
  37. package/src/commons/Device/ConnectedViewHeader.js +2 -2
  38. package/src/commons/Device/Emergency/EmergencyDetail.js +3 -3
  39. package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +1 -1
  40. package/src/commons/Device/FlatListItems.js +20 -19
  41. package/src/commons/Device/Hanet/ItemHanetDevice.js +3 -3
  42. package/src/commons/Device/Hanet/ItemHanetDevice.test.js +3 -3
  43. package/src/commons/Device/HorizontalBarChart.js +54 -34
  44. package/src/commons/Device/ItemAddNew/index.js +2 -2
  45. package/src/commons/Device/ItemDevice.js +2 -2
  46. package/src/commons/Device/SonosSpeaker/index.js +3 -3
  47. package/src/commons/Device/WaterPurifierStatus/AlertStatusMachine.js +2 -2
  48. package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +6 -2
  49. package/src/commons/DisplayChecking/index.js +2 -2
  50. package/src/commons/EmergencyButton/AlertSendConfirm.js +2 -2
  51. package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
  52. package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +3 -3
  53. package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +6 -6
  54. package/src/commons/FlatListDnD/__test__/index.test.js +4 -4
  55. package/src/commons/FlatListDnD/index.js +12 -9
  56. package/src/commons/Grid/GridItem.js +10 -2
  57. package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +3 -3
  58. package/src/commons/Header/HeaderCustom.js +2 -2
  59. package/src/commons/Header/__test__/HeaderCT.test.js +3 -3
  60. package/src/commons/HeaderAni/index.js +2 -2
  61. package/src/commons/IconComponent/index.js +3 -3
  62. package/src/commons/ImagePicker/__test__/ImagePicker.test.js +5 -5
  63. package/src/commons/MediaPlayerDetail/__test__/MediaPlayerDetail.test.js +6 -4
  64. package/src/commons/NavBar/index.js +2 -2
  65. package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +3 -3
  66. package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +1 -1
  67. package/src/commons/Popover/__test__/index.test.js +3 -3
  68. package/src/commons/Processing/__test__/Connecting.test.js +4 -4
  69. package/src/commons/SearchLocation/index.js +3 -3
  70. package/src/commons/SelectActionCard/index.js +2 -2
  71. package/src/commons/SelectSubUnit/index.js +6 -2
  72. package/src/commons/SelectUnit/__test__/SelectUnit.test.js +5 -5
  73. package/src/commons/Sharing/BtnRemoveMember.js +2 -2
  74. package/src/commons/Sharing/StationDevicePermissions.js +2 -2
  75. package/src/commons/SubUnit/DeviceTemplate/ConfigAndEvaluation/ConfigAndEvaluation.js +2 -2
  76. package/src/commons/SubUnit/DeviceTemplate/ConfigValue/ConfigValue.js +2 -2
  77. package/src/commons/SubUnit/DeviceTemplate/EvaluationOverConfig/EvaluationOverConfig.js +2 -2
  78. package/src/commons/SubUnit/OneTap/ItemOneTap.js +3 -4
  79. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +0 -2
  80. package/src/commons/SubUnit/OneTap/index.js +9 -8
  81. package/src/commons/SubUnit/__test__/ShortDetail.test.js +8 -8
  82. package/src/commons/Unit/HeaderUnit/index.js +3 -3
  83. package/src/commons/Unit/SharedUnit.js +7 -7
  84. package/src/commons/Widgets/IFrame/__tests__/IFrame.test.js +9 -13
  85. package/src/configs/Theme.js +1 -1
  86. package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +5 -5
  87. package/src/hooks/IoT/__test__/useHomeAssistantConnection.test.js +12 -12
  88. package/src/hooks/IoT/__test__/useWatchConfigs.test.js +3 -3
  89. package/src/hooks/IoT/useRemoteControl.js +6 -6
  90. package/src/hooks/useMqtt.js +2 -2
  91. package/src/iot/RemoteControl/Internet.js +2 -2
  92. package/src/iot/RemoteControl/__test__/Internet.test.js +7 -7
  93. package/src/navigations/EmergencyContactsStack.js +4 -3
  94. package/src/navigations/SharedStack.js +2 -0
  95. package/src/navigations/UnitStack.js +55 -54
  96. package/src/screens/AQIGuide/index.js +0 -2
  97. package/src/screens/ActivityLog/index.js +2 -2
  98. package/src/screens/AddLocationMaps/__test__/index.test.js +12 -12
  99. package/src/screens/AddLocationMaps/index.js +15 -15
  100. package/src/screens/AddNewGateway/RenameNewDevices.js +2 -2
  101. package/src/screens/AddNewGateway/SelectDeviceType.js +1 -1
  102. package/src/screens/AddNewGateway/ShareWifiPassword.js +16 -15
  103. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +7 -7
  104. package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +8 -8
  105. package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +7 -7
  106. package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +8 -8
  107. package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +5 -5
  108. package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +4 -4
  109. package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +6 -6
  110. package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +6 -6
  111. package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +0 -4
  112. package/src/screens/AddNewGateway/hooks/__Tests__/useWifiManage.test.js +2 -2
  113. package/src/screens/AllGateway/DetailConfigActionModbus/__test__/index.test.js +6 -6
  114. package/src/screens/AllGateway/DeviceInternalDetail/__test__/index.test.js +19 -17
  115. package/src/screens/AllGateway/DeviceModbusDetail/__test__/index.test.js +19 -17
  116. package/src/screens/AllGateway/DeviceZigbeeDetail/__test__/index.test.js +18 -16
  117. package/src/screens/AllGateway/GatewayDetail/__test__/index.test.js +43 -35
  118. package/src/screens/AllGateway/GatewayInfo/__test__/index.test.js +13 -13
  119. package/src/screens/AllGateway/__test__/index.test.js +6 -6
  120. package/src/screens/AllGateway/components/Detail/__test__/index.test.js +3 -5
  121. package/src/screens/AllGateway/components/GatewayItem/__test__/index.test.js +3 -3
  122. package/src/screens/AllGateway/components/TabPaneCT/__test__/index.test.js +6 -6
  123. package/src/screens/AllGateway/hooks/__test__/index.test.js +2 -2
  124. package/src/screens/AllGateway/test-utils.js +3 -4
  125. package/src/screens/Automate/AddNewAction/ChooseAction.js +17 -3
  126. package/src/screens/Automate/AddNewAction/ChooseConfig.js +7 -6
  127. package/src/screens/Automate/AddNewAction/NewActionWrapper.js +8 -8
  128. package/src/screens/Automate/AddNewAction/SelectControlDevices.js +30 -20
  129. package/src/screens/Automate/AddNewAction/SelectMonitorDevices.js +17 -10
  130. package/src/screens/Automate/AddNewAction/SetupConfigCondition.js +42 -34
  131. package/src/screens/Automate/AddNewAction/SetupScriptDelay.js +1 -1
  132. package/src/screens/Automate/AddNewAction/SetupScriptNotify.js +3 -3
  133. package/src/screens/Automate/AddNewAction/Styles/SetupSensorStyles.js +20 -4
  134. package/src/screens/Automate/AddNewAction/__test__/ChooseAction.test.js +12 -12
  135. package/src/screens/Automate/AddNewAction/__test__/SelectControlDevices.test.js +14 -8
  136. package/src/screens/Automate/AddNewAction/__test__/SelectMonitorDevices.test.js +13 -7
  137. package/src/screens/Automate/AddNewAction/__test__/SetupConfigCondition.test.js +12 -11
  138. package/src/screens/Automate/AddNewAction/__test__/SetupScriptDelay.test.js +9 -9
  139. package/src/screens/Automate/AddNewAction/__test__/SetupScriptNotify.test.js +39 -10
  140. package/src/screens/Automate/AddNewAutoSmart/AddTypeSmart.js +10 -9
  141. package/src/screens/Automate/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +13 -8
  142. package/src/screens/Automate/Components/InputName.js +10 -7
  143. package/src/screens/Automate/EditActionsList/__tests__/UpdateActionScript.test.js +8 -8
  144. package/src/screens/Automate/EditActionsList/__tests__/UpdateDelayScript.test.js +6 -6
  145. package/src/screens/Automate/EditActionsList/__tests__/UpdateNotifyScript.test.js +7 -7
  146. package/src/screens/Automate/EditActionsList/index.js +19 -17
  147. package/src/screens/Automate/MultiUnits.js +19 -22
  148. package/src/screens/Automate/OneTap/__test__/AddNewOneTap.test.js +18 -8
  149. package/src/screens/Automate/Scenario/__test__/AddNewOneTap.test.js +15 -7
  150. package/src/screens/Automate/ScriptDetail/Components/AddActionScript.js +14 -6
  151. package/src/screens/Automate/ScriptDetail/Components/RenameScript.js +4 -7
  152. package/src/screens/Automate/ScriptDetail/__test__/index.test.js +3 -1
  153. package/src/screens/Automate/ScriptDetail/__test__/useStarredScript.test.js +6 -6
  154. package/src/screens/Automate/ScriptDetail/index.js +48 -38
  155. package/src/screens/Automate/SetSchedule/__test__/SelectWeekday.test.js +4 -4
  156. package/src/screens/Automate/SetSchedule/__test__/index.test.js +29 -18
  157. package/src/screens/Automate/SetSchedule/components/RowItem.js +5 -5
  158. package/src/screens/Automate/SetSchedule/index.js +8 -7
  159. package/src/screens/Automate/Styles/indexStyles.js +1 -1
  160. package/src/screens/Automate/__test__/MultiUnits.test.js +1 -4
  161. package/src/screens/Automate/__test__/index.test.js +0 -1
  162. package/src/screens/Automate/index.js +36 -34
  163. package/src/screens/ChangePosition/__test__/index.test.js +6 -6
  164. package/src/screens/ChangePosition/index.js +2 -1
  165. package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +9 -9
  166. package/src/screens/Device/EditDevice/index.js +2 -2
  167. package/src/screens/Device/__test__/detail.test.js +14 -14
  168. package/src/screens/Device/__test__/mqttDetail.test.js +9 -9
  169. package/src/screens/Device/components/SensorDisplayItem.js +5 -5
  170. package/src/screens/Device/detail.js +7 -7
  171. package/src/screens/Device/hooks/useEvaluateValue.js +1 -1
  172. package/src/screens/Drawer/Drawer.test.js +2 -2
  173. package/src/screens/Drawer/index.js +3 -3
  174. package/src/screens/EmergencyContacts/EmergencyContactsList.js +8 -4
  175. package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +3 -3
  176. package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +7 -7
  177. package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
  178. package/src/screens/EnterPassword/__test__/EnterPassword.test.js +8 -8
  179. package/src/screens/GuestInfo/components/RowGuestInfo.js +2 -2
  180. package/src/screens/GuestInfo/components/__test__/AccessScheduleSheet.test.js +3 -3
  181. package/src/screens/GuestInfo/index.js +2 -2
  182. package/src/screens/HanetCamera/ManageAccess.js +3 -3
  183. package/src/screens/HanetCamera/MemberInfo.js +2 -2
  184. package/src/screens/HanetCamera/__test__/Detail.test.js +9 -9
  185. package/src/screens/HanetCamera/__test__/MemberInfo.test.js +10 -10
  186. package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
  187. package/src/screens/ManageAccess/index.js +3 -3
  188. package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +9 -9
  189. package/src/screens/Notification/__test__/Notification.test.js +9 -9
  190. package/src/screens/Notification/components/NotificationItem.js +3 -4
  191. package/src/screens/Notification/index.js +3 -3
  192. package/src/screens/Notification/styles/NotificationItemStyles.js +0 -1
  193. package/src/screens/PlayBackCamera/__test__/index.test.js +1 -1
  194. package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +1 -1
  195. package/src/screens/ScanChipQR/components/QRScan/index.js +3 -3
  196. package/src/screens/SelectUnit/__test__/index.test.js +8 -8
  197. package/src/screens/SelectUnit/index.js +4 -4
  198. package/src/screens/SharedUnit/TabHeader.js +2 -2
  199. package/src/screens/Sharing/Components/EndDevice.js +3 -3
  200. package/src/screens/Sharing/UnitMemberList.js +2 -2
  201. package/src/screens/Sharing/__test__/UpdateShareDevice.test.js +7 -7
  202. package/src/screens/SideMenuDetail/__test__/index.test.js +8 -8
  203. package/src/screens/SmartAccount/Connecting/index.js +5 -5
  204. package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +8 -8
  205. package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +7 -7
  206. package/src/screens/SmartAccount/SuccessfullyConnected/index.js +2 -2
  207. package/src/screens/SmartAccount/__test__/Connecting.test.js +6 -6
  208. package/src/screens/SmartAccount/__test__/SmartAccount.test.js +10 -10
  209. package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +3 -2
  210. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +2 -2
  211. package/src/screens/SmartIr/components/SelectBrand.js +2 -2
  212. package/src/screens/SubUnit/AddSubUnit.js +2 -4
  213. package/src/screens/SubUnit/EditSubUnit.js +2 -2
  214. package/src/screens/SubUnit/ManageSubUnit.js +3 -3
  215. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +9 -11
  216. package/src/screens/Template/EditTemplate.js +6 -4
  217. package/src/screens/Template/__test__/EditTemplate.test.js +7 -7
  218. package/src/screens/Template/__test__/detail.test.js +4 -4
  219. package/src/screens/Template/__test__/index.test.js +1 -1
  220. package/src/screens/UVIndexGuide/index.js +2 -4
  221. package/src/screens/Unit/SelectAddToFavorites.js +2 -2
  222. package/src/screens/Unit/SelectAddress.js +16 -12
  223. package/src/screens/Unit/Station/__test__/index.test.js +1 -1
  224. package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +9 -9
  225. package/src/screens/Unit/__test__/SelectAddress.test.js +11 -17
  226. package/src/screens/Unit/__test__/Summaries.test.js +7 -7
  227. package/src/screens/Unit/components/AutomateScript/index.js +2 -2
  228. package/src/screens/Unit/components/ButtonWrapper/index.js +3 -3
  229. package/src/screens/Unit/components/Header/index.js +2 -2
  230. package/src/screens/Unit/components/SharedUnit/index.js +5 -5
  231. package/src/screens/Unit/components/__test__/AutomateScript.test.js +3 -3
  232. package/src/screens/Unit/components/__test__/SharedUnit.test.js +8 -8
  233. package/src/screens/Unit/hook/__test__/useUnitConnectRemoteDevices.test.js +2 -2
  234. package/src/screens/UnitSummary/components/AirQuality/index.js +6 -11
  235. package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +6 -6
  236. package/src/screens/UnitSummary/index.js +3 -3
  237. package/src/utils/I18n/translations/en.js +3 -1
  238. package/src/utils/I18n/translations/vi.js +5 -2
  239. package/src/utils/__test__/Utils.test.js +16 -16
@@ -1,3 +1,9 @@
1
+ import { IconFill } from '@ant-design/icons-react-native';
2
+ import {
3
+ useIsFocused,
4
+ useNavigation,
5
+ useRoute,
6
+ } from '@react-navigation/native';
1
7
  import React, {
2
8
  useCallback,
3
9
  useEffect,
@@ -6,27 +12,21 @@ import React, {
6
12
  useState,
7
13
  } from 'react';
8
14
  import { FlatList, Image, TouchableOpacity, View } from 'react-native';
9
- import AntDesign from 'react-native-vector-icons/AntDesign';
10
- import {
11
- useIsFocused,
12
- useNavigation,
13
- useRoute,
14
- } from '@react-navigation/native';
15
15
  import { useSCContextSelector } from '../../context';
16
16
 
17
- import styles from './Styles/indexStyles';
17
+ import ItemAddNew from '../../commons/Device/ItemAddNew';
18
+ import ItemOneTap from '../../commons/SubUnit/OneTap/ItemOneTap';
19
+ import Text from '../../commons/Text';
18
20
  import { API, Colors, Images } from '../../configs';
21
+ import { AccessibilityLabel, UNIT_TYPES } from '../../configs/Constants';
22
+ import { useGetIdUser } from '../../hooks/Common';
23
+ import { useTranslations } from '../../hooks/Common/useTranslations';
19
24
  import { axiosGet } from '../../utils/Apis/axios';
20
- import Text from '../../commons/Text';
21
- import ItemOneTap from '../../commons/SubUnit/OneTap/ItemOneTap';
25
+ import { useBackendPermission } from '../../utils/Permission/backend';
22
26
  import Routes from '../../utils/Route';
23
- import Loading from './Components/Loading';
24
- import ItemAddNew from '../../commons/Device/ItemAddNew';
25
- import { useTranslations } from '../../hooks/Common/useTranslations';
26
- import { useGetIdUser } from '../../hooks/Common';
27
- import { AccessibilityLabel, UNIT_TYPES } from '../../configs/Constants';
28
27
  import { keyExtractor, ToastBottomHelper } from '../../utils/Utils';
29
- import { useBackendPermission } from '../../utils/Permission/backend';
28
+ import Loading from './Components/Loading';
29
+ import styles from './Styles/indexStyles';
30
30
 
31
31
  const Automate = () => {
32
32
  const t = useTranslations();
@@ -75,7 +75,6 @@ const Automate = () => {
75
75
  navigate(Routes.UnitStack, {
76
76
  screen: Routes.ScriptDetail,
77
77
  params: {
78
- id: item?.id,
79
78
  closeScreen: currentRouteName,
80
79
  preAutomate: item, // pre-loaded automate data
81
80
  },
@@ -164,29 +163,32 @@ const Automate = () => {
164
163
  <Image source={Images.arrowBack} style={styles.arrowRight} />
165
164
  </TouchableOpacity>
166
165
  </View>
167
- {!!automates?.length && (
168
- <View style={styles.automatesRow}>
169
- <ItemOneTap
170
- isOwner={isOwner}
171
- automate={automates[0]}
172
- wrapSyles={styles.wrapAutomateItem}
173
- onPressItem={() =>
174
- onPressItem(automates[0], unit_id, type, isOwner)
175
- }
176
- />
177
- {!!automates[1] && (
166
+ <View style={styles.automatesRow}>
167
+ {!!automates?.length && (
168
+ <>
178
169
  <ItemOneTap
179
170
  isOwner={isOwner}
180
- automate={automates[1]}
171
+ automate={automates[0]}
181
172
  wrapSyles={styles.wrapAutomateItem}
182
173
  onPressItem={() =>
183
- onPressItem(automates[1], unit_id, type, isOwner)
174
+ onPressItem(automates[0], unit_id, type, isOwner)
184
175
  }
185
176
  />
186
- )}
187
- </View>
188
- )}
189
- {!automates?.length && renderListFooterComponent(unit_id, automates)}
177
+ {!!automates[1] && (
178
+ <ItemOneTap
179
+ isOwner={isOwner}
180
+ automate={automates[1]}
181
+ wrapSyles={styles.wrapAutomateItem}
182
+ onPressItem={() =>
183
+ onPressItem(automates[1], unit_id, type, isOwner)
184
+ }
185
+ />
186
+ )}
187
+ </>
188
+ )}
189
+ {(!automates?.length || automates.length === 1) &&
190
+ renderListFooterComponent(unit_id, automates)}
191
+ </View>
190
192
  </View>
191
193
  );
192
194
  },
@@ -210,7 +212,7 @@ const Automate = () => {
210
212
  /* istanbul ignore next */
211
213
  headerRight: () => (
212
214
  <TouchableOpacity style={styles.buttonAdd}>
213
- <AntDesign name={'pluscircle'} size={28} color={Colors.Orange} />
215
+ <IconFill name={'plus-circle'} size={28} color={Colors.Orange} />
214
216
  </TouchableOpacity>
215
217
  ),
216
218
  });
@@ -1,16 +1,16 @@
1
- import React from 'react';
2
- import { act, create } from 'react-test-renderer';
3
- import MockAdapter from 'axios-mock-adapter';
4
1
  import { useRoute } from '@react-navigation/native';
2
+ import MockAdapter from 'axios-mock-adapter';
3
+ import React from 'react';
5
4
  import DraggableFlatList from 'react-native-draggable-flatlist';
5
+ import { act, create } from 'react-test-renderer';
6
6
 
7
7
  import ChangePosition from '../';
8
+ import BottomButtonView from '../../../commons/BottomButtonView';
9
+ import { API } from '../../../configs';
8
10
  import { SCProvider } from '../../../context';
9
11
  import { mockSCStore } from '../../../context/mockStore';
10
12
  import api from '../../../utils/Apis/axios';
11
- import { API } from '../../../configs';
12
13
  import { ToastBottomHelper } from '../../../utils/Utils';
13
- import BottomButtonView from '../../../commons/BottomButtonView';
14
14
 
15
15
  const mock = new MockAdapter(api.axiosInstance);
16
16
  const mockSetDisplay = jest.fn();
@@ -60,6 +60,6 @@ describe('Test ChangePosition', () => {
60
60
  expect(global.mockedGoBack).toHaveBeenCalled();
61
61
  expect(mockFetchData).toHaveBeenCalled();
62
62
  expect(mockSetDisplay).toHaveBeenCalled();
63
- expect(spyToastSuccess).toBeCalledWith('Updated widget successfully');
63
+ expect(spyToastSuccess).toHaveBeenCalledWith('Updated widget successfully');
64
64
  });
65
65
  });
@@ -49,7 +49,8 @@ const ChangePosition = () => {
49
49
  }
50
50
  };
51
51
 
52
- const renderItem = ({ item, index, drag, isActive }) => {
52
+ const renderItem = ({ item, getIndex, drag, isActive }) => {
53
+ const index = getIndex();
53
54
  return (
54
55
  <View style={styles.widgetItem}>
55
56
  <View style={[styles.itemOrder, isActive ? styles.isDragging : {}]}>
@@ -1,18 +1,18 @@
1
+ import MockAdapter from 'axios-mock-adapter';
1
2
  import React from 'react';
2
3
  import { TouchableOpacity } from 'react-native';
3
- import { create, act } from 'react-test-renderer';
4
- import MockAdapter from 'axios-mock-adapter';
4
+ import { act, create } from 'react-test-renderer';
5
5
 
6
- import { SCProvider } from '../../../../context';
7
- import { mockSCStore } from '../../../../context/mockStore';
6
+ import { useRoute } from '@react-navigation/native';
7
+ import Toast from 'react-native-toast-message';
8
8
  import EditDevice from '..';
9
9
  import AlertAction from '../../../../commons/AlertAction';
10
10
  import _TextInput from '../../../../commons/Form/TextInput';
11
- import { AccessibilityLabel } from '../../../../configs/Constants';
12
11
  import { API } from '../../../../configs';
13
- import { useRoute } from '@react-navigation/native';
12
+ import { AccessibilityLabel } from '../../../../configs/Constants';
13
+ import { SCProvider } from '../../../../context';
14
+ import { mockSCStore } from '../../../../context/mockStore';
14
15
  import api from '../../../../utils/Apis/axios';
15
- import Toast from 'react-native-toast-message';
16
16
  import { getTranslate } from '../../../../utils/I18n';
17
17
 
18
18
  const wrapComponent = (route) => (
@@ -96,7 +96,7 @@ describe('Test EditDevice', () => {
96
96
  await act(async () => {
97
97
  await alertAction.props.rightButtonClick();
98
98
  });
99
- expect(Toast.show).toBeCalledWith({
99
+ expect(Toast.show).toHaveBeenCalledWith({
100
100
  type: 'error',
101
101
  position: 'bottom',
102
102
  text1: getTranslate('en', 'rename_failed'),
@@ -148,7 +148,7 @@ describe('Test EditDevice', () => {
148
148
  await act(async () => {
149
149
  await alertAction.props.rightButtonClick();
150
150
  });
151
- expect(Toast.show).toBeCalledWith({
151
+ expect(Toast.show).toHaveBeenCalledWith({
152
152
  type: 'error',
153
153
  position: 'bottom',
154
154
  text1: getTranslate('en', 'remove_failed'),
@@ -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 AntDesign from 'react-native-vector-icons/AntDesign';
5
+ import { IconOutline } from '@ant-design/icons-react-native';
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
- <AntDesign
95
+ <IconOutline
96
96
  name="right"
97
97
  size={18}
98
98
  color={Colors.Gray7}
@@ -1,24 +1,23 @@
1
+ import { NavigationContext, useNavigation } from '@react-navigation/native';
2
+ import MockAdapter from 'axios-mock-adapter';
1
3
  import React from 'react';
2
4
  import { Alert, ScrollView } from 'react-native';
3
5
  import { act, create } from 'react-test-renderer';
4
- import MockAdapter from 'axios-mock-adapter';
5
- import { NavigationContext, useNavigation } from '@react-navigation/native';
6
-
7
- import DeviceDetail from '../detail';
8
- import { API } from '../../../configs';
6
+ import { AlertAction, ButtonPopup, MenuActionMore } from '../../../commons';
7
+ import CurrentRainSensor from '../../../commons/Device/RainningSensor/CurrentRainSensor';
9
8
  import { AlertSendConfirm } from '../../../commons/EmergencyButton/AlertSendConfirm';
10
9
  import { AlertSent } from '../../../commons/EmergencyButton/AlertSent';
11
- import { AlertAction, ButtonPopup, MenuActionMore } from '../../../commons';
12
- import { AccessibilityLabel } from '../../../configs/Constants';
13
10
  import Text from '../../../commons/Text';
14
- import AntDesign from 'react-native-vector-icons/AntDesign';
15
- import CurrentRainSensor from '../../../commons/Device/RainningSensor/CurrentRainSensor';
16
- import { getTranslate } from '../../../utils/I18n';
11
+ import { API } from '../../../configs';
12
+ import { AccessibilityLabel } from '../../../configs/Constants';
17
13
  import { SCProvider } from '../../../context';
18
14
  import { mockSCStore } from '../../../context/mockStore';
19
- import Routes from '../../../utils/Route';
20
- import api from '../../../utils/Apis/axios';
21
15
  import { useWatchConfigs } from '../../../hooks/IoT';
16
+ import api from '../../../utils/Apis/axios';
17
+ import { getTranslate } from '../../../utils/I18n';
18
+ import Routes from '../../../utils/Route';
19
+ import DeviceDetail from '../detail';
20
+ import { IconOutline } from '@ant-design/icons-react-native';
22
21
 
23
22
  const mock = new MockAdapter(api.axiosInstance);
24
23
 
@@ -352,7 +351,8 @@ describe('test DeviceDetail', () => {
352
351
  const buttonPopupIcon = instance.find(
353
352
  (el) =>
354
353
  el.props.accessibilityLabel ===
355
- AccessibilityLabel.BUTTON_POPUP_RESOLVED_ICON && el.type === AntDesign
354
+ AccessibilityLabel.BUTTON_POPUP_RESOLVED_ICON &&
355
+ el.type === IconOutline
356
356
  );
357
357
  expect(buttonPopupTitle.props.children).toEqual([
358
358
  'Unit name',
@@ -755,7 +755,7 @@ describe('test DeviceDetail', () => {
755
755
  await act(async () => {
756
756
  await create(wrapComponent(store, account, route));
757
757
  });
758
- expect(mockAlertShow).not.toBeCalled();
758
+ expect(mockAlertShow).not.toHaveBeenCalled();
759
759
  });
760
760
 
761
761
  it('Test fetchUnitDetail', async () => {
@@ -1,22 +1,22 @@
1
+ import { NavigationContext } from '@react-navigation/native';
2
+ import MockAdapter from 'axios-mock-adapter';
3
+ import mqtt from 'precompiled-mqtt/dist/mqtt.browser';
1
4
  import React from 'react';
2
5
  import { Alert } from 'react-native';
3
6
  import { act, create } from 'react-test-renderer';
4
- import MockAdapter from 'axios-mock-adapter';
5
- import mqtt from 'precompiled-mqtt/dist/mqtt.browser';
6
- import { NavigationContext } from '@react-navigation/native';
7
7
 
8
- import DeviceDetail from '../detail';
8
+ import QualityIndicatorItem from '../../../commons/Device/WaterQualitySensor/QualityIndicatorsItem';
9
9
  import { API } from '../../../configs';
10
10
  import { SCProvider } from '../../../context';
11
11
  import { mockSCStore } from '../../../context/mockStore';
12
+ import { watchMultiConfigs } from '../../../iot/Monitor';
13
+ import { setConfigGlobalState } from '../../../iot/states';
12
14
  import api from '../../../utils/Apis/axios';
13
15
  import {
14
- gatewayDataFactory,
15
16
  configDataFactory,
17
+ gatewayDataFactory,
16
18
  } from '../../../utils/FactoryGateway';
17
- import QualityIndicatorItem from '../../../commons/Device/WaterQualitySensor/QualityIndicatorsItem';
18
- import { watchMultiConfigs } from '../../../iot/Monitor';
19
- import { setConfigGlobalState } from '../../../iot/states';
19
+ import DeviceDetail from '../detail';
20
20
 
21
21
  const mock = new MockAdapter(api.axiosInstance);
22
22
 
@@ -194,7 +194,7 @@ describe('test DeviceDetail', () => {
194
194
  await act(async () => {
195
195
  tree.unmount();
196
196
  });
197
- expect(client.end).toBeCalled();
197
+ expect(client.end).toHaveBeenCalled();
198
198
  });
199
199
 
200
200
  const _receiveDataOnDeviceDetail = async (widgetConfigs, topic, message) => {
@@ -13,19 +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 IFrame from '../../../commons/Widgets/IFrame/IFrame';
17
+ import IFrameWithConfig from '../../../commons/Widgets/IFrameWithConfig/IFrameWithConfig';
18
+ import { Device } from '../../../configs';
16
19
  import { AccessibilityLabel, WIDGET_TYPE } from '../../../configs/Constants';
17
20
  import { useSCContextSelector } from '../../../context';
18
21
  import { useRemoteControl } from '../../../hooks/IoT';
19
22
  import { useConfigGlobalState } from '../../../iot/states';
20
23
  import SmartIr from '../../../screens/SmartIr';
24
+ import { standardizeCameraScreenSize } from '../../../utils/Utils';
21
25
  import { useEvaluateValue } from '../hooks/useEvaluateValue';
22
26
  import styles from '../styles';
23
- import VisualChart from './VisualChart';
24
- import { standardizeCameraScreenSize } from '../../../utils/Utils';
25
- import { Device } from '../../../configs';
26
27
  import DonutCharts from './DonutChart';
27
- import IFrame from '../../../commons/Widgets/IFrame/IFrame';
28
- import IFrameWithConfig from '../../../commons/Widgets/IFrameWithConfig/IFrameWithConfig';
28
+ import VisualChart from './VisualChart';
29
29
 
30
30
  const { standardizeWidth, standardizeHeight } = standardizeCameraScreenSize(
31
31
  Device.screenWidth - 32
@@ -8,7 +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 AntDesign from 'react-native-vector-icons/AntDesign';
11
+ import { IconFill, IconOutline } from '@ant-design/icons-react-native';
12
12
  import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
13
13
  import moment from 'moment';
14
14
 
@@ -685,9 +685,9 @@ const DeviceDetail = ({ route }) => {
685
685
  >
686
686
  <View style={styles.buttonStar}>
687
687
  {isFavorite ? (
688
- <AntDesign name="star" size={25} color={Colors.Yellow6} />
688
+ <IconFill name="star" size={25} color={Colors.Yellow6} />
689
689
  ) : (
690
- <AntDesign name="staro" size={25} />
690
+ <IconOutline name="star" size={25} />
691
691
  )}
692
692
  </View>
693
693
  </TouchableOpacity>
@@ -695,7 +695,7 @@ const DeviceDetail = ({ route }) => {
695
695
  {isShowSetupEmergencyContact && (
696
696
  <TouchableOpacity onPress={onPressSetting}>
697
697
  <View style={styles.button}>
698
- <AntDesign name="setting" size={25} color={Colors.Black} />
698
+ <IconOutline name="setting" size={25} color={Colors.Black} />
699
699
  </View>
700
700
  </TouchableOpacity>
701
701
  )}
@@ -792,7 +792,7 @@ const DeviceDetail = ({ route }) => {
792
792
  <BottomButtonView
793
793
  style={styles.bottomButtonEmergencyContact}
794
794
  mainIcon={
795
- <AntDesign name="plus" size={16} color={Colors.Primary} />
795
+ <IconOutline name="plus" size={16} color={Colors.Primary} />
796
796
  }
797
797
  mainTitle={t('setup_my_emergency_contact')}
798
798
  onPressMain={onSetupContacts}
@@ -827,7 +827,7 @@ const DeviceDetail = ({ route }) => {
827
827
  {isShowEmergencyResolve && !isEmergencyPopupScreen && (
828
828
  <BottomButtonView
829
829
  style={styles.bottomButtonEmergencyResolve}
830
- mainIcon={<AntDesign name="tool" size={15} color={Colors.Gray6} />}
830
+ mainIcon={<IconOutline name="tool" size={15} color={Colors.Gray6} />}
831
831
  mainTitle={t('resolve_situation')}
832
832
  onPressMain={onPressResolveSituationConfirm}
833
833
  topComponent={
@@ -867,7 +867,7 @@ const DeviceDetail = ({ route }) => {
867
867
  >
868
868
  {unit?.name} - {sensor?.station?.name}
869
869
  </Text>
870
- <AntDesign
870
+ <IconOutline
871
871
  accessibilityLabel={AccessibilityLabel.BUTTON_POPUP_RESOLVED_ICON}
872
872
  name="check-circle"
873
873
  size={42}
@@ -129,7 +129,7 @@ export const useGetEvaluateValue = (configId, unitId) => {
129
129
  if (configId && valueEvaluations[configId] === undefined) {
130
130
  (async () => {
131
131
  const { success, data } = await axiosGet(API.VALUE_EVALUATIONS(), {
132
- configs__id: configId,
132
+ params: { configs__id: configId },
133
133
  });
134
134
  if (success) {
135
135
  setAction(Action.INIT_VALUE_EVALUATIONS, {
@@ -1,10 +1,10 @@
1
+ import { useNavigation } from '@react-navigation/native';
1
2
  import React from 'react';
2
3
  import renderer, { act } from 'react-test-renderer';
3
4
  import AccessibilityLabel from '../../configs/AccessibilityLabel';
4
5
  import { SCProvider } from '../../context';
5
6
  import { mockSCStore } from '../../context/mockStore';
6
7
  import Drawer, { Row } from './index';
7
- import { useNavigation } from '@react-navigation/native';
8
8
 
9
9
  const wrapComponent = (initState = mockSCStore({})) => (
10
10
  <SCProvider initState={initState}>
@@ -35,7 +35,7 @@ describe('Drawer', () => {
35
35
  await act(async () => {
36
36
  await rows[2].props.onPress();
37
37
  });
38
- expect(dispatch).toBeCalledWith({
38
+ expect(dispatch).toHaveBeenCalledWith({
39
39
  payload: { index: 0, routes: [{ name: 'Main' }] },
40
40
  type: 'RESET',
41
41
  });
@@ -1,4 +1,4 @@
1
- import AntDesign from 'react-native-vector-icons/AntDesign';
1
+ import { IconOutline } from '@ant-design/icons-react-native';
2
2
  import React, { useCallback, useContext } from 'react';
3
3
  import {
4
4
  Image,
@@ -59,7 +59,7 @@ const DrawerContainer = () => {
59
59
  style={styles.avatar}
60
60
  accessibilityLabel={AccessibilityLabel.SIDE_MENU_AVATAR_USER}
61
61
  >
62
- <AntDesign name={'user'} size={27} />
62
+ <IconOutline name={'user'} size={27} />
63
63
  </View>
64
64
  )}
65
65
  <View style={styles.textContainer}>
@@ -116,7 +116,7 @@ export const Row = ({
116
116
  ]}
117
117
  accessibilityLabel={accessibilityLabel}
118
118
  >
119
- <AntDesign name={image} size={24} />
119
+ <IconOutline name={image} size={24} />
120
120
 
121
121
  <View style={styles.wrapText}>
122
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 AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
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
- <AntDesign name={'plus'} size={20} color={Colors.White} />
102
+ <IconOutline 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
- <AntDesign name={'user'} size={20} color={Colors.White} />
116
+ <IconOutline name={'user'} size={20} color={Colors.White} />
117
117
  }
118
118
  text={contact.name}
119
119
  subtext={contact.phone_number}
@@ -122,7 +122,11 @@ export const EmergencyContactsList = ({ route }) => {
122
122
  style={styles.buttonRemove}
123
123
  onPress={onPressRemoveContact(contact)}
124
124
  >
125
- <AntDesign name={'minus'} size={20} color={Colors.Gray8} />
125
+ <IconOutline
126
+ name={'minus'}
127
+ size={20}
128
+ color={Colors.Gray8}
129
+ />
126
130
  </TouchableOpacity>
127
131
  }
128
132
  />
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useEffect, useState } from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
- import AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
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
- <AntDesign name={'user'} size={20} color={Colors.White} />
84
+ <IconOutline 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
- <AntDesign
94
+ <IconOutline
95
95
  name={'check-circle'}
96
96
  size={20}
97
97
  color={Colors.Primary}
@@ -1,16 +1,16 @@
1
- import React from 'react';
2
- import { act, create } from 'react-test-renderer';
3
1
  import MockAdapter from 'axios-mock-adapter';
2
+ import React from 'react';
4
3
  import Toast from 'react-native-toast-message';
4
+ import { act, create } from 'react-test-renderer';
5
5
 
6
- import { EmergencyContactsSelectContacts } from '../EmergencyContactsSelectContacts';
6
+ import { ViewButtonBottom } from '../../../commons';
7
+ import { API } from '../../../configs';
7
8
  import { AccessibilityLabel } from '../../../configs/Constants';
8
9
  import { SCProvider } from '../../../context';
9
10
  import { mockSCStore } from '../../../context/mockStore';
10
- import { API } from '../../../configs';
11
- import { ViewButtonBottom } from '../../../commons';
12
11
  import api from '../../../utils/Apis/axios';
13
12
  import { getTranslate } from '../../../utils/I18n';
13
+ import { EmergencyContactsSelectContacts } from '../EmergencyContactsSelectContacts';
14
14
 
15
15
  const mock = new MockAdapter(api.axiosInstance);
16
16
 
@@ -79,7 +79,7 @@ describe('test EmergencyContactsSelectContacts', () => {
79
79
  await act(async () => {
80
80
  viewButtonBottom.props.onRightClick();
81
81
  });
82
- expect(Toast.show).toBeCalledWith({
82
+ expect(Toast.show).toHaveBeenCalledWith({
83
83
  type: 'success',
84
84
  position: 'bottom',
85
85
  text1: getTranslate('en', 'saving_contact_successful'),
@@ -98,7 +98,7 @@ describe('test EmergencyContactsSelectContacts', () => {
98
98
  await act(async () => {
99
99
  viewButtonBottom.props.onRightClick();
100
100
  });
101
- expect(Toast.show).toBeCalledWith({
101
+ expect(Toast.show).toHaveBeenCalledWith({
102
102
  type: 'error',
103
103
  position: 'bottom',
104
104
  text1: getTranslate('en', 'create_contact_failed'),
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useState } from 'react';
2
2
  import { View, TouchableOpacity } from 'react-native';
3
- import AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
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
- <AntDesign name="caretdown" size={18} color={Colors.Gray8} />
32
+ <IconOutline name="caret-down" size={18} color={Colors.Gray8} />
33
33
  </TouchableOpacity>
34
34
 
35
35
  {isOpen && (
@@ -1,15 +1,15 @@
1
+ import MockAdapter from 'axios-mock-adapter';
1
2
  import React from 'react';
2
- import { create, act } from 'react-test-renderer';
3
3
  import { TouchableOpacity } from 'react-native';
4
- import MockAdapter from 'axios-mock-adapter';
4
+ import { act, create } from 'react-test-renderer';
5
5
 
6
+ import { useNavigation } from '@react-navigation/native';
7
+ import { API } from '../../../configs';
8
+ import { AccessibilityLabel } from '../../../configs/Constants';
6
9
  import { SCProvider } from '../../../context';
7
10
  import { mockSCStore } from '../../../context/mockStore';
8
- import EnterPassword from '../index';
9
- import { AccessibilityLabel } from '../../../configs/Constants';
10
- import { API } from '../../../configs';
11
11
  import api from '../../../utils/Apis/axios';
12
- import { useNavigation } from '@react-navigation/native';
12
+ import EnterPassword from '../index';
13
13
 
14
14
  const mock = new MockAdapter(api.axiosInstance);
15
15
 
@@ -103,7 +103,7 @@ describe('Test EnterPassword', () => {
103
103
  await act(async () => {
104
104
  await button[0].props.onPress();
105
105
  });
106
- expect(navigate).toBeCalled();
106
+ expect(navigate).toHaveBeenCalled();
107
107
  });
108
108
 
109
109
  it('test EnterPassword button failure', async () => {
@@ -125,6 +125,6 @@ describe('Test EnterPassword', () => {
125
125
  await act(async () => {
126
126
  await button[0].props.onPress();
127
127
  });
128
- expect(navigate).not.toBeCalled();
128
+ expect(navigate).not.toHaveBeenCalled();
129
129
  });
130
130
  });
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { View, TouchableOpacity } from 'react-native';
3
- import AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
4
4
  import Text from '../../../commons/Text';
5
5
  import styles from '../styles/indexStyles';
6
6
 
@@ -19,7 +19,7 @@ const RowGuestInfo = ({
19
19
  <View style={styles.rowRight}>
20
20
  <Text type="Body">{textRight}</Text>
21
21
  {rightArrow && (
22
- <AntDesign name="right" size={20} style={styles.icon} />
22
+ <IconOutline name="right" size={20} style={styles.icon} />
23
23
  )}
24
24
  </View>
25
25
  </View>