@eohjsc/react-native-smart-city 0.2.97 → 0.3.0
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.
- package/README.md +35 -14
- package/package.json +4 -2
- package/src/commons/Action/ItemQuickAction.js +5 -2
- package/src/commons/ActionGroup/ColorPickerTemplate.js +1 -1
- package/src/commons/ActionGroup/CurtainButtonTemplate.js +10 -5
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +12 -4
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +4 -0
- package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLock.js +7 -4
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/ItemPasscode.test.js +24 -0
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +14 -0
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +1 -0
- package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +10 -10
- package/src/commons/ActionGroup/OnOffTemplate/index.js +18 -15
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +9 -3
- package/src/commons/ActionGroup/SliderRangeTemplate.js +1 -1
- package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +4 -1
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +22 -8
- package/src/commons/ActionGroup/TimerActionTemplate.js +11 -3
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +13 -9
- package/src/commons/ActionGroup/__test__/CurtainButtonTemplate.test.js +53 -4
- package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +14 -14
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +53 -78
- package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +36 -20
- package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +77 -0
- package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +58 -6
- package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +49 -1
- package/src/commons/ActionGroup/__test__/index.test.js +135 -0
- package/src/commons/Auth/AccountList.js +1 -1
- package/src/commons/Automate/ItemAutomate.js +1 -3
- package/src/commons/Calendar/__test__/Calendar.test.js +33 -0
- package/src/commons/Connecting/__test__/Connecting.test.js +19 -2
- package/src/commons/ConnectingProcess/__test__/Connecting.test.js +136 -3
- package/src/commons/ConnectingProcess/index.js +1 -1
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +16 -13
- package/src/commons/Dashboard/MyPinnedSharedUnit/index.js +1 -1
- package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +0 -5
- package/src/commons/Device/Hanet/ItemHanetDevice.test.js +58 -0
- package/src/commons/Device/HistoryChart.js +4 -0
- package/src/commons/Device/LinearChart.js +15 -0
- package/src/commons/Device/PMSensor/PMSensorIndicatior.js +16 -12
- package/src/commons/Device/PMSensor/PMSensorIndicatorStyles.js +3 -0
- package/src/commons/Device/WaterQualitySensor/ListQualityIndicator.js +1 -0
- package/src/commons/Explore/__test__/CityItem.test.js +33 -54
- package/src/commons/FieldTemplate/ChooseUserField/ChooseFieldStyles.js +25 -0
- package/src/commons/FieldTemplate/ChooseUserField/ChoosePopup.js +96 -0
- package/src/commons/FieldTemplate/ChooseUserField/ChoosePopupStyles.js +39 -0
- package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +118 -0
- package/src/commons/FieldTemplate/ChooseUserField/index.js +62 -0
- package/src/commons/FieldTemplate/PasscodeField/PasscodeFieldStyles.js +30 -0
- package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +90 -0
- package/src/commons/FieldTemplate/PasscodeField/index.js +43 -0
- package/src/commons/FieldTemplate/ScheduleField/ScheduleFieldStyles.js +13 -0
- package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +179 -0
- package/src/commons/FieldTemplate/ScheduleField/index.js +176 -0
- package/src/commons/FullLoading/index.js +2 -1
- package/src/commons/MenuActionAddnew/index.js +1 -0
- package/src/commons/MenuActionList/index.js +1 -0
- package/src/commons/MenuActionMore/index.js +1 -1
- package/src/commons/PreventAccess/__test__/PreventAccess.test.js +62 -0
- package/src/commons/PreventAccess/index.js +9 -1
- package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +0 -1
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +8 -35
- package/src/commons/SubUnit/OneTap/index.js +1 -2
- package/src/commons/Unit/SharedUnit.js +1 -0
- package/src/commons/Unit/__test__/SharedUnit.test.js +38 -183
- package/src/commons/WheelDateTimePicker/index.js +2 -1
- package/src/configs/API.js +87 -138
- package/src/configs/Constants.js +27 -1
- package/src/configs/SCConfig.js +2 -0
- package/src/iot/RemoteControl/__test__/GoogleHome.test.js +8 -30
- package/src/iot/RemoteControl/__test__/Internet.test.js +18 -7
- package/src/iot/RemoteControl/__test__/LgThinq.test.js +36 -177
- package/src/navigations/UnitStack.js +8 -0
- package/src/screens/AQIGuide/index.js +1 -1
- package/src/screens/ActivityLog/FilterPopup.js +2 -0
- package/src/screens/ActivityLog/__test__/index.test.js +38 -23
- package/src/screens/ActivityLog/hooks/__test__/index.test.js +51 -90
- package/src/screens/ActivityLog/index.js +2 -2
- package/src/screens/AddCommon/SelectSubUnit.js +1 -0
- package/src/screens/AddCommon/SelectUnit.js +1 -0
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +13 -24
- package/src/screens/AddCommon/__test__/SelectUnit.test.js +9 -33
- package/src/screens/AddLocationMaps/index.js +4 -1
- package/src/screens/AddNewAction/SelectSensorDevices.js +8 -2
- package/src/screens/AddNewAction/__test__/SelectAction.test.js +10 -91
- package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +40 -26
- package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +3 -1
- package/src/screens/AddNewAutoSmart/index.js +5 -2
- package/src/screens/AddNewDevice/ConnectingDevices.js +3 -3
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +34 -33
- package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +0 -4
- package/src/screens/AddNewDevice/__test__/ConnectingDevices.test.js +21 -21
- package/src/screens/AddNewDevice/index.js +1 -0
- package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +4 -1
- package/src/screens/AddNewGateway/SelectGateway.js +1 -0
- package/src/screens/AddNewGateway/SetupGatewayWifi.js +1 -0
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +4 -6
- package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +0 -4
- package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +5 -29
- package/src/screens/AddNewGateway/__test__/SelectGateway.test.js +0 -4
- package/src/screens/AddNewGateway/__test__/SetupGateway.test.js +0 -4
- package/src/screens/AddNewGateway/index.js +1 -0
- package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +10 -24
- package/src/screens/AddNewOneTap/index.js +3 -2
- package/src/screens/Automate/__test__/MultiUnits.test.js +6 -9
- package/src/screens/Automate/__test__/index.test.js +7 -12
- package/src/screens/Automate/index.js +2 -0
- package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +36 -8
- package/src/screens/ConfirmUnitDeletion/index.js +7 -1
- package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +71 -22
- package/src/screens/Device/__test__/detail.test.js +23 -84
- package/src/screens/Device/detail.js +31 -8
- package/src/screens/Device/hooks/useFavoriteDevice.js +5 -9
- package/src/screens/DeviceInfo/__test__/index.test.js +0 -2
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +6 -3
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +7 -19
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +20 -2
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +40 -23
- package/src/screens/EmergencySetting/index.js +4 -1
- package/src/screens/EnterPassword/__test__/EnterPassword.test.js +41 -25
- package/src/screens/Explore/index.js +2 -0
- package/src/screens/GuestInfo/__test__/index.test.js +14 -41
- package/src/screens/GuestInfo/components/RecurringDetail.js +1 -0
- package/src/screens/GuestInfo/components/TemporaryDetail.js +2 -2
- package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +8 -12
- package/src/screens/HanetCamera/__test__/Detail.test.js +27 -42
- package/src/screens/HanetCamera/__test__/ManageAccess.test.js +8 -5
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +10 -32
- package/src/screens/HanetCamera/hooks/__test__/useHanetCheckinData.test.js +43 -35
- package/src/screens/HanetCamera/hooks/__test__/useHanetPlaceMembers.test.js +10 -21
- package/src/screens/ManageAccess/__test__/ManageAccess.test.js +33 -22
- package/src/screens/ManageAccess/hooks/__test__/useManageAccess.test.js +44 -45
- package/src/screens/ManageAccess/index.js +2 -1
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +35 -12
- package/src/screens/MoveToAnotherSubUnit/index.js +5 -5
- package/src/screens/Notification/__test__/Notification.test.js +14 -25
- package/src/screens/Notification/__test__/NotificationItem.test.js +4 -3
- package/src/screens/PlayBackCamera/__test__/index.test.js +87 -2
- package/src/screens/PlayBackCamera/index.js +19 -3
- package/src/screens/ScanChipQR/__test__/ScanChipQR.test.js +7 -20
- package/src/screens/ScanChipQR/components/QRScan/index.js +1 -0
- package/src/screens/ScanSensorQR/__test__/ScanSensorQR.test.js +8 -24
- package/src/screens/ScriptDetail/__test__/index.test.js +17 -86
- package/src/screens/ScriptDetail/index.js +5 -4
- package/src/screens/SelectUnit/__test__/index.test.js +12 -55
- package/src/screens/SelectUnit/index.js +5 -2
- package/src/screens/SetSchedule/index.js +6 -2
- package/src/screens/SharedUnit/__test__/TabHeader.test.js +0 -2
- package/src/screens/SharedUnit/index.js +2 -0
- package/src/screens/Sharing/InfoMemberUnit.js +1 -1
- package/src/screens/Sharing/MemberList.js +12 -11
- package/src/screens/Sharing/SelectPermission.js +107 -70
- package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +47 -29
- package/src/screens/Sharing/__test__/MemberList.test.js +13 -127
- package/src/screens/Sharing/__test__/MemberList2.test.js +80 -0
- package/src/screens/Sharing/__test__/SelectPermission.test.js +28 -38
- package/src/screens/Sharing/__test__/SelectUser.test.js +17 -38
- package/src/screens/Sharing/hooks/index.js +3 -0
- package/src/screens/SideMenuDetail/SideMenuDetailStyles.js +28 -0
- package/src/screens/SideMenuDetail/__test__/index.test.js +154 -0
- package/src/screens/SideMenuDetail/index.js +149 -0
- package/src/screens/SmartIr/components/SelectBrand.js +1 -1
- package/src/screens/SubUnit/ManageSubUnit.js +1 -0
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +21 -67
- package/src/screens/SubUnit/__test__/Detail.test.js +31 -8
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +21 -89
- package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +47 -44
- package/src/screens/SyncLGDevice/AddLGDevice.js +1 -0
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +14 -90
- package/src/screens/TDSGuide/index.js +4 -1
- package/src/screens/UVIndexGuide/index.js +1 -1
- package/src/screens/Unit/ChooseLocation.js +1 -1
- package/src/screens/Unit/ManageUnit.js +1 -0
- package/src/screens/Unit/SelectAddress.js +4 -1
- package/src/screens/Unit/Station/index.js +1 -0
- package/src/screens/Unit/Summaries.js +1 -1
- package/src/screens/Unit/__test__/CheckSendEmail.test.js +15 -28
- package/src/screens/Unit/__test__/ChooseLocation.test.js +27 -14
- package/src/screens/Unit/__test__/Detail.test.js +83 -185
- package/src/screens/Unit/__test__/ManageUnit.test.js +18 -42
- package/src/screens/Unit/__test__/SelectAddress.test.js +13 -39
- package/src/screens/Unit/__test__/SmartAccount.test.js +17 -9
- package/src/screens/Unit/__test__/SmartAccountItem.test.js +0 -1
- package/src/screens/Unit/components/MyAllUnit/__test__/MyAllUnit.test.js +36 -0
- package/src/screens/Unit/components/MyAllUnit/__test__/index.test.js +54 -0
- package/src/screens/Unit/components/SharedUnit/index.js +1 -0
- package/src/screens/Unit/components/__test__/SharedUnit.test.js +31 -34
- package/src/screens/UnitSummary/__test__/index.test.js +38 -31
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/__test__/index.test.js +7 -4
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +14 -16
- package/src/screens/WaterQualityGuide/index.js +1 -1
- package/src/utils/Apis/axios.js +37 -13
- package/src/utils/I18n/translations/en.json +1 -0
- package/src/utils/I18n/translations/vi.json +1 -0
- package/src/utils/Route/index.js +1 -0
- package/src/utils/Utils.js +6 -6
|
@@ -23,7 +23,7 @@ const keyExtractor = (item) => item.id;
|
|
|
23
23
|
|
|
24
24
|
const ActivityLogScreen = ({ route }) => {
|
|
25
25
|
const t = useTranslations();
|
|
26
|
-
const { id, type, share, filterEnabled } = route.params;
|
|
26
|
+
const { id, type, share, filterEnabled } = route.params || {};
|
|
27
27
|
const {
|
|
28
28
|
data,
|
|
29
29
|
isLoading,
|
|
@@ -118,7 +118,7 @@ const ActivityLogScreen = ({ route }) => {
|
|
|
118
118
|
onMomentumScrollBegin={onMomentumScrollBegin}
|
|
119
119
|
/>
|
|
120
120
|
</View>
|
|
121
|
-
{(filterEnabled
|
|
121
|
+
{(filterEnabled?.user || filterEnabled?.date) && (
|
|
122
122
|
<FilterPopup
|
|
123
123
|
isVisible={showFilterPopup}
|
|
124
124
|
onHide={setHideFilterPopup}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderer, { act } from 'react-test-renderer';
|
|
3
3
|
import { TouchableOpacity } from 'react-native';
|
|
4
|
+
import MockAdapter from 'axios-mock-adapter';
|
|
5
|
+
|
|
4
6
|
import AddCommonSelectSubUnit from '../SelectSubUnit';
|
|
5
7
|
import { ViewButtonBottom } from '../../../commons';
|
|
6
8
|
import { SCProvider } from '../../../context';
|
|
7
9
|
import { mockSCStore } from '../../../context/mockStore';
|
|
8
10
|
import Text from '../../../commons/Text';
|
|
9
|
-
import axios from 'axios';
|
|
10
11
|
import { TESTID } from '../../../configs/Constants';
|
|
12
|
+
import api from '../../../utils/Apis/axios';
|
|
13
|
+
import { API } from '../../../configs';
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
const mock = new MockAdapter(api.axiosInstance);
|
|
13
16
|
|
|
14
17
|
const mockedGoBack = jest.fn();
|
|
15
18
|
const mockedNavigate = jest.fn();
|
|
@@ -95,18 +98,10 @@ describe('Test SelectSubUnit container', () => {
|
|
|
95
98
|
});
|
|
96
99
|
test(`press next to navigate ${type}`, async () => {
|
|
97
100
|
const route = { params: { addType: type } };
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
{ id: 1, name: 'Unit 1' },
|
|
103
|
-
{ id: 2, name: 'Unit 2' },
|
|
104
|
-
],
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
axios.get.mockImplementation(async () => {
|
|
108
|
-
return response;
|
|
109
|
-
});
|
|
101
|
+
mock.onGet(API.UNIT.UNIT_DETAIL(1)).reply(200, [
|
|
102
|
+
{ id: 1, name: 'Unit 1' },
|
|
103
|
+
{ id: 2, name: 'Unit 2' },
|
|
104
|
+
]);
|
|
110
105
|
|
|
111
106
|
await act(async () => {
|
|
112
107
|
tree = renderer.create(wrapComponent(route));
|
|
@@ -159,19 +154,13 @@ describe('Test SelectSubUnit container', () => {
|
|
|
159
154
|
break;
|
|
160
155
|
case 'AddDeviceNewFlow':
|
|
161
156
|
expect(mockedNavigate).toBeCalledWith('ConnectingProcess', {
|
|
157
|
+
devicePrefixName: undefined,
|
|
162
158
|
gateway: undefined,
|
|
163
159
|
scan_sensor_data: undefined,
|
|
164
160
|
station: undefined,
|
|
165
|
-
unit: [
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
name: 'Unit 1',
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
id: 2,
|
|
172
|
-
name: 'Unit 2',
|
|
173
|
-
},
|
|
174
|
-
],
|
|
161
|
+
unit: [],
|
|
162
|
+
wifi_pass: undefined,
|
|
163
|
+
wifi_ssid: undefined,
|
|
175
164
|
});
|
|
176
165
|
break;
|
|
177
166
|
default:
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderer, { act } from 'react-test-renderer';
|
|
3
3
|
import { TouchableOpacity, Platform } from 'react-native';
|
|
4
|
-
import
|
|
4
|
+
import MockAdapter from 'axios-mock-adapter';
|
|
5
5
|
|
|
6
6
|
import AddCommonSelectUnit from '../SelectUnit';
|
|
7
7
|
import Text from '../../../commons/Text';
|
|
8
8
|
import { TESTID } from '../../../configs/Constants';
|
|
9
9
|
import { SCProvider } from '../../../context';
|
|
10
10
|
import { mockSCStore } from '../../../context/mockStore';
|
|
11
|
+
import api from '../../../utils/Apis/axios';
|
|
12
|
+
import { API } from '../../../configs';
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
const mock = new MockAdapter(api.axiosInstance);
|
|
13
15
|
|
|
14
16
|
const mockedGoBack = jest.fn();
|
|
15
17
|
const mockedNavigate = jest.fn();
|
|
@@ -86,11 +88,7 @@ describe('Test SelectUnit container', () => {
|
|
|
86
88
|
{ id: 2, name: 'Unit 2' },
|
|
87
89
|
],
|
|
88
90
|
};
|
|
89
|
-
|
|
90
|
-
axios.get.mockImplementation(async () => {
|
|
91
|
-
return response;
|
|
92
|
-
});
|
|
93
|
-
|
|
91
|
+
mock.onGet(API.SHARE.UNITS()).reply(200, response.data);
|
|
94
92
|
await act(async () => {
|
|
95
93
|
tree = renderer.create(wrapComponent(route));
|
|
96
94
|
});
|
|
@@ -151,10 +149,6 @@ describe('Test SelectUnit container', () => {
|
|
|
151
149
|
describe('test single SelectUnit', () => {
|
|
152
150
|
let tree;
|
|
153
151
|
|
|
154
|
-
beforeEach(() => {
|
|
155
|
-
axios.get.mockClear();
|
|
156
|
-
});
|
|
157
|
-
|
|
158
152
|
test('fetch Unit success', async () => {
|
|
159
153
|
Platform.OS = 'android';
|
|
160
154
|
const route = { params: { addType: 'AddSubUnit' } };
|
|
@@ -166,15 +160,10 @@ describe('test single SelectUnit', () => {
|
|
|
166
160
|
{ id: 2, name: 'Unit 2' },
|
|
167
161
|
],
|
|
168
162
|
};
|
|
169
|
-
|
|
170
|
-
axios.get.mockImplementation(async () => {
|
|
171
|
-
return response;
|
|
172
|
-
});
|
|
173
|
-
|
|
163
|
+
mock.onGet(API.SHARE.UNITS()).reply(200, response.data);
|
|
174
164
|
await act(async () => {
|
|
175
165
|
tree = renderer.create(wrapComponent(route));
|
|
176
166
|
});
|
|
177
|
-
|
|
178
167
|
const instance = tree.root;
|
|
179
168
|
const unitName = instance.findAll(
|
|
180
169
|
(item) =>
|
|
@@ -183,35 +172,23 @@ describe('test single SelectUnit', () => {
|
|
|
183
172
|
const radioButton = instance.findAll(
|
|
184
173
|
(item) => item.props.testID === TESTID.SELECT_UNIT_RADIO_BUTTON
|
|
185
174
|
);
|
|
186
|
-
|
|
187
175
|
expect(unitName[0].props.children).toBe('Unit 1');
|
|
188
176
|
expect(unitName[1].props.children).toBe('Unit 2');
|
|
189
177
|
expect(radioButton[0].props.active).toBeFalsy();
|
|
190
178
|
expect(radioButton[1].props.active).toBeFalsy();
|
|
191
|
-
|
|
192
179
|
const selectUnit = instance.findAll(
|
|
193
180
|
(item) => item.props.testID === TESTID.SELECT_UNIT_SELECT
|
|
194
181
|
);
|
|
195
|
-
|
|
196
182
|
await act(async () => {
|
|
197
183
|
selectUnit[0].props.onPress();
|
|
198
184
|
});
|
|
199
|
-
|
|
200
185
|
expect(radioButton[0].props.active).toBeTruthy();
|
|
201
186
|
});
|
|
202
187
|
|
|
203
188
|
test('fetch Unit not success', async () => {
|
|
204
189
|
Platform.OS = 'ios';
|
|
205
190
|
const route = { params: { addType: 'AddSubUnit' } };
|
|
206
|
-
|
|
207
|
-
status: 500,
|
|
208
|
-
success: false,
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
axios.get.mockImplementation(async () => {
|
|
212
|
-
return response;
|
|
213
|
-
});
|
|
214
|
-
|
|
191
|
+
mock.onGet(500);
|
|
215
192
|
await act(async () => {
|
|
216
193
|
tree = renderer.create(wrapComponent(route));
|
|
217
194
|
});
|
|
@@ -224,9 +201,8 @@ describe('test single SelectUnit', () => {
|
|
|
224
201
|
const radioButton = instance.findAll(
|
|
225
202
|
(item) => item.props.testID === TESTID.SELECT_UNIT_RADIO_BUTTON
|
|
226
203
|
);
|
|
227
|
-
|
|
228
|
-
expect(
|
|
229
|
-
expect(radioButton).toHaveLength(0);
|
|
204
|
+
expect(unitName).toHaveLength(2);
|
|
205
|
+
expect(radioButton).toHaveLength(2);
|
|
230
206
|
});
|
|
231
207
|
|
|
232
208
|
test('click goBack', async () => {
|
|
@@ -169,7 +169,10 @@ const AddLocationMaps = memo(() => {
|
|
|
169
169
|
</Text>
|
|
170
170
|
<View style={styles.searchLocation}>
|
|
171
171
|
<SearchBarLocation input={input} onTextInput={onTextInput} />
|
|
172
|
-
<ScrollView
|
|
172
|
+
<ScrollView
|
|
173
|
+
style={styles.searchData}
|
|
174
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
175
|
+
>
|
|
173
176
|
{searchData.map((item) => (
|
|
174
177
|
<RowLocation item={item} onPress={onPressRowLocation} />
|
|
175
178
|
))}
|
|
@@ -28,6 +28,7 @@ const SelectSensorDevices = memo(({ route }) => {
|
|
|
28
28
|
isAutomateTab,
|
|
29
29
|
isCreateNewAction,
|
|
30
30
|
isMultiUnits,
|
|
31
|
+
oldType,
|
|
31
32
|
} = route.params;
|
|
32
33
|
|
|
33
34
|
const [listStation, setListStation] = useState([]);
|
|
@@ -137,7 +138,7 @@ const SelectSensorDevices = memo(({ route }) => {
|
|
|
137
138
|
navigate(Routes.ScriptDetail, {
|
|
138
139
|
id: automateId,
|
|
139
140
|
name: scriptName,
|
|
140
|
-
type:
|
|
141
|
+
type: oldType,
|
|
141
142
|
havePermission: true,
|
|
142
143
|
unit,
|
|
143
144
|
isMultiUnits,
|
|
@@ -175,6 +176,7 @@ const SelectSensorDevices = memo(({ route }) => {
|
|
|
175
176
|
<ScrollView
|
|
176
177
|
style={styles.wrap}
|
|
177
178
|
contentContainerStyle={styles.contentContainerStyle}
|
|
179
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
178
180
|
>
|
|
179
181
|
<Text bold type="H2" style={styles.title}>
|
|
180
182
|
{t(title)}
|
|
@@ -216,7 +218,11 @@ const SelectSensorDevices = memo(({ route }) => {
|
|
|
216
218
|
style={styles.bottomButtonView}
|
|
217
219
|
mainTitle={t('continue')}
|
|
218
220
|
onPressMain={onPressContinue}
|
|
219
|
-
typeMain={
|
|
221
|
+
typeMain={
|
|
222
|
+
Object.keys(selectedDevice || {}).length === 0
|
|
223
|
+
? 'disabled'
|
|
224
|
+
: 'primary'
|
|
225
|
+
}
|
|
220
226
|
/>
|
|
221
227
|
</View>
|
|
222
228
|
);
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderer, { act } from 'react-test-renderer';
|
|
3
|
-
import
|
|
3
|
+
import MockAdapter from 'axios-mock-adapter';
|
|
4
4
|
|
|
5
5
|
import SelectAction from '../SelectAction';
|
|
6
6
|
import { SCProvider } from '../../../context';
|
|
7
7
|
import { mockSCStore } from '../../../context/mockStore';
|
|
8
8
|
import BottomButtonView from '../../../commons/BottomButtonView';
|
|
9
9
|
import { TESTID } from '../../../configs/Constants';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import OptionsDropdownActionTemplate from '../../../commons/OneTapTemplate/OptionsDropdownActionTemplate';
|
|
13
|
-
import StatesGridActionTemplate from '../../../commons/OneTapTemplate/StatesGridActionTemplate';
|
|
10
|
+
import api from '../../../utils/Apis/axios';
|
|
11
|
+
import { API } from '../../../configs';
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
const mock = new MockAdapter(api.axiosInstance);
|
|
16
14
|
|
|
17
15
|
const mockedNavigate = jest.fn();
|
|
18
16
|
jest.mock('@react-navigation/native', () => {
|
|
@@ -49,38 +47,21 @@ describe('Test SelectAction', () => {
|
|
|
49
47
|
},
|
|
50
48
|
};
|
|
51
49
|
|
|
52
|
-
beforeEach(() => {
|
|
53
|
-
axios.get.mockClear();
|
|
54
|
-
});
|
|
55
|
-
|
|
56
50
|
test('test onSave have automateId', async () => {
|
|
57
|
-
|
|
58
|
-
status: 200,
|
|
59
|
-
success: true,
|
|
60
|
-
};
|
|
61
|
-
axios.post.mockImplementation(async () => {
|
|
62
|
-
return response;
|
|
63
|
-
});
|
|
51
|
+
mock.onPost(API.AUTOMATE.ADD_SCRIPT_ACTION(1)).reply(200);
|
|
64
52
|
await act(async () => {
|
|
65
53
|
tree = await renderer.create(wrapComponent(route));
|
|
66
54
|
});
|
|
67
55
|
const instance = tree.root;
|
|
68
|
-
|
|
69
56
|
const bottomButton = instance.findByType(BottomButtonView);
|
|
70
57
|
await act(async () => {
|
|
71
58
|
bottomButton.props.onPressMain();
|
|
72
59
|
});
|
|
73
|
-
expect(axios.post).toHaveBeenCalled();
|
|
74
60
|
expect(mockedNavigate).toHaveBeenCalled();
|
|
75
61
|
});
|
|
76
62
|
|
|
77
63
|
test('test onSave fail not permission', async () => {
|
|
78
|
-
|
|
79
|
-
status: 404,
|
|
80
|
-
};
|
|
81
|
-
axios.post.mockImplementation(async () => {
|
|
82
|
-
return response;
|
|
83
|
-
});
|
|
64
|
+
mock.onPost(API.AUTOMATE.ADD_SCRIPT_ACTION(1)).reply(404);
|
|
84
65
|
await act(async () => {
|
|
85
66
|
tree = await renderer.create(wrapComponent(route));
|
|
86
67
|
});
|
|
@@ -90,7 +71,7 @@ describe('Test SelectAction', () => {
|
|
|
90
71
|
await act(async () => {
|
|
91
72
|
bottomButton.props.onPressMain();
|
|
92
73
|
});
|
|
93
|
-
expect(
|
|
74
|
+
expect(mockedNavigate).toHaveBeenCalled();
|
|
94
75
|
});
|
|
95
76
|
|
|
96
77
|
test('test fetchData', async () => {
|
|
@@ -103,13 +84,11 @@ describe('Test SelectAction', () => {
|
|
|
103
84
|
{ template: 'three_button_action_template' },
|
|
104
85
|
],
|
|
105
86
|
};
|
|
106
|
-
|
|
107
|
-
return response;
|
|
108
|
-
});
|
|
87
|
+
mock.onGet(API.SENSOR.DISPLAY_ACTIONS(1)).reply(200, response.data);
|
|
109
88
|
await act(async () => {
|
|
110
89
|
tree = await renderer.create(wrapComponent(route));
|
|
111
90
|
});
|
|
112
|
-
expect(
|
|
91
|
+
expect(mockedNavigate).toHaveBeenCalled();
|
|
113
92
|
});
|
|
114
93
|
|
|
115
94
|
test('test RenderActionItem', async () => {
|
|
@@ -186,9 +165,7 @@ describe('Test SelectAction', () => {
|
|
|
186
165
|
},
|
|
187
166
|
],
|
|
188
167
|
};
|
|
189
|
-
|
|
190
|
-
return response;
|
|
191
|
-
});
|
|
168
|
+
mock.onGet(API.SENSOR.DISPLAY_ACTIONS(1)).reply(200, response.data);
|
|
192
169
|
await act(async () => {
|
|
193
170
|
tree = renderer.create(wrapComponent(route));
|
|
194
171
|
});
|
|
@@ -196,64 +173,6 @@ describe('Test SelectAction', () => {
|
|
|
196
173
|
const renderActionItem = instance.find(
|
|
197
174
|
(el) => el.props.testID === TESTID.ACTION_ITEM
|
|
198
175
|
);
|
|
199
|
-
const actionTemplate = instance.findByType(ActionTemplate);
|
|
200
|
-
const numberUpDownActionTemplate = instance.findByType(
|
|
201
|
-
NumberUpDownActionTemplate
|
|
202
|
-
);
|
|
203
|
-
const optionsDropdownActionTemplate = instance.findByType(
|
|
204
|
-
OptionsDropdownActionTemplate
|
|
205
|
-
);
|
|
206
|
-
const statesGridActionTemplate = instance.findByType(
|
|
207
|
-
StatesGridActionTemplate
|
|
208
|
-
);
|
|
209
|
-
|
|
210
176
|
expect(renderActionItem.props.data.length).toBe(4);
|
|
211
|
-
expect(actionTemplate).toBeDefined();
|
|
212
|
-
expect(numberUpDownActionTemplate).toBeDefined();
|
|
213
|
-
expect(optionsDropdownActionTemplate).toBeDefined();
|
|
214
|
-
expect(statesGridActionTemplate).toBeDefined();
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
test('test onPress handleOnSelectAction', async () => {
|
|
218
|
-
const response = {
|
|
219
|
-
status: 200,
|
|
220
|
-
success: true,
|
|
221
|
-
data: [
|
|
222
|
-
{
|
|
223
|
-
title: '',
|
|
224
|
-
template: 'three_button_action_template',
|
|
225
|
-
configuration: {
|
|
226
|
-
action1: '94ae262d-46e3-42ff-9d10-516831ecc830',
|
|
227
|
-
action2: '94ae262d-46e3-42ff-9d10-516831ecc830',
|
|
228
|
-
action3: '94ae262d-46e3-42ff-9d10-516831ecc830',
|
|
229
|
-
icon1: 'up',
|
|
230
|
-
icon2: 'stop',
|
|
231
|
-
icon3: 'down',
|
|
232
|
-
text1: 'OPEN',
|
|
233
|
-
text2: 'STOP',
|
|
234
|
-
text3: 'CLOSE',
|
|
235
|
-
text_lock: 'Door lock',
|
|
236
|
-
is_display_lock: true,
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
],
|
|
240
|
-
};
|
|
241
|
-
axios.get.mockImplementation(async () => {
|
|
242
|
-
return response;
|
|
243
|
-
});
|
|
244
|
-
await act(async () => {
|
|
245
|
-
tree = await renderer.create(wrapComponent(route));
|
|
246
|
-
});
|
|
247
|
-
const instance = tree.root;
|
|
248
|
-
const actionTemplate = instance.findByType(ActionTemplate);
|
|
249
|
-
const bottomButton = instance.findByType(BottomButtonView);
|
|
250
|
-
act(() => {
|
|
251
|
-
actionTemplate.props.onSelectAction({
|
|
252
|
-
name: 'OPEN',
|
|
253
|
-
action: '94ae262d-46e3-42ff-9d10-516831ecc830',
|
|
254
|
-
template: 'three_button_action_template',
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
expect(bottomButton.props.typeMain).toEqual('primary');
|
|
258
177
|
});
|
|
259
178
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderer, { act } from 'react-test-renderer';
|
|
3
|
-
import
|
|
3
|
+
import MockAdapter from 'axios-mock-adapter';
|
|
4
4
|
|
|
5
5
|
import SelectSensorDevices from '../SelectSensorDevices';
|
|
6
6
|
import { SCProvider } from '../../../context';
|
|
@@ -9,18 +9,22 @@ import Device from '../Device';
|
|
|
9
9
|
import BottomButtonView from '../../../commons/BottomButtonView';
|
|
10
10
|
import NavBar from '../../../commons/NavBar';
|
|
11
11
|
import API from '../../../configs/API';
|
|
12
|
-
import { TESTID } from '../../../configs/Constants';
|
|
12
|
+
import { AUTOMATE_SELECT, TESTID } from '../../../configs/Constants';
|
|
13
13
|
import { TouchableOpacity } from 'react-native';
|
|
14
14
|
import Routes from '../../../utils/Route';
|
|
15
|
+
import api from '../../../utils/Apis/axios';
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
const mock = new MockAdapter(api.axiosInstance);
|
|
17
18
|
|
|
18
19
|
const mockedNavigate = jest.fn();
|
|
20
|
+
const mockedDispatch = jest.fn();
|
|
21
|
+
|
|
19
22
|
jest.mock('@react-navigation/native', () => {
|
|
20
23
|
return {
|
|
21
24
|
...jest.requireActual('@react-navigation/native'),
|
|
22
25
|
useNavigation: () => ({
|
|
23
26
|
navigate: mockedNavigate,
|
|
27
|
+
dispatch: mockedDispatch,
|
|
24
28
|
}),
|
|
25
29
|
};
|
|
26
30
|
});
|
|
@@ -45,6 +49,9 @@ describe('Test SelectSensorDevices', () => {
|
|
|
45
49
|
unit: { id: 1, name: 'Unit test' },
|
|
46
50
|
automateId: 1,
|
|
47
51
|
scriptName: 'scriptName test',
|
|
52
|
+
automate: {
|
|
53
|
+
sensor_id: 1,
|
|
54
|
+
},
|
|
48
55
|
},
|
|
49
56
|
};
|
|
50
57
|
const response = {
|
|
@@ -63,29 +70,21 @@ describe('Test SelectSensorDevices', () => {
|
|
|
63
70
|
};
|
|
64
71
|
|
|
65
72
|
beforeEach(() => {
|
|
66
|
-
axios.get.mockClear();
|
|
67
73
|
mockedNavigate.mockClear();
|
|
68
74
|
});
|
|
69
75
|
|
|
70
76
|
test('fetch Device success', async () => {
|
|
71
|
-
|
|
72
|
-
return response;
|
|
73
|
-
});
|
|
74
|
-
|
|
77
|
+
mock.onGet(API.UNIT.DEVICE_CONTROL(1)).reply(200, response.data);
|
|
75
78
|
await act(async () => {
|
|
76
79
|
tree = renderer.create(wrapComponent(route));
|
|
77
80
|
});
|
|
78
81
|
const instance = tree.root;
|
|
79
82
|
const navBar = instance.findByType(NavBar);
|
|
80
|
-
|
|
81
|
-
expect(axios.get).toHaveBeenCalledWith(API.UNIT.DEVICE_CONTROL(1), {});
|
|
82
83
|
expect(navBar.props.listStation).toHaveLength(1);
|
|
83
84
|
});
|
|
84
85
|
|
|
85
86
|
test('onPress continue', async () => {
|
|
86
|
-
|
|
87
|
-
return response;
|
|
88
|
-
});
|
|
87
|
+
mock.onGet(API.UNIT.DEVICE_CONTROL(1)).reply(200, response.data);
|
|
89
88
|
await act(async () => {
|
|
90
89
|
tree = renderer.create(wrapComponent(route));
|
|
91
90
|
});
|
|
@@ -99,9 +98,7 @@ describe('Test SelectSensorDevices', () => {
|
|
|
99
98
|
});
|
|
100
99
|
|
|
101
100
|
test('test onPressDevice', async () => {
|
|
102
|
-
|
|
103
|
-
return response;
|
|
104
|
-
});
|
|
101
|
+
mock.onGet(API.UNIT.DEVICE_CONTROL(1)).reply(200, response.data);
|
|
105
102
|
await act(async () => {
|
|
106
103
|
tree = renderer.create(wrapComponent(route));
|
|
107
104
|
});
|
|
@@ -113,7 +110,6 @@ describe('Test SelectSensorDevices', () => {
|
|
|
113
110
|
device[0].props.onPress({ id: 1, name: 'sensor' });
|
|
114
111
|
});
|
|
115
112
|
expect(device[0].props.isSelectDevice).toEqual(true);
|
|
116
|
-
|
|
117
113
|
act(() => {
|
|
118
114
|
device[0].props.onPress({ id: 1, name: 'sensor' });
|
|
119
115
|
});
|
|
@@ -121,16 +117,12 @@ describe('Test SelectSensorDevices', () => {
|
|
|
121
117
|
});
|
|
122
118
|
|
|
123
119
|
test('test onSnapItem', async () => {
|
|
124
|
-
|
|
125
|
-
return response;
|
|
126
|
-
});
|
|
127
|
-
|
|
120
|
+
mock.onGet(API.UNIT.DEVICE_CONTROL(1)).reply(200, response.data);
|
|
128
121
|
await act(async () => {
|
|
129
122
|
tree = renderer.create(wrapComponent(route));
|
|
130
123
|
});
|
|
131
124
|
const instance = tree.root;
|
|
132
125
|
const navBar = instance.findByType(NavBar);
|
|
133
|
-
|
|
134
126
|
act(() => {
|
|
135
127
|
navBar.props.onSnapToItem({ id: 1, name: 'sensor' }, 0);
|
|
136
128
|
});
|
|
@@ -138,9 +130,7 @@ describe('Test SelectSensorDevices', () => {
|
|
|
138
130
|
});
|
|
139
131
|
|
|
140
132
|
test('test onPressClose user already has an automateId', async () => {
|
|
141
|
-
|
|
142
|
-
return response;
|
|
143
|
-
});
|
|
133
|
+
mock.onGet(API.UNIT.DEVICE_CONTROL(1)).reply(200, response.data);
|
|
144
134
|
await act(async () => {
|
|
145
135
|
tree = renderer.create(wrapComponent(route));
|
|
146
136
|
});
|
|
@@ -154,7 +144,6 @@ describe('Test SelectSensorDevices', () => {
|
|
|
154
144
|
await act(async () => {
|
|
155
145
|
iconClose[0].props.onPress();
|
|
156
146
|
});
|
|
157
|
-
|
|
158
147
|
expect(mockedNavigate).toHaveBeenCalledWith(Routes.ScriptDetail, {
|
|
159
148
|
havePermission: true,
|
|
160
149
|
id: 1,
|
|
@@ -166,4 +155,29 @@ describe('Test SelectSensorDevices', () => {
|
|
|
166
155
|
unit: { id: 1, name: 'Unit test' },
|
|
167
156
|
});
|
|
168
157
|
});
|
|
158
|
+
|
|
159
|
+
test('test onPressClose user already has not an automateId', async () => {
|
|
160
|
+
mock.onGet(API.UNIT.DEVICE_SENSOR(1)).reply(200, response.data);
|
|
161
|
+
const new_route = {
|
|
162
|
+
...route,
|
|
163
|
+
params: {
|
|
164
|
+
...route.params,
|
|
165
|
+
automateId: null,
|
|
166
|
+
title: AUTOMATE_SELECT.SELECT_SENSOR,
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
await act(async () => {
|
|
170
|
+
tree = renderer.create(wrapComponent(new_route));
|
|
171
|
+
});
|
|
172
|
+
const instance = tree.root;
|
|
173
|
+
const iconClose = instance.findAll(
|
|
174
|
+
(el) =>
|
|
175
|
+
el.props.testID === TESTID.ICON_CLOSE && el.type === TouchableOpacity
|
|
176
|
+
);
|
|
177
|
+
expect(iconClose).toHaveLength(1);
|
|
178
|
+
await act(async () => {
|
|
179
|
+
iconClose[0].props.onPress();
|
|
180
|
+
});
|
|
181
|
+
expect(mockedDispatch).toBeCalled();
|
|
182
|
+
});
|
|
169
183
|
});
|
|
@@ -69,12 +69,13 @@ describe('test AddNewAutoSmart', () => {
|
|
|
69
69
|
automate: {},
|
|
70
70
|
automateId: undefined,
|
|
71
71
|
title: 'select_sensor',
|
|
72
|
-
|
|
72
|
+
oldType: 'value_change',
|
|
73
73
|
scriptName: undefined,
|
|
74
74
|
unit: { id: 1 },
|
|
75
75
|
isAutomateTab: undefined,
|
|
76
76
|
isMultiUnits: undefined,
|
|
77
77
|
routeName: 'SelectSensorDevices',
|
|
78
|
+
type: 'value_change',
|
|
78
79
|
});
|
|
79
80
|
});
|
|
80
81
|
|
|
@@ -102,6 +103,7 @@ describe('test AddNewAutoSmart', () => {
|
|
|
102
103
|
automate: {},
|
|
103
104
|
automateId: undefined,
|
|
104
105
|
type: 'schedule',
|
|
106
|
+
oldType: 'value_change',
|
|
105
107
|
routeName: 'SetSchedule',
|
|
106
108
|
scriptName: undefined,
|
|
107
109
|
unit: route.params.unit,
|
|
@@ -25,6 +25,7 @@ const AddNewAutoSmart = memo(({ route }) => {
|
|
|
25
25
|
automate = {},
|
|
26
26
|
scriptName,
|
|
27
27
|
} = route.params;
|
|
28
|
+
|
|
28
29
|
const typeAutoSmart = {
|
|
29
30
|
[AUTOMATE_TYPE.AUTOMATE]: [
|
|
30
31
|
{
|
|
@@ -96,6 +97,7 @@ const AddNewAutoSmart = memo(({ route }) => {
|
|
|
96
97
|
routeName: dataAutomate?.route,
|
|
97
98
|
automate,
|
|
98
99
|
scriptName,
|
|
100
|
+
oldType: type,
|
|
99
101
|
};
|
|
100
102
|
|
|
101
103
|
if (
|
|
@@ -107,14 +109,15 @@ const AddNewAutoSmart = memo(({ route }) => {
|
|
|
107
109
|
navigate(dataAutomate.route, params);
|
|
108
110
|
}
|
|
109
111
|
}, [
|
|
110
|
-
navigate,
|
|
111
|
-
selectedIndex,
|
|
112
112
|
data,
|
|
113
|
+
selectedIndex,
|
|
113
114
|
unit,
|
|
114
115
|
isAutomateTab,
|
|
115
116
|
isMultiUnits,
|
|
116
117
|
automate,
|
|
117
118
|
scriptName,
|
|
119
|
+
type,
|
|
120
|
+
navigate,
|
|
118
121
|
]);
|
|
119
122
|
|
|
120
123
|
const handleSelectIndex = (index) => {
|
|
@@ -12,12 +12,12 @@ import Routes from '../../utils/Route';
|
|
|
12
12
|
const ConnectingDevices = memo(({ route }) => {
|
|
13
13
|
const t = useTranslations();
|
|
14
14
|
const { navigate } = useNavigation();
|
|
15
|
-
const { new_sensor } = route.params;
|
|
15
|
+
const { new_sensor } = route.params || {};
|
|
16
16
|
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
const checkSensorConnected = setInterval(async () => {
|
|
19
19
|
const { success } = await axiosGet(
|
|
20
|
-
API.SENSOR.CHECK_CONNECTION(new_sensor
|
|
20
|
+
API.SENSOR.CHECK_CONNECTION(new_sensor?.id),
|
|
21
21
|
{},
|
|
22
22
|
true
|
|
23
23
|
);
|
|
@@ -26,7 +26,7 @@ const ConnectingDevices = memo(({ route }) => {
|
|
|
26
26
|
}
|
|
27
27
|
}, 3000);
|
|
28
28
|
return () => clearInterval(checkSensorConnected);
|
|
29
|
-
}, [navigate, new_sensor
|
|
29
|
+
}, [navigate, new_sensor?.id, route.params]);
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
32
|
<View style={styles.wrap}>
|