@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
@@ -2,12 +2,12 @@ import React from 'react';
2
2
  import { act, create } from 'react-test-renderer';
3
3
 
4
4
  import { DEVICE_TYPE } from '../../../configs/Constants';
5
+ import { SCProvider } from '../../../context';
6
+ import { mockSCStore } from '../../../context/mockStore';
5
7
  import { watchMultiConfigs } from '../../../iot/Monitor';
6
8
  import OnOffTemplate from '../OnOffTemplate';
7
9
  import OnOffButtonTemplate from '../OnOffTemplate/OnOffButtonTemplate';
8
10
  import OnOffSimpleTemplate from '../OnOffTemplate/OnOffSimpleTemplate';
9
- import { mockSCStore } from '../../../context/mockStore';
10
- import { SCProvider } from '../../../context';
11
11
 
12
12
  const wrapComponent = (item, mockDoAction, sensor) => (
13
13
  <SCProvider initState={mockSCStore({})}>
@@ -118,7 +118,7 @@ describe('Test OnOffTemplate', () => {
118
118
  const instance = tree.root;
119
119
  const template = instance.findAllByType(OnOffSimpleTemplate);
120
120
  expect(template).toHaveLength(1);
121
- expect(watchMultiConfigs).toBeCalledTimes(0);
121
+ expect(watchMultiConfigs).toHaveBeenCalledTimes(0);
122
122
  });
123
123
 
124
124
  it('template OnOffSimpleActionTemplate doAction with is_on_value, match configValue', async () => {
@@ -135,7 +135,7 @@ describe('Test OnOffTemplate', () => {
135
135
  await template.props.triggerAction();
136
136
  });
137
137
  expect(mockDoAction).toHaveBeenCalledWith(actionOffData, undefined, false);
138
- expect(watchMultiConfigs).toBeCalledTimes(0);
138
+ expect(watchMultiConfigs).toHaveBeenCalledTimes(0);
139
139
  });
140
140
 
141
141
  it('template OnOffSimpleActionTemplate doAction with is_on_value, not match configValue', async () => {
@@ -167,7 +167,7 @@ describe('Test OnOffTemplate', () => {
167
167
  await template.props.triggerAction();
168
168
  });
169
169
  expect(mockDoAction).toHaveBeenCalledWith(actionOffData, undefined, false);
170
- expect(watchMultiConfigs).toBeCalledTimes(0);
170
+ expect(watchMultiConfigs).toHaveBeenCalledTimes(0);
171
171
  });
172
172
 
173
173
  it('render with template OnOffSimpleActionTemplate with just action_data', async () => {
@@ -1,17 +1,17 @@
1
- import OptionsDropdownActionTemplate from '../../../commons/ActionGroup/OptionsDropdownActionTemplate';
2
1
  import React from 'react';
3
2
  import { TouchableOpacity } from 'react-native';
4
3
  import { act, create } from 'react-test-renderer';
5
- import Text from '../../../commons/Text';
6
- import { watchMultiConfigs } from '../../../iot/Monitor';
7
4
  import { AlertAction, RadioCircle } from '../../../commons';
8
- import { DEVICE_TYPE, AccessibilityLabel } from '../../../configs/Constants';
9
- import { getTranslate } from '../../../utils/I18n';
5
+ import OptionsDropdownActionTemplate from '../../../commons/ActionGroup/OptionsDropdownActionTemplate';
6
+ import Text from '../../../commons/Text';
7
+ import { AccessibilityLabel, DEVICE_TYPE } from '../../../configs/Constants';
10
8
  import { SCProvider } from '../../../context';
11
9
  import { mockSCStore } from '../../../context/mockStore';
10
+ import { watchMultiConfigs } from '../../../iot/Monitor';
11
+ import { getTranslate } from '../../../utils/I18n';
12
12
 
13
- import SvgDoorState from '../../../../assets/images/Device/door-state.svg';
14
13
  import SvgCurrentState from '../../../../assets/images/Device/current-state.svg';
14
+ import SvgDoorState from '../../../../assets/images/Device/door-state.svg';
15
15
  import SvgWindStrength from '../../../../assets/images/Device/wind-strength.svg';
16
16
 
17
17
  const wrapComponent = (item, mockDoAction, sensor) => (
@@ -190,8 +190,8 @@ describe('Test OptionsDropdownActionTemplate', () => {
190
190
  value: 1,
191
191
  });
192
192
  is_managed_by_backend
193
- ? expect(watchMultiConfigs).not.toBeCalled()
194
- : expect(watchMultiConfigs).not.toBeCalled();
193
+ ? expect(watchMultiConfigs).not.toHaveBeenCalled()
194
+ : expect(watchMultiConfigs).not.toHaveBeenCalled();
195
195
 
196
196
  expect(texts[1].props.children).toEqual('Level2'); // TODO: should be Level1, configValues make change again
197
197
  };
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { TouchableOpacity } from 'react-native';
3
3
  import { act, create } from 'react-test-renderer';
4
+ import { DEVICE_TYPE } from '../../../configs/Constants';
4
5
  import Text from '../../Text';
5
6
  import StatesGridActionTemplate from '../StatesGridActionTemplate';
6
- import { DEVICE_TYPE } from '../../../configs/Constants';
7
7
 
8
8
  const mockDoAction = jest.fn();
9
9
  const mockActionData = jest.fn();
@@ -74,7 +74,7 @@ describe('Test StatesGridActionTemplate', () => {
74
74
  await act(async () => {
75
75
  await touchableOpacities[0].props.onPress();
76
76
  });
77
- expect(mockDoAction).toBeCalledWith(mockActionData, null);
77
+ expect(mockDoAction).toHaveBeenCalledWith(mockActionData, null);
78
78
  });
79
79
 
80
80
  it('test trigger special action', async () => {
@@ -96,7 +96,7 @@ describe('Test StatesGridActionTemplate', () => {
96
96
  await act(async () => {
97
97
  await touchableOpacities[0].props.onPress();
98
98
  });
99
- expect(mockDoAction).toBeCalledWith(
99
+ expect(mockDoAction).toHaveBeenCalledWith(
100
100
  mockActionData,
101
101
  JSON.stringify({ config_id: 1, config_value: undefined })
102
102
  );
@@ -1,15 +1,15 @@
1
1
  import React from 'react';
2
2
  import { Switch, TouchableOpacity } from 'react-native';
3
- import { act, create } from 'react-test-renderer';
4
- import TimerActionTemplate from '../TimerActionTemplate';
5
3
  import DateTimePickerModal from 'react-native-modal-datetime-picker';
6
4
  import ScrollPicker from 'react-native-wheel-scrollview-picker';
5
+ import { act, create } from 'react-test-renderer';
6
+ import TimerActionTemplate from '../TimerActionTemplate';
7
7
 
8
8
  import moment from 'moment';
9
- import Text from '../../Text';
10
- import { watchMultiConfigs } from '../../../iot/Monitor';
11
9
  import { SCProvider } from '../../../context';
12
10
  import { mockSCStore } from '../../../context/mockStore';
11
+ import { watchMultiConfigs } from '../../../iot/Monitor';
12
+ import Text from '../../Text';
13
13
 
14
14
  jest.mock('../../../iot/Monitor');
15
15
 
@@ -81,7 +81,7 @@ describe('Test TimerActionTemplate success with config value', () => {
81
81
  await act(async () => {
82
82
  await switchButton.props.onValueChange();
83
83
  });
84
- expect(mockDoAction).toBeCalled();
84
+ expect(mockDoAction).toHaveBeenCalled();
85
85
 
86
86
  const touchableOpacities = instance.findAllByType(TouchableOpacity);
87
87
  await act(async () => {
@@ -128,6 +128,6 @@ describe('Test TimerActionTemplate success with config value', () => {
128
128
  await act(async () => {
129
129
  await touchableOpacities[2].props.onPress(3);
130
130
  });
131
- expect(mockDoAction).toBeCalled();
131
+ expect(mockDoAction).toHaveBeenCalled();
132
132
  });
133
133
  });
@@ -123,7 +123,7 @@ describe('Test TwoButtonTemplate', () => {
123
123
  expect(touchableOpacities.length).toEqual(2);
124
124
  await touchableOpacities[0].props.onPress();
125
125
  await touchableOpacities[1].props.onPress();
126
- expect(mockDoAction).toBeCalled();
126
+ expect(mockDoAction).toHaveBeenCalled();
127
127
  });
128
128
 
129
129
  it('render TouchableOpacity TwoButtonTemplate without is_on_value', async () => {
@@ -1,21 +1,21 @@
1
1
  import React from 'react';
2
2
  import {
3
- TouchableOpacity,
4
- Switch,
5
3
  ActivityIndicator,
6
4
  ScrollView,
5
+ Switch,
6
+ TouchableOpacity,
7
7
  } from 'react-native';
8
- import renderer, { act } from 'react-test-renderer';
9
8
  import DateTimePickerModal from 'react-native-modal-datetime-picker';
9
+ import renderer, { act } from 'react-test-renderer';
10
10
 
11
+ import { Slider } from '@miblanchard/react-native-slider';
11
12
  import ActionGroup from '..';
12
- import Text from '../../Text';
13
13
  import { AccessibilityLabel, BUTTON_TYPE } from '../../../configs/Constants';
14
14
  import { SCProvider } from '../../../context';
15
15
  import { mockSCStore } from '../../../context/mockStore';
16
- import { Slider } from '@miblanchard/react-native-slider';
17
- import { WheelColorPicker } from '../ColorPickerTemplate';
18
16
  import RadioCircle from '../../RadioCircle';
17
+ import Text from '../../Text';
18
+ import { WheelColorPicker } from '../ColorPickerTemplate';
19
19
  import SwitchButtonTemplate from '../OnOffTemplate/SwitchButtonTemplate';
20
20
 
21
21
  const wrapComponent = (item, mockDoAction, sensor) => (
@@ -1,14 +1,14 @@
1
1
  import React from 'react';
2
2
  import renderer, { act } from 'react-test-renderer';
3
3
 
4
+ import Modal from 'react-native-modal';
4
5
  import ActionTemplate from '..';
6
+ import AccessibilityLabel from '../../../configs/AccessibilityLabel';
5
7
  import { SCProvider } from '../../../context';
6
8
  import { mockSCStore } from '../../../context/mockStore';
7
9
  import SelectActionCard from '../../SelectActionCard';
8
- import Modal from 'react-native-modal';
9
- import ThreeButtonAction from '../ThreeButtonAction';
10
- import AccessibilityLabel from '../../../configs/AccessibilityLabel';
11
10
  import Text from '../../Text';
11
+ import ThreeButtonAction from '../ThreeButtonAction';
12
12
  import { showAllCards } from './utils';
13
13
 
14
14
  const mockOnSelectAction = jest.fn();
@@ -81,7 +81,7 @@ describe('Test ActionTemplate', () => {
81
81
  template: 'three_button_action_template',
82
82
  });
83
83
  });
84
- expect(mockOnSelectAction).toBeCalledWith({
84
+ expect(mockOnSelectAction).toHaveBeenCalledWith({
85
85
  action: '94ae262d-46e3-42ff-9d10-516831ecc830',
86
86
  action_name: 'OPEN',
87
87
  data: null,
@@ -18,10 +18,11 @@ const ItemAutomate = ({
18
18
  enableScript = true,
19
19
  }) => {
20
20
  const t = useTranslations();
21
- const item = AUTOMATES[automate?.type];
22
- const isItemOneTap = AUTOMATES[automate?.type] === AUTOMATES.one_tap;
23
- const Icon = item?.icon;
24
- const valueEvaluations = useGetEvaluateValue(automate?.config, automate.unit);
21
+ const { type, config, unit } = automate;
22
+ const item = AUTOMATES[type];
23
+ const { icon: Icon, title, explanation } = item || {};
24
+ const isItemOneTap = AUTOMATES[type] === AUTOMATES.one_tap;
25
+ const valueEvaluations = useGetEvaluateValue(config, unit);
25
26
 
26
27
  const textCondition = useMemo(() => {
27
28
  return generateAutomationConditionText(automate, valueEvaluations, t);
@@ -33,9 +34,9 @@ const ItemAutomate = ({
33
34
  } else if (isSelected && isItemOneTap) {
34
35
  return t('quick_button_create_at_dashboard');
35
36
  } else {
36
- return t(item?.explanation);
37
+ return t(explanation);
37
38
  }
38
- }, [isItemOneTap, isSelected, item?.explanation, t, textCondition]);
39
+ }, [isItemOneTap, isSelected, explanation, t, textCondition]);
39
40
 
40
41
  const handleSelectIndex = useCallback(() => {
41
42
  if (onPress) {
@@ -63,7 +64,7 @@ const ItemAutomate = ({
63
64
  bold
64
65
  color={enableScript ? Colors.Black : Colors.Gray7}
65
66
  >
66
- {t(item?.title)}
67
+ {t(title)}
67
68
  </Text>
68
69
  <Text type="Label" color={Colors.Gray8} numberOfLines={1}>
69
70
  {renderText}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { act, create } from 'react-test-renderer';
3
2
  import { TouchableOpacity } from 'react-native';
3
+ import { act, create } from 'react-test-renderer';
4
4
 
5
5
  import { SCProvider } from '../../../context';
6
6
  import { mockSCStore } from '../../../context/mockStore';
@@ -41,6 +41,6 @@ describe('Test ItemAutomate', () => {
41
41
  await act(async () => {
42
42
  touchableOpacities[0].props.onPress();
43
43
  });
44
- expect(mockOnPress).toBeCalledTimes(1);
44
+ expect(mockOnPress).toHaveBeenCalledTimes(1);
45
45
  });
46
46
  });
@@ -1,6 +1,6 @@
1
1
  import React, { memo } from 'react';
2
2
  import { TouchableOpacity, StyleSheet } from 'react-native';
3
- import AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
4
4
  import { AccessibilityLabel } from '../../configs/Constants';
5
5
 
6
6
  const BackDefault = memo(({ goBack, color, fixedHeight }) => {
@@ -10,7 +10,7 @@ const BackDefault = memo(({ goBack, color, fixedHeight }) => {
10
10
  onPress={goBack}
11
11
  style={[styles.wrap, fixedHeight && styles.noPaddingVertical]}
12
12
  >
13
- <AntDesign name="left" size={27} color={color} />
13
+ <IconOutline name="left" size={27} color={color} />
14
14
  </TouchableOpacity>
15
15
  );
16
16
  });
@@ -1,6 +1,6 @@
1
1
  import React 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
 
5
5
  import { Colors, Device } from '../../configs';
6
6
  import { AccessibilityLabel } from '../../configs/Constants';
@@ -42,7 +42,7 @@ const ButtonPopup = ({
42
42
  <View style={styles.popoverStyle}>
43
43
  <View style={styles.modalWrapper}>
44
44
  {!hideClose && (
45
- <AntDesign
45
+ <IconOutline
46
46
  name={'close'}
47
47
  color={Colors.Gray8}
48
48
  style={styles.close}
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
+ import { TouchableOpacity } from 'react-native';
2
3
  import { act, create } from 'react-test-renderer';
3
4
  import { SCProvider } from '../../../context';
4
5
  import { mockSCStore } from '../../../context/mockStore';
5
6
  import ChartAggregationOption from '../index';
6
- import { TouchableOpacity } from 'react-native';
7
7
 
8
8
  const wrapComponent = (props) => (
9
9
  <SCProvider initState={mockSCStore({})}>
@@ -31,7 +31,7 @@ it('test', async () => {
31
31
  await act(async () => {
32
32
  await buttons[index].props.onPress();
33
33
  });
34
- expect(mockSetGroupBy).toBeCalledWith(data);
34
+ expect(mockSetGroupBy).toHaveBeenCalledWith(data);
35
35
  };
36
36
 
37
37
  await clickButton(0, 'date');
@@ -1,18 +1,17 @@
1
+ import MockAdapter from 'axios-mock-adapter';
1
2
  import React, { useContext } from 'react';
2
3
  import { act, create } from 'react-test-renderer';
3
- import MockAdapter from 'axios-mock-adapter';
4
4
 
5
- import MyPinnedSharedUnit from '../index';
6
- import { Text } from 'react-native';
7
- import { getTranslate } from '../../../../utils/I18n';
5
+ import { Text, TouchableOpacity } from 'react-native';
6
+ import { API } from '../../../../configs';
7
+ import { AccessibilityLabel } from '../../../../configs/Constants';
8
8
  import { SCProvider } from '../../../../context';
9
+ import { Action } from '../../../../context/actionType';
9
10
  import { mockSCStore } from '../../../../context/mockStore';
10
- import { AccessibilityLabel } from '../../../../configs/Constants';
11
- import { API } from '../../../../configs';
12
- import { TouchableOpacity } from 'react-native';
13
11
  import api from '../../../../utils/Apis/axios';
12
+ import { getTranslate } from '../../../../utils/I18n';
14
13
  import SharedUnit from '../../../Unit/SharedUnit';
15
- import { Action } from '../../../../context/actionType';
14
+ import MyPinnedSharedUnit from '../index';
16
15
 
17
16
  const mock = new MockAdapter(api.axiosInstance);
18
17
 
@@ -61,7 +60,7 @@ describe('Test MyPinnedSharedUnit', () => {
61
60
  goToAllSharedUnits.props.onPress();
62
61
  });
63
62
  expect(global.mockedNavigate).toHaveBeenCalled();
64
- expect(mockSetAction).toBeCalledWith(
63
+ expect(mockSetAction).toHaveBeenCalledWith(
65
64
  Action.IS_CHECK_CLEAR_CACHE_UNITS,
66
65
  false
67
66
  );
@@ -1,17 +1,17 @@
1
+ import MockAdapter from 'axios-mock-adapter';
1
2
  import React from 'react';
2
3
  import renderer, { act } from 'react-test-renderer';
3
- import MockAdapter from 'axios-mock-adapter';
4
4
 
5
+ import FastImage from 'react-native-fast-image';
5
6
  import MyUnit from '..';
6
- import MyUnitDevice from '../../../../screens/Unit/components/MyUnitDevice';
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';
11
+ import { flushPromises } from '../../../../screens/AllGateway/test-utils';
12
+ import MyUnitDevice from '../../../../screens/Unit/components/MyUnitDevice';
10
13
  import api from '../../../../utils/Apis/axios';
11
- import { API } from '../../../../configs';
12
14
  import Routes from '../../../../utils/Route';
13
- import { flushPromises } from '../../../../screens/AllGateway/test-utils';
14
- import FastImage from 'react-native-fast-image';
15
15
  import { removeMultiple, STORAGE_KEY } from '../../../../utils/Storage';
16
16
 
17
17
  const mock = new MockAdapter(api.axiosInstance);
@@ -103,7 +103,7 @@ describe('Test MyUnit', () => {
103
103
  await act(async () => {
104
104
  await button.props.onPress(data[0]);
105
105
  });
106
- expect(global.mockedNavigate).toBeCalledWith(Routes.UnitStack, {
106
+ expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
107
107
  params: { unitId: 1 },
108
108
  screen: Routes.UnitDetail,
109
109
  });
@@ -123,7 +123,7 @@ describe('Test MyUnit', () => {
123
123
  await act(async () => {
124
124
  await button.props.onPress(data[1]);
125
125
  });
126
- expect(global.mockedNavigate).toBeCalledWith('UnitStack', {
126
+ expect(global.mockedNavigate).toHaveBeenCalledWith('UnitStack', {
127
127
  params: { unitId: 2 },
128
128
  screen: 'UnitDetail',
129
129
  });
@@ -1,13 +1,13 @@
1
1
  import React, { memo } from 'react';
2
2
  import { StyleSheet, 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 { Colors } from '../../configs';
5
5
 
6
6
  const DateTimeButton = memo(({ onPress, style, children }) => {
7
7
  return (
8
8
  <TouchableOpacity style={[styles.dateSelect, style]} onPress={onPress}>
9
9
  {children}
10
- <AntDesign style={styles.iconDateTime} name={'calendar'} />
10
+ <IconOutline style={styles.iconDateTime} name={'calendar'} />
11
11
  </TouchableOpacity>
12
12
  );
13
13
  });
@@ -25,7 +25,7 @@ const styles = StyleSheet.create({
25
25
  marginHorizontal: 8,
26
26
  flexDirection: 'row',
27
27
  justifyContent: 'space-between',
28
- width: 150,
28
+ width: 130,
29
29
  alignItems: 'center',
30
30
  },
31
31
  txtTime: {
@@ -1,6 +1,6 @@
1
1
  import React, { memo } 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 { useTranslations } from '../../hooks/Common/useTranslations';
5
5
  import { Colors } from '../../configs';
6
6
  import Text from '../../commons/Text';
@@ -30,7 +30,7 @@ const ConnectedViewHeader = memo(
30
30
  return (
31
31
  <View style={styles.statusContainer}>
32
32
  <View style={styles.connectStatus}>
33
- <AntDesign name={'wifi'} color={Colors.Green6} size={16} />
33
+ <IconOutline name={'wifi'} color={Colors.Green6} size={16} />
34
34
  <DisplayTextConnected type={type} />
35
35
  </View>
36
36
  {isDisplayTime && (
@@ -6,7 +6,7 @@ import MediaPlayer from '../../MediaPlayer';
6
6
  import { standardizeCameraScreenSize } from '../../../utils/Utils';
7
7
  import { Colors, Device } from '../../../configs';
8
8
  import { RowUser } from '../../RowUser';
9
- import AntDesign from 'react-native-vector-icons/AntDesign';
9
+ import { IconOutline } from '@ant-design/icons-react-native';
10
10
  import { useEmeragencyContacts } from '../../../screens/EmergencyContacts/hook';
11
11
  import { useIsFocused } from '@react-navigation/native';
12
12
 
@@ -49,12 +49,12 @@ const EmergencyDetail = memo(({ item }) => {
49
49
  key={contact.id.toString()}
50
50
  index={index}
51
51
  leftIcon={
52
- <AntDesign name={'user'} size={20} color={Colors.White} />
52
+ <IconOutline name={'user'} size={20} color={Colors.White} />
53
53
  }
54
54
  text={contact.name}
55
55
  rightComponent={
56
56
  <View style={styles.rightComponent}>
57
- <AntDesign
57
+ <IconOutline
58
58
  name={'phone'}
59
59
  size={20}
60
60
  color={Colors.Gray9}
@@ -43,6 +43,6 @@ describe('Test EmergencyButton', () => {
43
43
  emergencyButton.props.onLongPress();
44
44
  });
45
45
 
46
- expect(mockFunction).toBeCalled();
46
+ expect(mockFunction).toHaveBeenCalled();
47
47
  });
48
48
  });
@@ -1,15 +1,15 @@
1
1
  import React, { memo, useCallback, useState } from 'react';
2
- import { View, StyleSheet, TouchableOpacity } from 'react-native';
3
- import QualityIndicatorItem from './WaterQualitySensor/QualityIndicatorsItem';
4
- import AlertStatusMachine from './WaterPurifierStatus/AlertStatusMachine';
5
- import { useBoolean } from '../../hooks/Common';
6
- import Text from '../Text';
7
- import Routes from '../../utils/Route';
8
- import AntDesign from 'react-native-vector-icons/AntDesign';
2
+ import { StyleSheet, TouchableOpacity, View } from 'react-native';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
9
4
  import { Colors, Constants } from '../../configs';
10
- import { useTranslations } from '../../hooks/Common/useTranslations';
11
5
  import { AccessibilityLabel } from '../../configs/Constants';
6
+ import { useBoolean } from '../../hooks/Common';
7
+ import { useTranslations } from '../../hooks/Common/useTranslations';
8
+ import Routes from '../../utils/Route';
12
9
  import { ModalCustom } from '../Modal';
10
+ import Text from '../Text';
11
+ import AlertStatusMachine from './WaterPurifierStatus/AlertStatusMachine';
12
+ import QualityIndicatorItem from './WaterQualitySensor/QualityIndicatorsItem';
13
13
 
14
14
  const marginHorizontal = 20;
15
15
  const widthItem = (Constants.width - marginHorizontal * 2) / 2;
@@ -75,20 +75,21 @@ const FlatListItems = memo(({ data, style, title, offsetTitle }) => {
75
75
  style={styles.iconInfo}
76
76
  accessibilityLabel={AccessibilityLabel.TOUCH_INFO_FLAT_LIST_ITEM}
77
77
  >
78
- <AntDesign name={'info-circle'} size={16} color={Colors.Gray8} />
78
+ <IconOutline name={'info-circle'} size={16} color={Colors.Gray8} />
79
79
  </TouchableOpacity>
80
80
  )}
81
81
  </View>
82
82
 
83
- {filtersNeedReplace.length > 0 && filtersNeedReplace[0].measure === 'H' && (
84
- <AlertStatusMachine
85
- message={t('{number}_filter_need_to_be_replaced', {
86
- number: filtersNeedReplace.length,
87
- })}
88
- style={styles.alertReplaceFilter}
89
- icon={'warning'}
90
- />
91
- )}
83
+ {filtersNeedReplace.length > 0 &&
84
+ filtersNeedReplace[0].measure === 'H' && (
85
+ <AlertStatusMachine
86
+ message={t('{number}_filter_need_to_be_replaced', {
87
+ number: filtersNeedReplace.length,
88
+ })}
89
+ style={styles.alertReplaceFilter}
90
+ icon={'warning'}
91
+ />
92
+ )}
92
93
  <View style={styles.listBox}>{renderFlatList()}</View>
93
94
 
94
95
  {isFilters && !viewFull && (
@@ -97,7 +98,7 @@ const FlatListItems = memo(({ data, style, title, offsetTitle }) => {
97
98
  onPress={() => setViewFull(true)}
98
99
  >
99
100
  <Text style={styles.textSeeMore}>{t('see_more')}</Text>
100
- <AntDesign name={'caretdown'} color={Colors.Gray8} size={16} />
101
+ <IconOutline name={'caret-down'} color={Colors.Gray8} size={16} />
101
102
  </TouchableOpacity>
102
103
  )}
103
104
 
@@ -5,7 +5,7 @@ import {
5
5
  TouchableWithoutFeedback,
6
6
  View,
7
7
  } from 'react-native';
8
- import AntDesign from 'react-native-vector-icons/AntDesign';
8
+ import { IconOutline } from '@ant-design/icons-react-native';
9
9
  import { useNavigation } from '@react-navigation/native';
10
10
 
11
11
  import Text from '../../Text';
@@ -35,7 +35,7 @@ const ItemHanetDevice = memo(
35
35
  return iconKit ? (
36
36
  <FImage source={{ uri: iconKit }} style={styles.iconSensor} />
37
37
  ) : (
38
- <AntDesign name={svgMain} size={32} color={Colors.Red6} />
38
+ <IconOutline name={svgMain} size={32} color={Colors.Red6} />
39
39
  );
40
40
  };
41
41
 
@@ -58,7 +58,7 @@ const ItemHanetDevice = memo(
58
58
  {title}
59
59
  </Text>
60
60
  <View style={styles.row}>
61
- <AntDesign name="right" size={12} />
61
+ <IconOutline name="right" size={12} />
62
62
  </View>
63
63
  </TouchableOpacity>
64
64
  </View>
@@ -1,10 +1,10 @@
1
+ import { useNavigation } from '@react-navigation/native';
1
2
  import React from 'react';
2
3
  import { TouchableWithoutFeedback } from 'react-native';
3
4
  import renderer, { act } from 'react-test-renderer';
4
- import ItemHanetDevice from './ItemHanetDevice';
5
5
  import { SCProvider } from '../../../context';
6
6
  import { mockSCStore } from '../../../context/mockStore';
7
- import { useNavigation } from '@react-navigation/native';
7
+ import ItemHanetDevice from './ItemHanetDevice';
8
8
 
9
9
  const wrapComponent = (props) => (
10
10
  <SCProvider initState={mockSCStore({})}>
@@ -35,7 +35,7 @@ describe('Test ItemHanetDevice', () => {
35
35
  await act(async () => {
36
36
  tree = touches[0].props.onPress();
37
37
  });
38
- expect(navigate).toBeCalled();
38
+ expect(navigate).toHaveBeenCalled();
39
39
  });
40
40
 
41
41
  it('render ItemHanetDevice sensor has icon', async () => {