@eohjsc/react-native-smart-city 0.3.93 → 0.3.95
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 +1 -1
- package/src/commons/ActionGroup/OnOffTemplate/index.js +20 -17
- package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +1 -1
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +5 -24
- package/src/commons/SubUnit/OneTap/ItemOneTap.js +83 -85
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +68 -24
- package/src/commons/SubUnit/OneTap/index.js +21 -1
- package/src/configs/API.js +1 -0
- package/src/screens/ActivityLog/__test__/index.test.js +60 -2
- package/src/screens/ActivityLog/hooks/__test__/index.test.js +5 -0
- package/src/screens/ActivityLog/hooks/index.js +11 -0
- package/src/screens/AddLocationMaps/index.js +1 -1
- package/src/screens/AddNewGateway/ConnectingDevice.js +7 -0
- package/src/screens/AddNewGateway/ConnectingWifiDevice.js +6 -4
- package/src/screens/AddNewGateway/ConnectingWifiGuide.js +0 -1
- package/src/screens/AddNewGateway/RenameNewDevices.js +2 -2
- package/src/screens/AddNewGateway/ScanWifiDeviceQR.js +1 -6
- package/src/screens/AddNewGateway/SelectDeviceType.js +67 -9
- package/src/screens/AddNewGateway/ShareWifiPassword.js +20 -3
- package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +35 -0
- package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +0 -10
- package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +183 -29
- package/src/screens/AllGateway/GatewayInfo/index.js +3 -3
- package/src/screens/Automate/AddNewAction/SetupConfigCondition.js +0 -1
- package/src/screens/Automate/MultiUnits.js +32 -18
- package/src/screens/Automate/ScriptDetail/__test__/index.test.js +36 -2
- package/src/screens/Automate/ScriptDetail/index.js +17 -3
- package/src/screens/Automate/Styles/MultiUnitsStyles.js +1 -1
- package/src/screens/Automate/__test__/MultiUnits.test.js +125 -8
- package/src/screens/Automate/__test__/index.test.js +95 -11
- package/src/screens/Automate/index.js +62 -38
- package/src/screens/Device/hooks/__test__/useEvaluateValue.test.js +24 -1
- package/src/screens/Sharing/InfoMemberUnit.js +2 -2
- package/src/screens/Sharing/MemberList.js +28 -7
- package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +32 -18
- package/src/screens/Sharing/__test__/MemberList.test.js +37 -4
- package/src/screens/SubUnit/AddSubUnit.js +1 -1
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +16 -3
- package/src/screens/Unit/AddMenu.js +42 -19
- package/src/screens/Unit/__test__/AddMenu.test.js +68 -15
- package/src/screens/Unit/components/AutomateScript/index.js +1 -1
- package/src/utils/I18n/translations/en.js +1409 -0
- package/src/utils/I18n/translations/vi.js +1414 -0
- package/src/utils/I18n/translations.ts +2 -2
- package/src/utils/Permission/backend.js +7 -0
- package/src/screens/Sharing/__test__/MemberList2.test.js +0 -74
- package/src/utils/I18n/translations/en.json +0 -1142
- package/src/utils/I18n/translations/vi.json +0 -1139
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import MessageFormat from '@messageformat/core';
|
|
2
2
|
|
|
3
|
-
import en from './translations/en.
|
|
4
|
-
import vi from './translations/vi.
|
|
3
|
+
import en from './translations/en.js';
|
|
4
|
+
import vi from './translations/vi.js';
|
|
5
5
|
|
|
6
6
|
export type TranslationString = keyof typeof en;
|
|
7
7
|
export type Language = 'en' | 'vi';
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { create, act } from 'react-test-renderer';
|
|
3
|
-
|
|
4
|
-
import MemberList from '../MemberList';
|
|
5
|
-
import { AlertAction } from '../../../commons';
|
|
6
|
-
import { SCProvider } from '../../../context';
|
|
7
|
-
import { mockSCStore } from '../../../context/mockStore';
|
|
8
|
-
import { TouchableOpacity } from 'react-native';
|
|
9
|
-
import Routes from '../../../utils/Route';
|
|
10
|
-
import { useNavigation } from '@react-navigation/native';
|
|
11
|
-
import MockAdapter from 'axios-mock-adapter';
|
|
12
|
-
import api from '../../../utils/Apis/axios';
|
|
13
|
-
|
|
14
|
-
jest.mock('../../../hooks/Common', () => {
|
|
15
|
-
return {
|
|
16
|
-
useIsOwnerOfUnit: () => ({ isOwner: false }),
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const wrapComponent = (route, state) => (
|
|
21
|
-
<SCProvider initState={mockSCStore({})}>
|
|
22
|
-
<MemberList route={route} />
|
|
23
|
-
</SCProvider>
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
new MockAdapter(api.axiosInstance);
|
|
27
|
-
|
|
28
|
-
describe('test MemberList', () => {
|
|
29
|
-
let route;
|
|
30
|
-
let localState = {
|
|
31
|
-
auth: {
|
|
32
|
-
account: {
|
|
33
|
-
user: {
|
|
34
|
-
id: 2,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
const mockedNavigate = useNavigation().navigate;
|
|
40
|
-
|
|
41
|
-
beforeEach(() => {
|
|
42
|
-
route = {
|
|
43
|
-
params: {
|
|
44
|
-
unitId: 1,
|
|
45
|
-
unit: {
|
|
46
|
-
id: 1,
|
|
47
|
-
user_id: 2,
|
|
48
|
-
name: '',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
mockedNavigate.mockReset();
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('AlertAction rightButtonClick', async () => {
|
|
56
|
-
let tree;
|
|
57
|
-
await act(async () => {
|
|
58
|
-
tree = await create(wrapComponent(route, localState));
|
|
59
|
-
});
|
|
60
|
-
const instance = tree.root;
|
|
61
|
-
const alertAction = instance.findByType(AlertAction);
|
|
62
|
-
await act(async () => {
|
|
63
|
-
alertAction.props.rightButtonClick();
|
|
64
|
-
});
|
|
65
|
-
const MemberListButtons = instance.findAllByType(TouchableOpacity);
|
|
66
|
-
await act(async () => {
|
|
67
|
-
await MemberListButtons[1].props.onPress();
|
|
68
|
-
});
|
|
69
|
-
expect(mockedNavigate).not.toBeCalledWith(Routes.AddMemberStack, {
|
|
70
|
-
screen: Routes.SharingSelectPermission,
|
|
71
|
-
params: { unit: { id: 1 } },
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
});
|