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

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 +10 -9
  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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eohjsc/react-native-smart-city",
3
3
  "title": "React Native Smart Home",
4
- "version": "0.7.3-rc2",
4
+ "version": "0.7.3-rc21",
5
5
  "description": "TODO",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -52,9 +52,6 @@
52
52
  "publishConfig": {
53
53
  "registry": "https://registry.npmjs.org/"
54
54
  },
55
- "resolutions": {
56
- "graceful-fs": "^4.2.4"
57
- },
58
55
  "keywords": [
59
56
  "react-native"
60
57
  ],
@@ -62,9 +59,13 @@
62
59
  "license": "MIT",
63
60
  "licenseFilename": "LICENSE",
64
61
  "dependencies": {
62
+ "@ant-design/icons-react-native": "^2.3.2",
65
63
  "@babel/core": "^7.12.9",
66
64
  "@babel/helper-environment-visitor": "^7.16.7",
67
- "@babel/runtime": "^7.12.5",
65
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
66
+ "@babel/plugin-proposal-private-methods": "^7.18.6",
67
+ "@babel/plugin-transform-private-methods": "^7.24.7",
68
+ "@babel/runtime": "^7.20.0",
68
69
  "@eohjsc/react-native-keyboard-aware-scroll-view": "^0.9.5",
69
70
  "@formatjs/intl-getcanonicallocales": "^1.4.5",
70
71
  "@formatjs/intl-numberformat": "^5.6.2",
@@ -88,14 +89,14 @@
88
89
  "@react-navigation/native-stack": "^6.11.0",
89
90
  "@sentry/react-native": "^5.24.1",
90
91
  "@testing-library/react-hooks": "^6.0.0",
91
- "@types/jest": "^26.0.19",
92
+ "@types/jest": "^29.2.1",
92
93
  "@types/react": "^17.0.0",
93
94
  "@types/react-native": "^0.63.43",
94
95
  "@types/react-test-renderer": "^17.0.0",
95
96
  "apisauce": "^2.1.5",
96
97
  "axios": "^0.19.2",
97
98
  "axios-mock-adapter": "^1.21.1",
98
- "babel-jest": "^26.6.3",
99
+ "babel-jest": "^29.7.0",
99
100
  "base-64": "^1.0.0",
100
101
  "deprecated-react-native-prop-types": "^2.3.0",
101
102
  "detox": "^18.3.1",
@@ -110,13 +111,14 @@
110
111
  "husky": "^8.0.1",
111
112
  "i18n-js": "^3.7.1",
112
113
  "i18next": "^20.1.0",
113
- "jest": "^26.6.3",
114
- "jest-circus": "^26.6.3",
114
+ "jest": "^29",
115
+ "jest-circus": "^29",
116
+ "jest-environment-jsdom": "^29",
115
117
  "jetifier": "^1.6.6",
116
118
  "lint-staged": "^12.4.1",
117
119
  "lodash": "^4.17.19",
118
120
  "lottie-react-native": "^6.7.2",
119
- "metro-react-native-babel-preset": "^0.66.2",
121
+ "metro-react-native-babel-preset": "0.73.9",
120
122
  "moment": "^2.27.0",
121
123
  "moment-timezone": "^0.5.32",
122
124
  "node-html-parser": "^2.0.2",
@@ -147,7 +149,7 @@
147
149
  "react-native-dash": "^0.0.11",
148
150
  "react-native-deep-linking": "^2.2.0",
149
151
  "react-native-device-info": "^10.3.0",
150
- "react-native-draggable-flatlist": "^2.6.2",
152
+ "react-native-draggable-flatlist": "^4.0.1",
151
153
  "react-native-fast-image": "^8.6.3",
152
154
  "react-native-geocoder": "^0.5.0",
153
155
  "react-native-gesture-handler": "^2.17.1",
@@ -158,7 +160,7 @@
158
160
  "react-native-iphone-x-helper": "^1.2.1",
159
161
  "react-native-linear-gradient": "^2.5.6",
160
162
  "react-native-localize": "^1.4.1",
161
- "react-native-maps": "^1.15.6",
163
+ "react-native-maps": "1.17.3",
162
164
  "react-native-modal": "^13.0.1",
163
165
  "react-native-modal-datetime-picker": "^17.1.0",
164
166
  "react-native-new-snap-carousel": "^3.9.3",
@@ -169,10 +171,10 @@
169
171
  "react-native-permissions": "3.6.0",
170
172
  "react-native-popover-view": "^5.1.8",
171
173
  "react-native-progress": "^5.0.0",
172
- "react-native-reanimated": "3.3.0",
174
+ "react-native-reanimated": "3.8.1",
173
175
  "react-native-responsive-fontsize": "^0.5.1",
174
176
  "react-native-safe-area-context": "^3.1.1",
175
- "react-native-screens": "^3.32.0",
177
+ "react-native-screens": "3.32.0",
176
178
  "react-native-super-grid": "^4.0.3",
177
179
  "react-native-svg": "^12.1.0",
178
180
  "react-native-svg-transformer": "^0.14.3",
@@ -185,7 +187,7 @@
185
187
  "react-native-wheel-color-picker": "^1.2.0",
186
188
  "react-native-wheel-scrollview-picker": "^1.2.2",
187
189
  "react-native-wifi-reborn": "4.5.0",
188
- "react-test-renderer": "18.2.0",
190
+ "react-test-renderer": "18.3.1",
189
191
  "string-format": "^2.0.0",
190
192
  "sync-directory": "^5.1.7",
191
193
  "timezone-mock": "^1.1.3",
@@ -1,13 +1,13 @@
1
+ import { IconOutline } from '@ant-design/icons-react-native';
2
+ import { factory } from 'factory-girl';
1
3
  import React from 'react';
2
4
  import { TouchableOpacity } from 'react-native';
5
+ import Toast from 'react-native-toast-message';
3
6
  import { act, create } from 'react-test-renderer';
4
- import ItemQuickAction from '../ItemQuickAction';
5
7
  import { Colors } from '../../../configs';
6
8
  import { AccessibilityLabel } from '../../../configs/Constants';
7
- import { factory } from 'factory-girl';
8
9
  import IconComponent from '../../IconComponent';
9
- import Toast from 'react-native-toast-message';
10
- import AntDesign from 'react-native-vector-icons/AntDesign';
10
+ import ItemQuickAction from '../ItemQuickAction';
11
11
  class Sensor {}
12
12
 
13
13
  factory.define('Sensor', Sensor, {});
@@ -94,7 +94,7 @@ describe('Test ItemQuickAction', () => {
94
94
  await buttonOnActionPress.props.onPress();
95
95
  });
96
96
 
97
- const icon = instance.findByType(AntDesign);
97
+ const icon = instance.findByType(IconOutline);
98
98
  expect(icon.props.color).toEqual(Colors.TextGray);
99
99
  });
100
100
 
@@ -256,7 +256,7 @@ describe('Test ItemQuickAction', () => {
256
256
  await act(async () => {
257
257
  await buttonOnActionPress.props.onPress();
258
258
  });
259
- expect(Toast.show).not.toBeCalled();
259
+ expect(Toast.show).not.toHaveBeenCalled();
260
260
  });
261
261
  it('test config value 0 on_state_values 0', async () => {
262
262
  sensor.quick_action.on_state_values = [0];
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useEffect, useState } from 'react';
2
2
  import { View, TouchableOpacity, ActivityIndicator } 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
  import Text from '../Text';
@@ -116,7 +116,7 @@ const NumberUpDownActionTemplate = ({
116
116
  onPress={doActionDown}
117
117
  accessibilityLabel={AccessibilityLabel.NUMBER_ACTION_DOWN}
118
118
  >
119
- <AntDesign name="down" size={32} color={Colors.Primary} />
119
+ <IconOutline name="down" size={32} color={Colors.Primary} />
120
120
  </TouchableOpacity>
121
121
 
122
122
  <Text accessibilityLabel={'text_format'} type="H2">
@@ -132,7 +132,7 @@ const NumberUpDownActionTemplate = ({
132
132
  onPress={doActionUp}
133
133
  accessibilityLabel={AccessibilityLabel.NUMBER_ACTION_UP}
134
134
  >
135
- <AntDesign name="up" size={32} color={Colors.Primary} />
135
+ <IconOutline name="up" size={32} color={Colors.Primary} />
136
136
  </TouchableOpacity>
137
137
  </View>
138
138
  </View>
@@ -1,5 +1,5 @@
1
1
  import React, { memo } from 'react';
2
- import AntDesign from 'react-native-vector-icons/AntDesign';
2
+ import { IconOutline } from '@ant-design/icons-react-native';
3
3
  import { Switch, View } from 'react-native';
4
4
  import styles from './ButtonWrapperStyles';
5
5
  import Text from '../../../Text';
@@ -28,7 +28,7 @@ const ButtonWrapper = memo(
28
28
  </View>
29
29
  ) : (
30
30
  <View style={styles.wrapHeadline}>
31
- <AntDesign name={'lock'} size={20} color={Colors.Gray9} />
31
+ <IconOutline name={'lock'} size={20} color={Colors.Gray9} />
32
32
  <Text style={styles.textAutoLock}>
33
33
  {isButtonEnable ? t('auto_lock_enabled') : t('auto_lock_when')}
34
34
  </Text>
@@ -49,7 +49,7 @@ const ButtonWrapper = memo(
49
49
  <Text type="Body" style={styles.textValue}>
50
50
  {t('instant')}
51
51
  </Text>
52
- <AntDesign name="right" size={20} color={Colors.Gray7} />
52
+ <IconOutline name="right" size={20} color={Colors.Gray7} />
53
53
  </View>
54
54
  )}
55
55
  {isButtonReLockTiming && (
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { act, create } from 'react-test-renderer';
3
3
 
4
- import { mockSCStore } from '../../../../../context/mockStore';
4
+ import { useNavigation } from '@react-navigation/native';
5
+ import { TouchableOpacity } from 'react-native';
5
6
  import { AccessibilityLabel } from '../../../../../configs/Constants';
6
7
  import { SCProvider } from '../../../../../context';
7
- import PasscodeList from '../index';
8
- import { TouchableOpacity } from 'react-native';
8
+ import { mockSCStore } from '../../../../../context/mockStore';
9
9
  import Routes from '../../../../../utils/Route';
10
- import { useNavigation } from '@react-navigation/native';
10
+ import PasscodeList from '../index';
11
11
 
12
12
  const wrapComponent = () => (
13
13
  <SCProvider initState={mockSCStore({})}>
@@ -41,7 +41,7 @@ describe('Test SetupGeneratePasscode', () => {
41
41
  await act(async () => {
42
42
  await passcode_list[0].props.onPress();
43
43
  });
44
- expect(global.mockedNavigate).toBeCalledWith(Routes.SmartLockStack, {
44
+ expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.SmartLockStack, {
45
45
  screen: Routes.ItemPasscode,
46
46
  params: {
47
47
  item: { code: 123361, name: 'Do Loi' },
@@ -1,6 +1,6 @@
1
1
  import React, { memo, useCallback, useMemo } from 'react';
2
2
  import { TextInput, 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 { useNavigation } from '@react-navigation/native';
5
5
 
6
6
  import Text from '../../../Text';
@@ -39,7 +39,7 @@ const PasscodeList = memo(() => {
39
39
  <View style={styles.wrap}>
40
40
  <View style={styles.searchBox}>
41
41
  <View>
42
- <AntDesign name="search" size={24} style={styles.search} />
42
+ <IconOutline name="search" size={24} style={styles.search} />
43
43
  </View>
44
44
  <TextInput
45
45
  placeholder={t('search')}
@@ -58,7 +58,7 @@ const PasscodeList = memo(() => {
58
58
  <Text style={styles.textCode}>{item.code}</Text>
59
59
  <Text style={styles.textName}>{item.name}</Text>
60
60
  </View>
61
- <AntDesign name="right" size={20} color={Colors.Gray8} />
61
+ <IconOutline name="right" size={20} color={Colors.Gray8} />
62
62
  </TouchableOpacity>
63
63
  ))}
64
64
  </View>
@@ -1,5 +1,5 @@
1
1
  import React, { memo } from 'react';
2
- import AntDesign from 'react-native-vector-icons/AntDesign';
2
+ import { IconOutline } from '@ant-design/icons-react-native';
3
3
  import { Text, TouchableOpacity, View } from 'react-native';
4
4
 
5
5
  import { RadioCircle } from '../../..';
@@ -50,7 +50,7 @@ const ButtonWrapper = memo(
50
50
  {isButtonChooseUser && (
51
51
  <TouchableOpacity style={styles.buttonValue}>
52
52
  <Text style={styles.value}>{value}</Text>
53
- <AntDesign name="right" size={20} color={Colors.Gray8} />
53
+ <IconOutline name="right" size={20} color={Colors.Gray8} />
54
54
  </TouchableOpacity>
55
55
  )}
56
56
  {isButtonSetTime && (
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { View, Switch } 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 '../../Text';
6
6
  import styles from './OnOffSimpleTemplateStyle';
@@ -15,7 +15,7 @@ const OnOffSimpleTemplate = ({
15
15
  return (
16
16
  <View style={styles.wrap}>
17
17
  <View style={styles.iconAndText}>
18
- <AntDesign name="poweroff" size={20} style={styles.marginRight} />
18
+ <IconOutline name="poweroff" size={20} style={styles.marginRight} />
19
19
  <Text type="H4">{actionGroup.title}</Text>
20
20
  </View>
21
21
  {isOn !== null && (
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import { View, TouchableOpacity, ScrollView } 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
  import Text from '../../commons/Text';
@@ -139,7 +139,7 @@ const OptionsDropdownActionTemplate = ({
139
139
  >
140
140
  {displaySelected}
141
141
  </Text>
142
- <AntDesign name="right" size={20} />
142
+ <IconOutline name="right" size={20} />
143
143
  </TouchableOpacity>
144
144
  <AlertAction
145
145
  visible={stateAlert.visible}
@@ -48,18 +48,20 @@ const SliderRangeTemplate = memo(
48
48
  clearTimeout(timeout.current);
49
49
  if (value) {
50
50
  const data = parseInt(value, 10);
51
+ const numericValue = Math.min(max_value, Math.max(min_value, data));
52
+ setValue(numericValue);
51
53
  await doAction(
52
54
  action_data,
53
55
  JSON.stringify({
54
- value_brness: data,
55
- value: data,
56
+ value_brness: numericValue,
57
+ value: numericValue,
56
58
  })
57
59
  );
58
60
  }
59
61
  timeout.current = setTimeout(() => {
60
62
  setProcessing(false);
61
63
  }, 3000);
62
- }, [action_data, doAction, value]);
64
+ }, [action_data, doAction, max_value, min_value, value]);
63
65
 
64
66
  useEffect(() => {
65
67
  if (!processing) {
@@ -72,12 +74,10 @@ const SliderRangeTemplate = memo(
72
74
 
73
75
  const onInputChange = (text) => {
74
76
  if (text === '' || isNaN(text)) {
75
- setValue(min_value);
77
+ setValue(0);
76
78
  return;
77
79
  }
78
-
79
- const numericValue = Number(text);
80
- setValue(Math.min(max_value, Math.max(min_value, numericValue)));
80
+ setValue(Number(text));
81
81
  };
82
82
 
83
83
  return (
@@ -5,7 +5,7 @@ import styles from './SmartTiviActionTemplateStyles';
5
5
  import Text from '../../Text';
6
6
  import { Colors } from '../../../configs';
7
7
  import { SMART_TIVI_BUTTON } from '../../../configs/Constants';
8
- import AntDesign from 'react-native-vector-icons/AntDesign';
8
+ import { IconOutline } from '@ant-design/icons-react-native';
9
9
  import CircleButton from './component/CircleButton';
10
10
  import RectangleButton from './component/RectangleButton';
11
11
  import ControlPlay from './component/ControlPlay';
@@ -97,7 +97,7 @@ const SmartTiviActionTemplate = memo(
97
97
  <CircleButton
98
98
  type="small"
99
99
  icon={
100
- <AntDesign
100
+ <IconOutline
101
101
  name="poweroff"
102
102
  size={20}
103
103
  color={Colors.Gray6}
@@ -3,7 +3,7 @@ import { TouchableOpacity, View, Image } from 'react-native';
3
3
  import styles from './CircleButtonStyles';
4
4
  import Text from '../../../Text';
5
5
  import { Colors, Images } from '../../../../configs';
6
- import AntDesign from 'react-native-vector-icons/AntDesign';
6
+ import { IconOutline } from '@ant-design/icons-react-native';
7
7
  import { AccessibilityLabel } from '../../../../configs/Constants';
8
8
 
9
9
  const CircleButton = memo(
@@ -46,7 +46,7 @@ const CircleButton = memo(
46
46
  AccessibilityLabel.SMART_TIVI_TEMPLATE.UP_BUTTON
47
47
  }
48
48
  >
49
- <AntDesign size={14} name={'caretup'} />
49
+ <IconOutline size={14} name={'caret-up'} />
50
50
  </TouchableOpacity>
51
51
  </View>
52
52
  <View style={styles.bodyMultipleButton}>
@@ -57,7 +57,7 @@ const CircleButton = memo(
57
57
  AccessibilityLabel.SMART_TIVI_TEMPLATE.LEFT_BUTTON
58
58
  }
59
59
  >
60
- <AntDesign size={14} name={'caretleft'} />
60
+ <IconOutline size={14} name={'caret-left'} />
61
61
  </TouchableOpacity>
62
62
  <TouchableOpacity
63
63
  style={[styles.okButton]}
@@ -77,7 +77,7 @@ const CircleButton = memo(
77
77
  AccessibilityLabel.SMART_TIVI_TEMPLATE.RIGHT_BUTTON
78
78
  }
79
79
  >
80
- <AntDesign size={14} name={'caret-right'} />
80
+ <IconOutline size={14} name={'caret-right'} />
81
81
  </TouchableOpacity>
82
82
  </View>
83
83
  <View style={styles.footerMultipleButton}>
@@ -88,7 +88,7 @@ const CircleButton = memo(
88
88
  AccessibilityLabel.SMART_TIVI_TEMPLATE.DOWN_BUTTON
89
89
  }
90
90
  >
91
- <AntDesign size={14} name={'caretdown'} />
91
+ <IconOutline size={14} name={'caret-down'} />
92
92
  </TouchableOpacity>
93
93
  </View>
94
94
  </View>
@@ -6,7 +6,7 @@ import styles from './ControlPlayStyles';
6
6
  import { Pause } from './Icon';
7
7
  import { AccessibilityLabel } from '../../../../configs/Constants';
8
8
 
9
- import AntDesign from 'react-native-vector-icons/AntDesign';
9
+ import { IconOutline } from '@ant-design/icons-react-native';
10
10
 
11
11
  const ControlPlay = memo(
12
12
  ({ onPressPrev, onPressStop, onPressNext, wrapStyle }) => {
@@ -19,9 +19,9 @@ const ControlPlay = memo(
19
19
  AccessibilityLabel.SMART_TIVI_TEMPLATE.PREV_BUTTON
20
20
  }
21
21
  >
22
- <AntDesign
22
+ <IconOutline
23
23
  size={32}
24
- name={'stepbackward'}
24
+ name={'backward'}
25
25
  color={Colors.Gray9}
26
26
  style={[styles.button]}
27
27
  />
@@ -42,9 +42,9 @@ const ControlPlay = memo(
42
42
  AccessibilityLabel.SMART_TIVI_TEMPLATE.NEXT_BUTTON
43
43
  }
44
44
  >
45
- <AntDesign
45
+ <IconOutline
46
46
  size={32}
47
- name={'stepforward'}
47
+ name={'forward'}
48
48
  color={Colors.Gray9}
49
49
  style={[styles.button]}
50
50
  />
@@ -6,7 +6,7 @@ import React, {
6
6
  useState,
7
7
  } from 'react';
8
8
  import { View, TouchableOpacity } from 'react-native';
9
- import AntDesign from 'react-native-vector-icons/AntDesign';
9
+ import { IconOutline } from '@ant-design/icons-react-native';
10
10
  import Text from '../../commons/Text';
11
11
  import { useConfigGlobalState } from '../../iot/states';
12
12
  import styles from './TerminalBoxTemplateStyle';
@@ -174,7 +174,7 @@ const TerminalBoxTemplate = ({ item, doAction, isWidgetOrder }) => {
174
174
  accessibilityLabel={AccessibilityLabel.TERMINAL_BOX_BUTTON_SEND}
175
175
  disabled={!value}
176
176
  >
177
- <AntDesign name="send" size={25} />
177
+ <IconOutline name="send" size={25} />
178
178
  </TouchableOpacity>
179
179
  </View>
180
180
  </View>
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useMemo, 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
  import Text from '../../commons/Text';
5
5
  import { AlertAction } from '../../commons';
6
6
  import { useDropdownAction } from './hooks/useDropdownAction';
@@ -48,7 +48,7 @@ const TextBoxTemplate = ({ item, doAction, isWidgetOrder }) => {
48
48
  onPress={onShowAlert}
49
49
  accessibilityLabel={AccessibilityLabel.TEXT_BOX_BUTTON_EDIT}
50
50
  >
51
- <AntDesign name="edit" size={25} />
51
+ <IconOutline name="edit" size={25} />
52
52
  </TouchableOpacity>
53
53
  </View>
54
54
  <AlertAction
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import renderer, { act } from 'react-test-renderer';
3
2
  import { TouchableOpacity } from 'react-native';
3
+ import renderer, { act } from 'react-test-renderer';
4
4
 
5
5
  import { SCProvider } from '../../../../context';
6
6
  import { mockSCStore } from '../../../../context/mockStore';
@@ -47,6 +47,6 @@ describe('Test ThreeButtonCircle', () => {
47
47
  await act(async () => {
48
48
  touchableOpacities[0].props.onPress();
49
49
  });
50
- expect(mockOnButton1Press).toBeCalled();
50
+ expect(mockOnButton1Press).toHaveBeenCalled();
51
51
  });
52
52
  });
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import renderer, { act } from 'react-test-renderer';
3
2
  import { TouchableOpacity } from 'react-native';
3
+ import renderer, { act } from 'react-test-renderer';
4
4
 
5
5
  import { SCProvider } from '../../../../context';
6
6
  import { mockSCStore } from '../../../../context/mockStore';
@@ -47,6 +47,6 @@ describe('Test ThreeButtonDefault', () => {
47
47
  await act(async () => {
48
48
  touchableOpacities[0].props.onPress();
49
49
  });
50
- expect(mockOnButton1Press).toBeCalled();
50
+ expect(mockOnButton1Press).toHaveBeenCalled();
51
51
  });
52
52
  });
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useMemo, useState } from 'react';
2
2
  import { Switch, 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 DateTimePickerModal from 'react-native-modal-datetime-picker';
5
5
  import moment from 'moment';
6
6
  import { watchMultiConfigs } from '../../iot/Monitor';
@@ -183,7 +183,10 @@ const TimerActionTemplate = ({ item = {}, doAction, sensor = {} }) => {
183
183
  <Text>{title}</Text>
184
184
  {configuration.config_hour && configuration.config_minute && (
185
185
  <View style={styles.wrapTimer}>
186
- <AntDesign style={styles.iconClockCircle} name={'clock-circle'} />
186
+ <IconOutline
187
+ style={styles.iconClockCircle}
188
+ name={'clock-circle'}
189
+ />
187
190
  <Text type="Label" color={Colors.Gray7}>
188
191
  {textTimer ? textTimer : t('set_time')}
189
192
  </Text>
@@ -193,7 +196,7 @@ const TimerActionTemplate = ({ item = {}, doAction, sensor = {} }) => {
193
196
  {configuration.config_hour && !configuration.config_minute && (
194
197
  <View style={styles.timerButton}>
195
198
  <Text style={styles.textTimerEndLine}>{textTimer}</Text>
196
- <AntDesign name="right" size={20} />
199
+ <IconOutline name="right" size={20} />
197
200
  </View>
198
201
  )}
199
202
  </TouchableOpacity>
@@ -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, { memo, useState, useCallback, useEffect } from 'react';
3
3
  import { TouchableOpacity, View } from 'react-native';
4
4
 
@@ -122,7 +122,7 @@ const TwoButtonTemplate = memo(({ item = {}, doAction, sensor = {} }) => {
122
122
  key={index}
123
123
  >
124
124
  <View style={styles.smallCircle}>
125
- <AntDesign
125
+ <IconOutline
126
126
  name={button?.isCheckOnOff ? button?.icon_on : button?.icon_off}
127
127
  size={44}
128
128
  color={button?.isCheckOnOff ? Colors.Green7 : Colors.Gray6}
@@ -1,13 +1,12 @@
1
- import { watchMultiConfigs } from '../../../iot/Monitor';
2
1
  import React, { useContext } from 'react';
2
+ import ColorPicker from 'react-native-wheel-color-picker';
3
3
  import { act, create } from 'react-test-renderer';
4
- import ColorPickerTemplate from '../ColorPickerTemplate';
5
- import { WheelColorPicker } from '../ColorPickerTemplate';
4
+ import { DEVICE_TYPE } from '../../../configs/Constants';
6
5
  import { SCProvider } from '../../../context';
7
6
  import { mockSCStore } from '../../../context/mockStore';
7
+ import { watchMultiConfigs } from '../../../iot/Monitor';
8
8
  import { useConfigGlobalState } from '../../../iot/states';
9
- import ColorPicker from 'react-native-wheel-color-picker';
10
- import { DEVICE_TYPE } from '../../../configs/Constants';
9
+ import ColorPickerTemplate, { WheelColorPicker } from '../ColorPickerTemplate';
11
10
 
12
11
  const mockSetAction = jest.fn();
13
12
 
@@ -106,7 +105,7 @@ describe('Test ColorPickerTemplate', () => {
106
105
  await act(async () => {
107
106
  await wheelpicker.props.onStart();
108
107
  });
109
- expect(mockSetAction).toBeCalled();
108
+ expect(mockSetAction).toHaveBeenCalled();
110
109
  });
111
110
 
112
111
  it('test WheelColorPicker onChangeColorComplete', async () => {
@@ -123,13 +122,13 @@ describe('Test ColorPickerTemplate', () => {
123
122
  await act(async () => {
124
123
  await wheelpicker.props.onStart();
125
124
  });
126
- expect(mockSetAction).toBeCalledTimes(1);
127
- expect(mockDoAction).toBeCalledTimes(0);
125
+ expect(mockSetAction).toHaveBeenCalledTimes(1);
126
+ expect(mockDoAction).toHaveBeenCalledTimes(0);
128
127
 
129
128
  await act(async () => {
130
129
  await wheelpicker.props.onChangeColorComplete('#ffffff');
131
130
  });
132
- expect(mockSetAction).toBeCalledTimes(2);
133
- expect(mockDoAction).toBeCalledTimes(1);
131
+ expect(mockSetAction).toHaveBeenCalledTimes(2);
132
+ expect(mockDoAction).toHaveBeenCalledTimes(1);
134
133
  });
135
134
  });
@@ -1,11 +1,11 @@
1
- import { AccessibilityLabel } from '../../../configs/Constants';
2
- import { watchMultiConfigs } from '../../../iot/Monitor';
3
1
  import React from 'react';
4
2
  import { act, create } from 'react-test-renderer';
5
- import OnOffSmartLock from '../OnOffSmartLock/OnOffSmartLock';
3
+ import { AccessibilityLabel } from '../../../configs/Constants';
6
4
  import { SCProvider } from '../../../context';
7
5
  import { mockSCStore } from '../../../context/mockStore';
6
+ import { watchMultiConfigs } from '../../../iot/Monitor';
8
7
  import { useConfigGlobalState } from '../../../iot/states';
8
+ import OnOffSmartLock from '../OnOffSmartLock/OnOffSmartLock';
9
9
 
10
10
  jest.mock('../../../iot/Monitor');
11
11
  const mockDoAction = jest.fn();
@@ -76,7 +76,7 @@ describe('Test OnOffTemplate', () => {
76
76
  await act(async () => {
77
77
  await button.props.onPress();
78
78
  });
79
- expect(mockDoAction).toBeCalledWith(actionOnData, '{"door_lock":0}');
79
+ expect(mockDoAction).toHaveBeenCalledWith(actionOnData, '{"door_lock":0}');
80
80
  });
81
81
 
82
82
  it('render with template OnOffSmartLockActionTemplate doAction unlock', async () => {
@@ -96,6 +96,6 @@ describe('Test OnOffTemplate', () => {
96
96
  await act(async () => {
97
97
  await button.props.onPress();
98
98
  });
99
- expect(mockDoAction).toBeCalledWith(actionOffData, '{"door_lock":1}');
99
+ expect(mockDoAction).toHaveBeenCalledWith(actionOffData, '{"door_lock":1}');
100
100
  });
101
101
  });