@eohjsc/react-native-smart-city 0.2.97 → 0.2.98
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/package.json +2 -2
- package/src/commons/Action/ItemQuickAction.js +5 -2
- package/src/commons/ActionGroup/ColorPickerTemplate.js +1 -1
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +10 -2
- package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLock.js +4 -1
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +1 -0
- package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +12 -10
- package/src/commons/ActionGroup/OnOffTemplate/index.js +38 -5
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +8 -2
- package/src/commons/ActionGroup/SliderRangeTemplate.js +1 -1
- package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +4 -1
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +14 -4
- package/src/commons/ActionGroup/TimerActionTemplate.js +9 -1
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +7 -3
- 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/Auth/AccountList.js +1 -1
- package/src/commons/Device/HistoryChart.js +4 -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/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/configs/Constants.js +4 -0
- package/src/context/actionType.ts +1 -0
- package/src/context/reducer.ts +3 -0
- package/src/screens/AQIGuide/index.js +1 -1
- package/src/screens/ActivityLog/FilterPopup.js +2 -0
- package/src/screens/AddCommon/SelectSubUnit.js +1 -0
- package/src/screens/AddCommon/SelectUnit.js +1 -0
- package/src/screens/AddLocationMaps/index.js +4 -1
- package/src/screens/AddNewAction/SelectSensorDevices.js +6 -1
- 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/index.js +1 -0
- package/src/screens/AddNewOneTap/index.js +1 -1
- package/src/screens/Automate/index.js +2 -0
- package/src/screens/Device/detail.js +9 -1
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +14 -0
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +19 -1
- package/src/screens/EmergencySetting/index.js +4 -1
- package/src/screens/Explore/index.js +2 -0
- package/src/screens/ManageAccess/index.js +1 -0
- package/src/screens/MoveToAnotherSubUnit/index.js +1 -1
- package/src/screens/ScriptDetail/index.js +2 -2
- package/src/screens/SelectUnit/index.js +1 -0
- package/src/screens/SetSchedule/index.js +4 -1
- package/src/screens/SharedUnit/index.js +2 -0
- package/src/screens/Sharing/MemberList.js +12 -11
- package/src/screens/Sharing/SelectPermission.js +1 -0
- package/src/screens/Sharing/hooks/index.js +3 -0
- package/src/screens/SmartIr/components/SelectBrand.js +1 -1
- package/src/screens/SubUnit/ManageSubUnit.js +1 -0
- package/src/screens/SyncLGDevice/AddLGDevice.js +1 -0
- package/src/screens/TDSGuide/index.js +4 -1
- package/src/screens/UVIndexGuide/index.js +1 -1
- 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/UnitSummary/__test__/index.test.js +32 -0
- package/src/screens/WaterQualityGuide/index.js +1 -1
|
@@ -224,7 +224,10 @@ const GatewayWifiList = memo(({ route }) => {
|
|
|
224
224
|
{t('select_wifi')}
|
|
225
225
|
</Text>
|
|
226
226
|
|
|
227
|
-
<ScrollView
|
|
227
|
+
<ScrollView
|
|
228
|
+
style={styles.listContainer}
|
|
229
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
230
|
+
>
|
|
228
231
|
{!!list_wifi.length &&
|
|
229
232
|
list_wifi.map((item, index) => (
|
|
230
233
|
<TouchableOpacity
|
|
@@ -147,6 +147,7 @@ const SetupGatewayWifi = memo(({ route }) => {
|
|
|
147
147
|
<ScrollView
|
|
148
148
|
style={styles.scrollContainer}
|
|
149
149
|
showsVerticalScrollIndicator={false}
|
|
150
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
150
151
|
>
|
|
151
152
|
<Section type={'border'}>
|
|
152
153
|
<Text style={styles.textWifi} bold color={Colors.Primary}>
|
|
@@ -147,6 +147,7 @@ const Automate = () => {
|
|
|
147
147
|
showsHorizontalScrollIndicator={false}
|
|
148
148
|
contentContainerStyle={styles.contentContainerStyle2}
|
|
149
149
|
ListFooterComponent={renderListFooterComponent(type, unit_id)}
|
|
150
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
150
151
|
/>
|
|
151
152
|
</View>
|
|
152
153
|
);
|
|
@@ -189,6 +190,7 @@ const Automate = () => {
|
|
|
189
190
|
contentContainerStyle={styles.contentContainerStyle}
|
|
190
191
|
refreshing={false}
|
|
191
192
|
onRefresh={getAutomates}
|
|
193
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
192
194
|
/>
|
|
193
195
|
</View>
|
|
194
196
|
);
|
|
@@ -33,7 +33,12 @@ import { useFavoriteDevice } from './hooks/useFavoriteDevice';
|
|
|
33
33
|
import BottomButtonView from '../../commons/BottomButtonView';
|
|
34
34
|
import Text from '../../commons/Text';
|
|
35
35
|
import { transformDatetime } from '../../utils/Converter/time';
|
|
36
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
AlertAction,
|
|
38
|
+
ButtonPopup,
|
|
39
|
+
FullLoading,
|
|
40
|
+
MenuActionMore,
|
|
41
|
+
} from '../../commons';
|
|
37
42
|
import { TESTID } from '../../configs/Constants';
|
|
38
43
|
import Routes from '../../utils/Route';
|
|
39
44
|
import { usePopover } from '../../hooks/Common';
|
|
@@ -90,6 +95,8 @@ const DeviceDetail = ({ route }) => {
|
|
|
90
95
|
return state.app.isBluetoothEnabled;
|
|
91
96
|
});
|
|
92
97
|
|
|
98
|
+
const isFullLoading = useSCContextSelector((state) => state.isFullLoading);
|
|
99
|
+
|
|
93
100
|
const isDeviceConnectedViaBle = useMemo(
|
|
94
101
|
() =>
|
|
95
102
|
isBluetoothEnabled &&
|
|
@@ -573,6 +580,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
573
580
|
})}
|
|
574
581
|
</Card>
|
|
575
582
|
)}
|
|
583
|
+
{isFullLoading && <FullLoading />}
|
|
576
584
|
</SensorConnectStatusViewHeader>
|
|
577
585
|
);
|
|
578
586
|
};
|
|
@@ -2,6 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { TouchableOpacity } from 'react-native';
|
|
3
3
|
import { act, create } from 'react-test-renderer';
|
|
4
4
|
import Routes from '../../../utils/Route';
|
|
5
|
+
import axios from 'axios';
|
|
6
|
+
import { API } from '../../../configs';
|
|
7
|
+
|
|
5
8
|
import { AlertAction } from '../../../commons';
|
|
6
9
|
import { EmergencyContactsList } from '../EmergencyContactsList';
|
|
7
10
|
import { TESTID } from '../../../configs/Constants';
|
|
@@ -27,6 +30,8 @@ jest.mock('@react-navigation/native', () => {
|
|
|
27
30
|
};
|
|
28
31
|
});
|
|
29
32
|
|
|
33
|
+
jest.mock('axios');
|
|
34
|
+
|
|
30
35
|
describe('test EmergencyContactList', () => {
|
|
31
36
|
let route;
|
|
32
37
|
|
|
@@ -37,6 +42,7 @@ describe('test EmergencyContactList', () => {
|
|
|
37
42
|
group: 1,
|
|
38
43
|
},
|
|
39
44
|
};
|
|
45
|
+
axios.delete.mockClear();
|
|
40
46
|
});
|
|
41
47
|
let tree;
|
|
42
48
|
|
|
@@ -51,11 +57,19 @@ describe('test EmergencyContactList', () => {
|
|
|
51
57
|
const instance = tree.root;
|
|
52
58
|
const alertAction = instance.findByType(AlertAction);
|
|
53
59
|
|
|
60
|
+
const response = { status: 204 };
|
|
61
|
+
axios.delete.mockImplementation(async () => {
|
|
62
|
+
return response;
|
|
63
|
+
});
|
|
64
|
+
|
|
54
65
|
act(() => {
|
|
55
66
|
alertAction.props.rightButtonClick();
|
|
56
67
|
});
|
|
57
68
|
|
|
58
69
|
expect(alertAction.props.visible).toBe(false);
|
|
70
|
+
expect(axios.delete).toHaveBeenCalledWith(
|
|
71
|
+
API.EMERGENCY_BUTTON.REMOVE_CONTACTS()
|
|
72
|
+
);
|
|
59
73
|
});
|
|
60
74
|
|
|
61
75
|
test('onAddNew', async () => {
|
|
@@ -75,7 +75,25 @@ describe('test EmergencyContactsSelectContacts', () => {
|
|
|
75
75
|
test('test onSave emergencyContactsSelectContacts', async () => {
|
|
76
76
|
const response = {
|
|
77
77
|
status: 200,
|
|
78
|
-
|
|
78
|
+
};
|
|
79
|
+
axios.post.mockImplementation(async () => {
|
|
80
|
+
return response;
|
|
81
|
+
});
|
|
82
|
+
act(() => {
|
|
83
|
+
tree = create(wrapComponent(route));
|
|
84
|
+
});
|
|
85
|
+
const instance = tree.root;
|
|
86
|
+
|
|
87
|
+
const viewButtonBottom = instance.findByType(ViewButtonBottom);
|
|
88
|
+
await act(async () => {
|
|
89
|
+
viewButtonBottom.props.onRightClick();
|
|
90
|
+
});
|
|
91
|
+
expect(axios.post).toHaveBeenCalled();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('test onSave emergencyContactsSelectContacts fail', async () => {
|
|
95
|
+
const response = {
|
|
96
|
+
status: 500,
|
|
79
97
|
};
|
|
80
98
|
axios.post.mockImplementation(async () => {
|
|
81
99
|
return response;
|
|
@@ -63,7 +63,10 @@ const EmergencySetting = () => {
|
|
|
63
63
|
<View style={styles.wrap}>
|
|
64
64
|
<HeaderCustom title={t('setting')} isShowSeparator />
|
|
65
65
|
|
|
66
|
-
<ScrollView
|
|
66
|
+
<ScrollView
|
|
67
|
+
contentContainerStyle={styles.contentContainerStyle}
|
|
68
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
69
|
+
>
|
|
67
70
|
{listData.map((item, index) => (
|
|
68
71
|
<DropDownItem
|
|
69
72
|
{...item}
|
|
@@ -92,6 +92,7 @@ const Explore = ({ navigation }) => {
|
|
|
92
92
|
horizontal={true}
|
|
93
93
|
contentContainerStyle={styles.locationContent}
|
|
94
94
|
showsHorizontalScrollIndicator={false}
|
|
95
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
95
96
|
>
|
|
96
97
|
{!!unitsNearMe &&
|
|
97
98
|
unitsNearMe.map((item) => (
|
|
@@ -134,6 +135,7 @@ const Explore = ({ navigation }) => {
|
|
|
134
135
|
onEndReachedThreshold={0.01}
|
|
135
136
|
onMomentumScrollBegin={() => setOnEndReached(false)}
|
|
136
137
|
onEndReached={handleEndReachUnitPublic}
|
|
138
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
137
139
|
/>
|
|
138
140
|
</Animated.View>
|
|
139
141
|
</SafeAreaView>
|
|
@@ -62,7 +62,7 @@ const MoveToAnotherSubUnit = memo(({ route }) => {
|
|
|
62
62
|
return (
|
|
63
63
|
<View style={styles.wrap}>
|
|
64
64
|
<HeaderCustom title={t('move_to_another_sub_unit')} isShowSeparator />
|
|
65
|
-
<ScrollView>
|
|
65
|
+
<ScrollView scrollIndicatorInsets={{ right: 1 }}>
|
|
66
66
|
<View style={styles.container}>
|
|
67
67
|
<View>
|
|
68
68
|
{listStationUnit.map((item, index) => (
|
|
@@ -369,10 +369,10 @@ const ScriptDetail = ({ route }) => {
|
|
|
369
369
|
return `${config_name} ${t(textCondition)} ${value}`;
|
|
370
370
|
} else if (type === AUTOMATE_TYPE.SCHEDULE) {
|
|
371
371
|
const time =
|
|
372
|
-
time_repeat
|
|
372
|
+
time_repeat?.length >= 8
|
|
373
373
|
? time_repeat.substring(0, time_repeat.length - 3)
|
|
374
374
|
: time_repeat;
|
|
375
|
-
const date = date_repeat
|
|
375
|
+
const date = date_repeat?.split('-').reverse().join('/');
|
|
376
376
|
const weekday = {
|
|
377
377
|
1: t('mon'),
|
|
378
378
|
2: t('tue'),
|
|
@@ -136,7 +136,10 @@ const SetSchedule = ({ route }) => {
|
|
|
136
136
|
<>
|
|
137
137
|
<View style={styles.container}>
|
|
138
138
|
<HeaderCustom isShowClose onClose={onClose} />
|
|
139
|
-
<ScrollView
|
|
139
|
+
<ScrollView
|
|
140
|
+
contentContainerStyle={styles.scollView}
|
|
141
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
142
|
+
>
|
|
140
143
|
<Text type="H2" bold style={styles.title}>
|
|
141
144
|
{t('set_schedule')}
|
|
142
145
|
</Text>
|
|
@@ -139,6 +139,7 @@ const Shared = () => {
|
|
|
139
139
|
keyExtractor={(item, index) => item.id.toString()}
|
|
140
140
|
ItemSeparatorComponent={() => <View style={styles.seperator} />}
|
|
141
141
|
contentContainerStyle={styles.scrollView}
|
|
142
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
142
143
|
/>
|
|
143
144
|
) : (
|
|
144
145
|
<FlatList
|
|
@@ -162,6 +163,7 @@ const Shared = () => {
|
|
|
162
163
|
keyExtractor={(item, index) => item.id.toString()}
|
|
163
164
|
ItemSeparatorComponent={() => <View style={styles.seperator} />}
|
|
164
165
|
contentContainerStyle={styles.scrollView}
|
|
166
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
165
167
|
/>
|
|
166
168
|
)}
|
|
167
169
|
</View>
|
|
@@ -21,10 +21,8 @@ const MemberList = ({ route }) => {
|
|
|
21
21
|
const isFocused = useIsFocused();
|
|
22
22
|
const account = useSCContextSelector((state) => state.auth.account);
|
|
23
23
|
const { unitId, unit } = route.params;
|
|
24
|
-
const { dataMembers, isRefresh, onRefresh, leaveUnit } =
|
|
25
|
-
unitId,
|
|
26
|
-
unit?.user_id
|
|
27
|
-
);
|
|
24
|
+
const { dataMembers, isRefresh, onRefresh, leaveUnit, loading } =
|
|
25
|
+
useDataMember(unitId, unit?.user_id);
|
|
28
26
|
const { isOwner } = useIsOwnerOfUnit(unit?.user_id);
|
|
29
27
|
|
|
30
28
|
const { stateAlertSharingMenu, hideStateAlertSharingMenu, stateLeaveUnit } =
|
|
@@ -67,6 +65,7 @@ const MemberList = ({ route }) => {
|
|
|
67
65
|
/>
|
|
68
66
|
</TouchableOpacity>
|
|
69
67
|
);
|
|
68
|
+
|
|
70
69
|
return (
|
|
71
70
|
<View style={styles.container}>
|
|
72
71
|
<WrapHeaderScrollable
|
|
@@ -77,13 +76,15 @@ const MemberList = ({ route }) => {
|
|
|
77
76
|
headerAniStyle={styles.headerAniStyle}
|
|
78
77
|
styleScrollView={{ backgroundColor: Colors.White }}
|
|
79
78
|
>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
{!loading && (
|
|
80
|
+
<SharingMembers
|
|
81
|
+
testID={TESTID.SHARING_MEMBER}
|
|
82
|
+
dataMember={dataMembers}
|
|
83
|
+
unit={unit}
|
|
84
|
+
ownerId={unit.user_id}
|
|
85
|
+
currentUserId={account.user.id}
|
|
86
|
+
/>
|
|
87
|
+
)}
|
|
87
88
|
</WrapHeaderScrollable>
|
|
88
89
|
<AlertAction
|
|
89
90
|
visible={stateAlertSharingMenu.visible}
|
|
@@ -13,6 +13,7 @@ const useDataMember = (unitId, userUnitId = undefined) => {
|
|
|
13
13
|
const { navigate, goBack } = useNavigation();
|
|
14
14
|
const [dataMembers, setDataMembers] = useState([]);
|
|
15
15
|
const [isRefresh, setRefresh] = useState(false);
|
|
16
|
+
const [loading, setLoading] = useState(true);
|
|
16
17
|
const user = useSCContextSelector((state) => state?.auth?.account?.user);
|
|
17
18
|
const { isOwner } = useIsOwnerOfUnit(userUnitId);
|
|
18
19
|
|
|
@@ -42,6 +43,7 @@ const useDataMember = (unitId, userUnitId = undefined) => {
|
|
|
42
43
|
const arrChanged = changePositionOwnerAndMe(data);
|
|
43
44
|
setDataMembers(arrChanged);
|
|
44
45
|
}
|
|
46
|
+
setLoading(false);
|
|
45
47
|
},
|
|
46
48
|
[changePositionOwnerAndMe]
|
|
47
49
|
);
|
|
@@ -82,6 +84,7 @@ const useDataMember = (unitId, userUnitId = undefined) => {
|
|
|
82
84
|
loadMembers,
|
|
83
85
|
isRefresh,
|
|
84
86
|
onRefresh,
|
|
87
|
+
loading,
|
|
85
88
|
};
|
|
86
89
|
};
|
|
87
90
|
|
|
@@ -36,7 +36,7 @@ const SelectDeviceType = memo(({ route }) => {
|
|
|
36
36
|
return (
|
|
37
37
|
<View style={styles.container}>
|
|
38
38
|
<HeaderCustom title={t('select_brand')} />
|
|
39
|
-
<ScrollView>
|
|
39
|
+
<ScrollView scrollIndicatorInsets={{ right: 1 }}>
|
|
40
40
|
<View style={styles.listBrands}>
|
|
41
41
|
{!!deviceBrand &&
|
|
42
42
|
deviceBrand.map((item, index) => {
|
|
@@ -13,7 +13,10 @@ const TDSGuide = memo(() => {
|
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
15
|
<View style={styles.container}>
|
|
16
|
-
<ScrollView
|
|
16
|
+
<ScrollView
|
|
17
|
+
style={styles.paddingHorizontal16}
|
|
18
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
19
|
+
>
|
|
17
20
|
<Text
|
|
18
21
|
type="H3"
|
|
19
22
|
semibold
|
|
@@ -73,7 +73,7 @@ const UVIndexGuide = memo(() => {
|
|
|
73
73
|
const onPress = useCallback((item) => {}, []);
|
|
74
74
|
return (
|
|
75
75
|
<SafeAreaView style={styles.container}>
|
|
76
|
-
<ScrollView style={styles.container}>
|
|
76
|
+
<ScrollView style={styles.container} scrollIndicatorInsets={{ right: 1 }}>
|
|
77
77
|
{titles.map((item, index) => {
|
|
78
78
|
const { title, des } = item;
|
|
79
79
|
return (
|
|
@@ -163,7 +163,10 @@ const SelectAddress = memo(({ route }) => {
|
|
|
163
163
|
<View style={styles.wrap}>
|
|
164
164
|
<View style={styles.searchLocation}>
|
|
165
165
|
<SearchBarLocation input={input} onTextInput={onTextInput} />
|
|
166
|
-
<ScrollView
|
|
166
|
+
<ScrollView
|
|
167
|
+
style={styles.searchData}
|
|
168
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
169
|
+
>
|
|
167
170
|
{searchData.map((item, index) => (
|
|
168
171
|
<RowLocation key={index} item={item} onPress={onPressRowLocation} />
|
|
169
172
|
))}
|
|
@@ -85,7 +85,7 @@ const Summaries = memo(({ unit }) => {
|
|
|
85
85
|
return (
|
|
86
86
|
<>
|
|
87
87
|
{!unitSummaries || !unitSummaries.length ? null : (
|
|
88
|
-
<ScrollView horizontal={true}>
|
|
88
|
+
<ScrollView horizontal={true} scrollIndicatorInsets={{ right: 1 }}>
|
|
89
89
|
{unitSummaries.map((item, index) => (
|
|
90
90
|
<SummaryItem key={index} item={item} goToSummary={goToSummary} />
|
|
91
91
|
))}
|
|
@@ -43,6 +43,7 @@ describe('Test UnitSummary', () => {
|
|
|
43
43
|
Date.now = jest.fn(() => new Date('2021-01-24T12:00:00.000Z'));
|
|
44
44
|
route = {
|
|
45
45
|
params: {
|
|
46
|
+
unitId: 1,
|
|
46
47
|
unitData: {
|
|
47
48
|
id: 1,
|
|
48
49
|
},
|
|
@@ -114,6 +115,37 @@ describe('Test UnitSummary', () => {
|
|
|
114
115
|
);
|
|
115
116
|
});
|
|
116
117
|
|
|
118
|
+
test('render fetchUnitDetail success', async () => {
|
|
119
|
+
route = {
|
|
120
|
+
params: {
|
|
121
|
+
unitId: 1,
|
|
122
|
+
unitData: null,
|
|
123
|
+
summaryData: {
|
|
124
|
+
id: 1,
|
|
125
|
+
name: '',
|
|
126
|
+
screen: Routes.AirQuality,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
jest.useFakeTimers();
|
|
131
|
+
const response = {
|
|
132
|
+
status: 200,
|
|
133
|
+
data: {
|
|
134
|
+
data: {},
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
axios.get.mockImplementation(async (url) => response);
|
|
138
|
+
|
|
139
|
+
act(() => {
|
|
140
|
+
tree = create(wrapComponent(route));
|
|
141
|
+
});
|
|
142
|
+
act(() => {
|
|
143
|
+
jest.runOnlyPendingTimers();
|
|
144
|
+
});
|
|
145
|
+
expect(axios.get).toHaveBeenCalled();
|
|
146
|
+
expect(axios.get).toHaveBeenCalledWith(API.UNIT.UNIT_DETAIL(1), {});
|
|
147
|
+
});
|
|
148
|
+
|
|
117
149
|
let list_value = [
|
|
118
150
|
Routes.AirQuality,
|
|
119
151
|
Routes.PowerConsumption,
|
|
@@ -270,7 +270,7 @@ const WaterQualityGuide = memo(({ route }) => {
|
|
|
270
270
|
|
|
271
271
|
return (
|
|
272
272
|
<SafeAreaView style={styles.container}>
|
|
273
|
-
<ScrollView style={styles.container}>
|
|
273
|
+
<ScrollView style={styles.container} scrollIndicatorInsets={{ right: 1 }}>
|
|
274
274
|
<View style={styles.wrapScroll}>
|
|
275
275
|
{titles.map((item, index) => {
|
|
276
276
|
const { title, des } = item;
|