@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,16 +1,16 @@
1
- import React from 'react';
2
1
  import MockAdapter from 'axios-mock-adapter';
2
+ import React from 'react';
3
3
  import { Platform, TextInput, TouchableOpacity } from 'react-native';
4
4
  import { act, create } from 'react-test-renderer';
5
5
 
6
- import AddNewOneTap from '../index';
6
+ import { useNavigation, useRoute } from '@react-navigation/native';
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 Routes from '../../../../utils/Route';
11
11
  import api from '../../../../utils/Apis/axios';
12
- import { API } from '../../../../configs';
13
- import { useNavigation, useRoute } from '@react-navigation/native';
12
+ import Routes from '../../../../utils/Route';
13
+ import AddNewOneTap from '../index';
14
14
 
15
15
  const wrapComponent = (route) => {
16
16
  useRoute.mockReturnValue(route);
@@ -81,7 +81,8 @@ describe('test OneTap', () => {
81
81
  merge: true,
82
82
  name: Routes.ScriptDetail,
83
83
  params: {
84
- newAutomate: {
84
+ closeScreen: Routes.ScriptDetail,
85
+ preAutomate: {
85
86
  id: 1,
86
87
  script: { id: 1, name: 'William Miller' },
87
88
  type: 'one_tap',
@@ -114,7 +115,7 @@ describe('test OneTap', () => {
114
115
  await act(async () => {
115
116
  await item[0].props.onPress();
116
117
  });
117
- expect(global.mockedNavigate).not.toBeCalled();
118
+ expect(global.mockedNavigate).not.toHaveBeenCalled();
118
119
  });
119
120
 
120
121
  it('test onClose have automateId', async () => {
@@ -122,8 +123,13 @@ describe('test OneTap', () => {
122
123
  let route = {
123
124
  params: {
124
125
  closeScreen: Routes.ScriptDetail,
126
+ automate: {
127
+ unit: 1,
128
+ },
129
+ unitId: 1,
125
130
  },
126
131
  };
132
+
127
133
  mock.onPost(API.AUTOMATE.CREATE_AUTOMATE()).reply(400);
128
134
  await act(async () => {
129
135
  tree = await create(wrapComponent(route));
@@ -136,6 +142,10 @@ describe('test OneTap', () => {
136
142
  await act(async () => {
137
143
  header.props.onPress();
138
144
  });
139
- expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.ScriptDetail);
145
+ expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.ScriptDetail, {
146
+ unitId: 1,
147
+ automate: { unit: 1 },
148
+ closeScreen: Routes.ScriptDetail,
149
+ });
140
150
  });
141
151
  });
@@ -1,16 +1,16 @@
1
- import React from 'react';
2
1
  import MockAdapter from 'axios-mock-adapter';
2
+ import React from 'react';
3
3
  import { Platform, TextInput, TouchableOpacity } from 'react-native';
4
4
  import { act, create } from 'react-test-renderer';
5
5
 
6
- import ScenarioName from '../ScenarioName';
6
+ import { useNavigation, useRoute } from '@react-navigation/native';
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 Routes from '../../../../utils/Route';
11
11
  import api from '../../../../utils/Apis/axios';
12
- import { API } from '../../../../configs';
13
- import { useNavigation, useRoute } from '@react-navigation/native';
12
+ import Routes from '../../../../utils/Route';
13
+ import ScenarioName from '../ScenarioName';
14
14
 
15
15
  const wrapComponent = (route) => {
16
16
  useRoute.mockReturnValue(route);
@@ -103,7 +103,7 @@ describe('test OneTap', () => {
103
103
  await act(async () => {
104
104
  await item[0].props.onPress();
105
105
  });
106
- expect(global.mockedNavigate).not.toBeCalled();
106
+ expect(global.mockedNavigate).not.toHaveBeenCalled();
107
107
  });
108
108
 
109
109
  it('test onClose have automateId', async () => {
@@ -111,6 +111,10 @@ describe('test OneTap', () => {
111
111
  let route = {
112
112
  params: {
113
113
  closeScreen: Routes.ScriptDetail,
114
+ automate: {
115
+ unit: 1,
116
+ },
117
+ unitId: 1,
114
118
  },
115
119
  };
116
120
  mock.onPost(API.AUTOMATE.CREATE_AUTOMATE()).reply(400);
@@ -125,6 +129,10 @@ describe('test OneTap', () => {
125
129
  await act(async () => {
126
130
  header.props.onPress();
127
131
  });
128
- expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.ScriptDetail);
132
+ expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.ScriptDetail, {
133
+ unitId: 1,
134
+ automate: { unit: 1 },
135
+ closeScreen: 'ScriptDetail',
136
+ });
129
137
  });
130
138
  });
@@ -11,7 +11,7 @@ import Event from '../../../../../assets/images/Event.svg';
11
11
  import Notify from '../../../../../assets/images/Notify.svg';
12
12
  import Delay from '../../../../../assets/images/Delay.svg';
13
13
  import { TouchableOpacity } from 'react-native';
14
- import AntDesign from 'react-native-vector-icons/AntDesign';
14
+ import { IconOutline } from '@ant-design/icons-react-native';
15
15
  import { Text } from '../../../../commons';
16
16
  import Routes from '../../../../utils/Route';
17
17
  import AccessibilityLabel from '../../../../configs/AccessibilityLabel';
@@ -40,6 +40,7 @@ const AddActionScript = memo(
40
40
  closeScreen: currentScreenName,
41
41
  numberActionCanAdd:
42
42
  max_actions_per_automation - numberActionAdded,
43
+ routeName: unit ? null : Routes.SelectControlDevices,
43
44
  };
44
45
 
45
46
  navigate(
@@ -54,10 +55,17 @@ const AddActionScript = memo(
54
55
  image: <Notify />,
55
56
  onClick: () => {
56
57
  setIsVisible(false);
57
- navigate(Routes.SetupScriptNotify, {
58
- automate,
59
- unitId: unit,
60
- });
58
+ if (unit) {
59
+ navigate(Routes.SetupScriptNotify, {
60
+ automate,
61
+ unitId: unit,
62
+ });
63
+ } else {
64
+ navigate(Routes.SelectUnit, {
65
+ automate,
66
+ routeName: Routes.SetupScriptNotify,
67
+ });
68
+ }
61
69
  },
62
70
  },
63
71
  {
@@ -109,7 +117,7 @@ const AddActionScript = memo(
109
117
  <View style={styles.wapItem}>
110
118
  <View style={styles.imageItem}>{item.image}</View>
111
119
  <Text style={styles.textItem}>{item.text}</Text>
112
- <AntDesign name="right" />
120
+ <IconOutline name="right" />
113
121
  </View>
114
122
  </TouchableOpacity>
115
123
  </View>
@@ -14,14 +14,11 @@ const RenameScript = ({ automate, setAutomate, isVisible, setIsVisible }) => {
14
14
  const transY = useKeyboardAnimated();
15
15
 
16
16
  const renameScript = useCallback(async () => {
17
- const { success, data: script } = await axiosPatch(
18
- API.AUTOMATE.SCRIPT(automate.id),
19
- {
20
- name: inputName,
21
- }
22
- );
17
+ const { success } = await axiosPatch(API.AUTOMATE.SCRIPT(automate.id), {
18
+ name: inputName,
19
+ });
23
20
  if (success) {
24
- setAutomate((prev) => ({ ...prev, name: script.name }));
21
+ setAutomate((prev) => ({ ...prev, name: inputName }));
25
22
  ToastBottomHelper.success(t('rename_successfully'));
26
23
  } else {
27
24
  ToastBottomHelper.error(t('rename_failed'));
@@ -308,6 +308,8 @@ describe('Test ScriptDetail', () => {
308
308
  unitId: route.params.preAutomate.unit,
309
309
  automateId: route.params.preAutomate.id,
310
310
  numberActionCanAdd: 2,
311
+ closeScreen: undefined,
312
+ routeName: null,
311
313
  }
312
314
  );
313
315
  mockedNavigate.mockClear();
@@ -344,7 +346,7 @@ describe('Test ScriptDetail', () => {
344
346
  const instance = tree.root;
345
347
  const switchButton = instance.findByType(Switch);
346
348
  await act(async () => {
347
- await switchButton.props.onChange(false);
349
+ await switchButton.props.onValueChange(false);
348
350
  });
349
351
  const buttonAddScript = instance.findAll(
350
352
  (el) =>
@@ -1,12 +1,12 @@
1
- import React from 'react';
2
1
  import { act, renderHook } from '@testing-library/react-hooks';
3
- import { SCProvider } from '../../../../context';
4
- import { mockSCStore } from '../../../../context/mockStore';
5
- import { useStarredScript } from '../hooks/useStarredScript';
6
2
  import MockAdapter from 'axios-mock-adapter';
7
- import api from '../../../../utils/Apis/axios';
3
+ import React from 'react';
8
4
  import { API } from '../../../../configs';
5
+ import { SCProvider } from '../../../../context';
9
6
  import { Action } from '../../../../context/actionType';
7
+ import { mockSCStore } from '../../../../context/mockStore';
8
+ import api from '../../../../utils/Apis/axios';
9
+ import { useStarredScript } from '../hooks/useStarredScript';
10
10
 
11
11
  const mockedSetAction = jest.fn();
12
12
  const mock = new MockAdapter(api.axiosInstance);
@@ -42,6 +42,6 @@ describe('Test useStarredScript', () => {
42
42
  await act(async () => {
43
43
  await result.current.unstarScript();
44
44
  });
45
- expect(mockedSetAction).toBeCalledWith(Action.UNSTAR_SCRIPTS, [2]);
45
+ expect(mockedSetAction).toHaveBeenCalledWith(Action.UNSTAR_SCRIPTS, [2]);
46
46
  });
47
47
  });
@@ -5,35 +5,35 @@ import React, {
5
5
  useRef,
6
6
  useState,
7
7
  } from 'react';
8
- import { Image, Platform, TouchableOpacity, View, Switch } from 'react-native';
8
+ import { Image, Platform, Switch, TouchableOpacity, View } from 'react-native';
9
9
  import { PopoverMode } from 'react-native-popover-view';
10
- import AntDesign from 'react-native-vector-icons/AntDesign';
10
+ import { IconFill, IconOutline } from '@ant-design/icons-react-native';
11
11
  import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
12
12
 
13
- import { useTranslations } from '../../../hooks/Common/useTranslations';
14
- import styles from './Styles/indexStyles';
15
- import Text from '../../../commons/Text';
16
- import WrapHeaderScrollable from '../../../commons/Sharing/WrapHeaderScrollable';
17
- import { API, Colors } from '../../../configs';
18
- import { usePopover } from '../../../hooks/Common';
19
- import { useStarredScript } from './hooks/useStarredScript';
20
- import MenuActionMore from '../../../commons/MenuActionMore';
13
+ import { useIsFocused, useNavigation } from '@react-navigation/native';
21
14
  import Add from '../../../../assets/images/Add.svg';
22
- import Notify from '../../../../assets/images/Notify.svg';
23
15
  import Delay from '../../../../assets/images/Delay.svg';
24
- import { useIsFocused, useNavigation } from '@react-navigation/native';
25
- import { axiosGet, axiosPost } from '../../../utils/Apis/axios';
26
- import Routes from '../../../utils/Route';
27
- import { ToastBottomHelper } from '../../../utils/Utils';
16
+ import Notify from '../../../../assets/images/Notify.svg';
28
17
  import ItemAutomate from '../../../commons/Automate/ItemAutomate';
18
+ import IconComponent from '../../../commons/IconComponent';
19
+ import MenuActionMore from '../../../commons/MenuActionMore';
20
+ import WrapHeaderScrollable from '../../../commons/Sharing/WrapHeaderScrollable';
21
+ import Text from '../../../commons/Text';
29
22
  import withPreventDoubleClick from '../../../commons/WithPreventDoubleClick';
23
+ import { API, Colors } from '../../../configs';
30
24
  import { AccessibilityLabel, AUTOMATE_TYPE } from '../../../configs/Constants';
31
- import RenameScript from './Components/RenameScript';
32
- import DeleteScript from './Components/DeleteScript';
33
25
  import Images from '../../../configs/Images';
26
+ import { usePopover } from '../../../hooks/Common';
27
+ import { useTranslations } from '../../../hooks/Common/useTranslations';
28
+ import { axiosGet, axiosPost } from '../../../utils/Apis/axios';
34
29
  import { useBackendPermission } from '../../../utils/Permission/backend';
35
- import IconComponent from '../../../commons/IconComponent';
30
+ import Routes from '../../../utils/Route';
31
+ import { ToastBottomHelper } from '../../../utils/Utils';
36
32
  import AddActionScript from './Components/AddActionScript';
33
+ import DeleteScript from './Components/DeleteScript';
34
+ import RenameScript from './Components/RenameScript';
35
+ import { useStarredScript } from './hooks/useStarredScript';
36
+ import styles from './Styles/indexStyles';
37
37
 
38
38
  const PreventDoubleTouch = withPreventDoubleClick(TouchableOpacity);
39
39
 
@@ -45,11 +45,10 @@ const ScriptDetail = ({ route }) => {
45
45
  usePopover();
46
46
  const t = useTranslations();
47
47
  const {
48
- id,
49
48
  saveAt,
50
49
  preAutomate = {}, // pre-loaded automate data
51
- newAutomate, // updated automate data
52
50
  newActionsList, // updated actions list
51
+ closeScreen,
53
52
  } = params;
54
53
  const [automate, setAutomate] = useState(preAutomate);
55
54
  const isFocused = useIsFocused();
@@ -63,7 +62,7 @@ const ScriptDetail = ({ route }) => {
63
62
  const [enableScript, setEnableScript] = useState(enable);
64
63
  const onShowActivityLog = useCallback(() => {
65
64
  navigate(Routes.ActivityLog, {
66
- id: id,
65
+ id: automateId,
67
66
  type:
68
67
  type === AUTOMATE_TYPE.ONE_TAP
69
68
  ? `automate.${AUTOMATE_TYPE.ONE_TAP}`
@@ -74,7 +73,7 @@ const ScriptDetail = ({ route }) => {
74
73
  user: Boolean(unit),
75
74
  },
76
75
  });
77
- }, [navigate, id, type, unit]);
76
+ }, [navigate, automateId, type, unit]);
78
77
 
79
78
  const listMenuItem = useMemo(
80
79
  () => [
@@ -107,39 +106,41 @@ const ScriptDetail = ({ route }) => {
107
106
 
108
107
  const fetchAutomateActions = useCallback(async () => {
109
108
  const { success, data: automateData } = await axiosGet(
110
- API.AUTOMATE.SCRIPT_ITEMS(id)
109
+ API.AUTOMATE.SCRIPT_ITEMS(automateId)
111
110
  );
112
111
  if (success) {
113
112
  setData(automateData.script_items || []);
114
113
  }
115
- }, [id]);
114
+ }, [automateId]);
116
115
 
117
116
  const fetchAutomate = useCallback(async () => {
118
117
  const { success, data: automateData } = await axiosGet(
119
- API.AUTOMATE.FETCH_AUTOMATE(id)
118
+ API.AUTOMATE.FETCH_AUTOMATE(automateId)
120
119
  );
121
120
  if (success) {
122
121
  setAutomate(automateData);
123
122
  setEnableScript(automateData.script.enable);
124
123
  }
125
- }, [id]);
124
+ }, [automateId]);
126
125
 
127
126
  const onPressEdit = useCallback(() => {
128
127
  navigate(Routes.EditActionsList, {
129
128
  data,
130
- id,
129
+ id: automateId,
131
130
  unitId: automate.unit,
132
131
  });
133
- }, [navigate, data, id, automate.unit]);
132
+ }, [navigate, data, automateId, automate.unit]);
134
133
 
135
134
  const handleScriptAction = useCallback(async () => {
136
- const { success } = await axiosPost(API.AUTOMATE.ACTION_ONE_TAP(id));
135
+ const { success } = await axiosPost(
136
+ API.AUTOMATE.ACTION_ONE_TAP(automateId)
137
+ );
137
138
  if (success) {
138
139
  ToastBottomHelper.success(t('activated_successfully'));
139
140
  } else {
140
141
  ToastBottomHelper.error(t('activation_failed'));
141
142
  }
142
- }, [id, t]);
143
+ }, [automateId, t]);
143
144
 
144
145
  const handleUpdateAutomate = useCallback(async () => {
145
146
  if (!can_edit) {
@@ -158,6 +159,19 @@ const ScriptDetail = ({ route }) => {
158
159
  });
159
160
  }, [automate, can_edit, enableScript, navigate, route.name, t]);
160
161
 
162
+ const handleGoBack = useCallback(async () => {
163
+ if (closeScreen === Routes.UnitDetail) {
164
+ navigate(closeScreen, { unitId: unit });
165
+ } else if (
166
+ closeScreen === Routes.MultiUnits ||
167
+ closeScreen === Routes.Automate
168
+ ) {
169
+ navigate(closeScreen, {});
170
+ } else {
171
+ goBack();
172
+ }
173
+ }, [closeScreen, goBack, navigate, unit]);
174
+
161
175
  const onChangeSwitch = useCallback(
162
176
  async (checked) => {
163
177
  setEnableScript(checked);
@@ -210,17 +224,13 @@ const ScriptDetail = ({ route }) => {
210
224
  saveAt && fetchAutomateActions();
211
225
  }, [saveAt, fetchAutomateActions]);
212
226
 
213
- useEffect(() => {
214
- newAutomate && setAutomate(newAutomate);
215
- }, [newAutomate]);
216
-
217
227
  return (
218
228
  <View style={styles.wrap}>
219
229
  <WrapHeaderScrollable
220
230
  title={name}
221
231
  headerAniStyle={styles.headerAniStyle}
222
232
  rightComponent={rightComponent}
223
- onGoBack={goBack}
233
+ onGoBack={handleGoBack}
224
234
  >
225
235
  <View style={styles.wrapContent}>
226
236
  {!!can_edit && (
@@ -228,7 +238,7 @@ const ScriptDetail = ({ route }) => {
228
238
  <Text type="H3" semibold>
229
239
  {t('enable_this_script')}
230
240
  </Text>
231
- <Switch checked={enableScript} onChange={onChangeSwitch} />
241
+ <Switch value={enableScript} onValueChange={onChangeSwitch} />
232
242
  </View>
233
243
  )}
234
244
  <Text type="H3" semibold>
@@ -479,9 +489,9 @@ const ButtonStar = ({ automate }) => {
479
489
  accessibilityLabel={AccessibilityLabel.HEADER_SCRIPT_DETAIL_BUTTON_STAR}
480
490
  >
481
491
  {isStarred ? (
482
- <AntDesign name="star" size={25} color={Colors.Yellow6} />
492
+ <IconFill name="star" size={25} color={Colors.Yellow6} />
483
493
  ) : (
484
- <AntDesign name="staro" size={25} />
494
+ <IconOutline name="star" size={25} />
485
495
  )}
486
496
  </PreventDoubleTouch>
487
497
  );
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { create, act } from 'react-test-renderer';
2
+ import { TouchableOpacity } from 'react-native';
3
+ import { act, create } from 'react-test-renderer';
3
4
  import { SCProvider } from '../../../../context';
4
5
  import { mockSCStore } from '../../../../context/mockStore';
5
- import { TouchableOpacity } from 'react-native';
6
6
  import SelectWeekday from '../components/SelectWeekday';
7
7
 
8
8
  const wrapComponent = (props) => (
@@ -28,7 +28,7 @@ it('test select', async () => {
28
28
  await act(async () => {
29
29
  await items[0].props.onPress();
30
30
  });
31
- expect(mockSetWeekday).toBeCalledWith(['1']);
31
+ expect(mockSetWeekday).toHaveBeenCalledWith(['1']);
32
32
 
33
33
  mockSetWeekday.mockClear();
34
34
  props = {
@@ -44,5 +44,5 @@ it('test select', async () => {
44
44
  await act(async () => {
45
45
  await items[0].props.onPress();
46
46
  });
47
- expect(mockSetWeekday).toBeCalledWith(['0', '1']);
47
+ expect(mockSetWeekday).toHaveBeenCalledWith(['0', '1']);
48
48
  });
@@ -1,34 +1,37 @@
1
+ import { useNavigation, useRoute } from '@react-navigation/native';
2
+ import moment from 'moment';
1
3
  import React from 'react';
2
4
  import { act, create } from 'react-test-renderer';
5
+ import BottomButtonView from '../../../../commons/BottomButtonView';
6
+ import Calendar from '../../../../commons/Calendar';
7
+ import WheelDateTimePicker from '../../../../commons/WheelDateTimePicker';
8
+ import AccessibilityLabel from '../../../../configs/AccessibilityLabel';
3
9
  import { SCProvider } from '../../../../context';
4
10
  import { mockSCStore } from '../../../../context/mockStore';
5
- import SetSchedule from '../index';
6
- import RowItem from '../components/RowItem';
7
- import WheelDateTimePicker from '../../../../commons/WheelDateTimePicker';
11
+ import Routes from '../../../../utils/Route';
8
12
  import RepeatOptionsPopup, {
9
13
  REPEAT_OPTIONS,
10
14
  } from '../components/RepeatOptionsPopup';
11
- import Calendar from '../../../../commons/Calendar';
12
- import BottomButtonView from '../../../../commons/BottomButtonView';
13
- import Routes from '../../../../utils/Route';
15
+ import RowItem from '../components/RowItem';
14
16
  import SelectWeekday from '../components/SelectWeekday';
15
- import moment from 'moment';
16
- import { useNavigation } from '@react-navigation/native';
17
- import AccessibilityLabel from '../../../../configs/AccessibilityLabel';
17
+ import SetSchedule from '../index';
18
18
 
19
- const wrapComponent = (route) => (
20
- <SCProvider initState={mockSCStore({})}>
21
- <SetSchedule route={route} />
22
- </SCProvider>
23
- );
19
+ const wrapComponent = (route) => {
20
+ useRoute.mockReturnValue(route);
21
+ return (
22
+ <SCProvider initState={mockSCStore({})}>
23
+ <SetSchedule route={route} />
24
+ </SCProvider>
25
+ );
26
+ };
24
27
 
25
28
  describe('Test SetSchedule', () => {
26
29
  let tree;
27
30
  let route = {
28
31
  params: {
29
- type: 'schedule',
30
- unit: { id: 1 },
31
- isAutomateTab: true,
32
+ automate: { type: 'schedule', unit: 1 },
33
+ unitId: 1,
34
+ closeScreen: 'UnitDetail',
32
35
  },
33
36
  };
34
37
 
@@ -70,7 +73,11 @@ describe('Test SetSchedule', () => {
70
73
  await act(async () => {
71
74
  await header.props.onPress();
72
75
  });
73
- expect(global.mockedNavigate).toBeCalledWith(undefined);
76
+ expect(global.mockedNavigate).toHaveBeenCalledWith('UnitDetail', {
77
+ automate: { type: 'schedule', unit: 1 },
78
+ closeScreen: 'UnitDetail',
79
+ unitId: 1,
80
+ });
74
81
  });
75
82
 
76
83
  it('test repeat options popup', async () => {
@@ -137,7 +144,11 @@ describe('Test SetSchedule', () => {
137
144
  repeat: 'once',
138
145
  time_repeat: '12:00:00',
139
146
  weekday_repeat: [],
147
+ type: 'schedule',
148
+ unit: 1,
140
149
  },
150
+ unitId: 1,
151
+ closeScreen: 'UnitDetail',
141
152
  });
142
153
  });
143
154
  });
@@ -1,9 +1,9 @@
1
+ import { IconOutline } from '@ant-design/icons-react-native';
1
2
  import React from 'react';
2
- import { View, TouchableOpacity } from 'react-native';
3
- import AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { TouchableOpacity, View } from 'react-native';
4
4
  import Text from '../../../../commons/Text';
5
- import styles from '../styles/RowItemStyles';
6
5
  import { Colors } from '../../../../configs';
6
+ import styles from '../styles/RowItemStyles';
7
7
 
8
8
  const RowItem = ({ title, value, icon = null, arrow = false, onPress }) => {
9
9
  return (
@@ -17,8 +17,8 @@ const RowItem = ({ title, value, icon = null, arrow = false, onPress }) => {
17
17
  </Text>
18
18
  </View>
19
19
  <View style={[styles.itemRight, arrow && styles.center]}>
20
- {arrow && <AntDesign name="right" color={Colors.Gray7} />}
21
- {icon && <AntDesign name={icon} size={17} color={Colors.Black} />}
20
+ {arrow && <IconOutline name="right" color={Colors.Gray7} />}
21
+ {icon && <IconOutline name={icon} size={17} color={Colors.Black} />}
22
22
  </View>
23
23
  </TouchableOpacity>
24
24
  );
@@ -1,19 +1,19 @@
1
- import React, { memo, useCallback, useState } from 'react';
2
- import { ScrollView } from 'react-native';
3
1
  import { useNavigation } from '@react-navigation/native';
4
2
  import moment from 'moment';
5
- import WheelDateTimePicker from '../../../commons/WheelDateTimePicker';
3
+ import React, { memo, useCallback, useState } from 'react';
4
+ import { ScrollView } from 'react-native';
6
5
  import Calendar from '../../../commons/Calendar';
6
+ import WheelDateTimePicker from '../../../commons/WheelDateTimePicker';
7
+ import { useBoolean } from '../../../hooks/Common';
8
+ import { useTranslations } from '../../../hooks/Common/useTranslations';
9
+ import Routes from '../../../utils/Route';
10
+ import NewActionWrapper from '../AddNewAction/NewActionWrapper';
7
11
  import RepeatOptionsPopup, {
8
12
  REPEAT_OPTIONS,
9
13
  } from './components/RepeatOptionsPopup';
10
14
  import RowItem from './components/RowItem';
11
15
  import SelectWeekday from './components/SelectWeekday';
12
- import { useBoolean } from '../../../hooks/Common';
13
- import { useTranslations } from '../../../hooks/Common/useTranslations';
14
16
  import styles from './styles/indexStyles';
15
- import Routes from '../../../utils/Route';
16
- import NewActionWrapper from '../AddNewAction/NewActionWrapper';
17
17
 
18
18
  const SetSchedule = ({ route }) => {
19
19
  const t = useTranslations();
@@ -54,6 +54,7 @@ const SetSchedule = ({ route }) => {
54
54
  date_repeat: date.format('YYYY-MM-DD'),
55
55
  weekday_repeat: weekday,
56
56
  },
57
+ unitId: automate.unit,
57
58
  });
58
59
  }, [navigate, closeScreen, automate, repeat, time, date, weekday]);
59
60
 
@@ -65,9 +65,9 @@ export default StyleSheet.create({
65
65
  width: (Constants.width - 40) / 2,
66
66
  },
67
67
  automatesRow: {
68
+ display: 'flex',
68
69
  flexDirection: 'row',
69
70
  marginTop: 8,
70
71
  overflow: 'hidden',
71
- alignSelf: 'center',
72
72
  },
73
73
  });
@@ -76,7 +76,6 @@ describe('Test MultiUnits', () => {
76
76
  params: {
77
77
  isMultiUnits: true,
78
78
  unitName: null,
79
- unit: null,
80
79
  },
81
80
  });
82
81
  await act(async () => {
@@ -111,7 +110,6 @@ describe('Test MultiUnits', () => {
111
110
  expect(global.mockedNavigate).toBeCalledWith(Routes.UnitStack, {
112
111
  screen: Routes.ScriptDetail,
113
112
  params: {
114
- id: response[1].id,
115
113
  preAutomate: response[1],
116
114
  },
117
115
  });
@@ -120,7 +118,7 @@ describe('Test MultiUnits', () => {
120
118
  ItemAddNews[0].props.onAddNew();
121
119
  });
122
120
  expect(global.mockedNavigate).toBeCalledWith(Routes.UnitStack, {
123
- screen: Routes.AddUnknownTypeSmart,
121
+ screen: Routes.AddAutomationTypeSmart,
124
122
  params: {
125
123
  automate: { unit: undefined },
126
124
  closeScreen: undefined,
@@ -264,7 +262,6 @@ describe('Test MultiUnits', () => {
264
262
  params: {
265
263
  isMultiUnits: true,
266
264
  unitName: null,
267
- unit: null,
268
265
  },
269
266
  });
270
267
  await act(async () => {
@@ -173,7 +173,6 @@ describe('Test Automate', () => {
173
173
  params: {
174
174
  preAutomate: response.data[0].automates[0],
175
175
  closeScreen: undefined,
176
- id: 1,
177
176
  },
178
177
  });
179
178
  });