@eohjsc/react-native-smart-city 0.3.4 → 0.3.7
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 +15 -36
- package/package.json +5 -9
- package/react-native-smart-city.podspec +0 -1
- package/src/commons/Action/ItemQuickAction.js +4 -16
- package/src/commons/Action/__test__/ItemQuickAction.test.js +6 -11
- package/src/commons/ActionGroup/ColorPickerTemplate.js +24 -37
- package/src/commons/ActionGroup/CurtainButtonTemplate.js +5 -10
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +31 -12
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +0 -4
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +0 -14
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +0 -1
- package/src/commons/ActionGroup/OnOffTemplate/OnOffButtonTemplate.js +2 -8
- package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +10 -10
- package/src/commons/ActionGroup/OnOffTemplate/index.js +2 -3
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +9 -7
- package/src/commons/ActionGroup/SliderRangeTemplate.js +2 -6
- package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +3 -7
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +8 -22
- package/src/commons/ActionGroup/TimerActionTemplate.js +3 -11
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +5 -1
- package/src/commons/ActionGroup/__test__/CurtainButtonTemplate.test.js +4 -53
- package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +83 -3
- package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +14 -14
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +78 -53
- package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +20 -36
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +57 -1
- package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +6 -58
- package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +1 -49
- package/src/commons/ActionGroup/__test__/index.test.js +4 -142
- package/src/commons/Auth/AccountList.js +1 -1
- package/src/commons/Automate/ItemAutomate.js +3 -1
- package/src/commons/Connecting/__test__/Connecting.test.js +2 -19
- package/src/commons/ConnectingProcess/DeviceItem/DeviceItem.js +3 -7
- package/src/commons/ConnectingProcess/DeviceItem/DeviceItemStyles.js +11 -8
- package/src/commons/ConnectingProcess/__test__/Connecting.test.js +3 -136
- package/src/commons/ConnectingProcess/__test__/DeviceItem.test.js +2 -3
- package/src/commons/ConnectingProcess/index.js +25 -75
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +13 -16
- package/src/commons/Dashboard/MyPinnedSharedUnit/index.js +1 -1
- package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +5 -0
- package/src/commons/Device/ConnectedViewHeader.js +1 -1
- package/src/commons/Device/HistoryChart.js +3 -7
- package/src/commons/Device/ItemDevice.js +12 -19
- package/src/commons/Device/LinearChart.js +0 -15
- package/src/commons/Device/PMSensor/PMSensorIndicatior.js +12 -16
- package/src/commons/Device/PMSensor/PMSensorIndicatorStyles.js +0 -3
- package/src/commons/Device/SonosSpeaker/index.js +1 -1
- package/src/commons/Device/WaterQualitySensor/ListQualityIndicator.js +0 -1
- package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +2 -7
- package/src/commons/Explore/__test__/CityItem.test.js +54 -33
- package/src/commons/Form/CurrencyInput.js +1 -15
- package/src/commons/Form/TextInputPassword.js +1 -1
- package/src/commons/FullLoading/index.js +1 -2
- package/src/commons/Header/HeaderCustom.js +1 -2
- package/src/commons/HeaderAni/index.js +1 -6
- package/src/commons/HorizontalPicker/index.js +2 -2
- package/src/commons/MediaPlayerDetail/Styles/MediaPlayerDetailStyles.js +6 -0
- package/src/commons/MediaPlayerDetail/index.js +47 -25
- package/src/commons/MenuActionAddnew/index.js +0 -1
- package/src/commons/MenuActionList/index.js +0 -1
- package/src/commons/MenuActionMore/index.js +1 -1
- package/src/commons/PreventAccess/index.js +1 -9
- package/src/commons/Sharing/MemberList.js +2 -10
- package/src/commons/Sharing/WrapHeaderScrollable.js +0 -2
- package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +1 -0
- package/src/commons/SubUnit/Favorites/index.js +3 -2
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +35 -8
- package/src/commons/SubUnit/OneTap/index.js +2 -1
- package/src/commons/SubUnit/ShortDetail.js +9 -25
- package/src/commons/SubUnit/__test__/Item.test.js +1 -0
- package/src/commons/SubUnit/__test__/ShortDetail.test.js +2 -9
- package/src/commons/Unit/SharedUnit.js +0 -1
- package/src/commons/Unit/__test__/SharedUnit.test.js +183 -38
- package/src/commons/UnitSummary/ConfigHistoryChart/index.js +13 -2
- package/src/commons/UnitSummary/ConfigHistoryChart.js +13 -22
- package/src/commons/WheelDateTimePicker/index.js +3 -4
- package/src/configs/API.js +143 -87
- package/src/configs/Constants.js +2 -57
- package/src/configs/SCConfig.js +0 -4
- package/src/context/actionType.ts +0 -8
- package/src/context/mockStore.ts +0 -10
- package/src/context/reducer.ts +2 -38
- package/src/hooks/Common/index.js +0 -2
- package/src/hooks/Common/useGetIdUser.js +5 -1
- package/src/hooks/Common/useSensorsStatus.js +4 -4
- package/src/hooks/useReceiveNotifications.js +5 -9
- package/src/iot/Monitor.js +2 -3
- package/src/iot/RemoteControl/Bluetooth.js +1 -1
- package/src/iot/RemoteControl/GoogleHome.js +49 -75
- package/src/iot/RemoteControl/Internet.js +1 -1
- package/src/iot/RemoteControl/__test__/GoogleHome.test.js +48 -95
- package/src/iot/RemoteControl/__test__/Internet.test.js +7 -18
- package/src/iot/RemoteControl/__test__/LgThinq.test.js +177 -36
- package/src/iot/RemoteControl/index.js +52 -52
- package/src/navigations/UnitStack.js +20 -11
- package/src/screens/AQIGuide/index.js +1 -1
- package/src/screens/ActivityLog/FilterPopup.js +0 -2
- package/src/screens/ActivityLog/__test__/index.test.js +23 -38
- package/src/screens/ActivityLog/hooks/__test__/index.test.js +90 -51
- package/src/screens/ActivityLog/hooks/index.js +1 -1
- package/src/screens/ActivityLog/index.js +2 -2
- package/src/screens/AddCommon/SelectSubUnit.js +0 -1
- package/src/screens/AddCommon/SelectUnit.js +0 -1
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +24 -13
- package/src/screens/AddCommon/__test__/SelectUnit.test.js +33 -9
- package/src/screens/AddLocationMaps/index.js +5 -9
- package/src/screens/AddNewAction/SelectAction.js +8 -8
- package/src/screens/AddNewAction/SelectSensorDevices.js +2 -8
- package/src/screens/AddNewAction/SetupSensor.js +7 -7
- package/src/screens/AddNewAction/__test__/SelectAction.test.js +91 -10
- package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +26 -40
- package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +1 -3
- package/src/screens/AddNewAutoSmart/index.js +2 -5
- package/src/screens/AddNewDevice/ConnectingDevices.js +3 -3
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +34 -42
- package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +4 -0
- package/src/screens/AddNewDevice/__test__/ConnectingDevices.test.js +22 -22
- package/src/screens/AddNewDevice/hooks/ConnectDevices.js +1 -1
- package/src/screens/AddNewDevice/index.js +0 -1
- package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +17 -23
- package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +4 -7
- package/src/screens/AddNewGateway/SelectGateway.js +0 -1
- package/src/screens/AddNewGateway/SetupGatewayWifi.js +0 -2
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +6 -4
- package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +4 -0
- package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +29 -5
- package/src/screens/AddNewGateway/__test__/SelectGateway.test.js +4 -0
- package/src/screens/AddNewGateway/__test__/SetupGateway.test.js +4 -0
- package/src/screens/AddNewGateway/index.js +0 -1
- package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +24 -10
- package/src/screens/AddNewOneTap/index.js +2 -3
- package/src/screens/AllCamera/index.js +4 -4
- package/src/screens/Automate/MultiUnits.js +8 -8
- package/src/screens/Automate/__test__/MultiUnits.test.js +9 -6
- package/src/screens/Automate/__test__/index.test.js +12 -7
- package/src/screens/Automate/index.js +3 -5
- package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +8 -36
- package/src/screens/ConfirmUnitDeletion/index.js +1 -7
- package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +22 -71
- package/src/screens/Device/EditDevice/index.js +15 -17
- package/src/screens/Device/__test__/detail.test.js +86 -33
- package/src/screens/Device/components/DetailHistoryChart.js +1 -1
- package/src/screens/Device/components/SensorConnectStatusViewHeader.js +0 -1
- package/src/screens/Device/components/SensorDisplayItem.js +2 -5
- package/src/screens/Device/detail.js +24 -80
- package/src/screens/Device/hooks/useDisconnectedDevice.js +4 -4
- package/src/screens/Device/hooks/useFavoriteDevice.js +9 -5
- package/src/screens/DeviceInfo/__test__/index.test.js +2 -0
- package/src/screens/EditActionsList/index.js +1 -1
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +3 -6
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +19 -7
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +2 -20
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +23 -40
- package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
- package/src/screens/EmergencySetting/index.js +1 -4
- package/src/screens/EnterPassword/__test__/EnterPassword.test.js +25 -41
- package/src/screens/Explore/index.js +0 -2
- package/src/screens/GuestInfo/__test__/index.test.js +41 -14
- package/src/screens/GuestInfo/components/RecurringDetail.js +0 -1
- package/src/screens/GuestInfo/components/TemporaryDetail.js +2 -2
- package/src/screens/HanetCamera/Detail.js +1 -1
- package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +12 -8
- package/src/screens/HanetCamera/__test__/Detail.test.js +42 -27
- package/src/screens/HanetCamera/__test__/ManageAccess.test.js +5 -8
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +32 -10
- package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -3
- package/src/screens/HanetCamera/hooks/__test__/useHanetCheckinData.test.js +35 -43
- package/src/screens/HanetCamera/hooks/__test__/useHanetPlaceMembers.test.js +21 -10
- package/src/screens/HanetCamera/hooks/useHanetCheckinData.js +11 -11
- package/src/screens/HanetCamera/hooks/useHanetPlaceMembers.js +11 -11
- package/src/screens/ManageAccess/__test__/ManageAccess.test.js +22 -33
- package/src/screens/ManageAccess/hooks/__test__/useManageAccess.test.js +45 -44
- package/src/screens/ManageAccess/hooks/index.js +4 -7
- package/src/screens/ManageAccess/index.js +1 -2
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +12 -35
- package/src/screens/MoveToAnotherSubUnit/index.js +6 -6
- package/src/screens/Notification/__test__/Notification.test.js +25 -14
- package/src/screens/Notification/__test__/NotificationItem.test.js +7 -8
- package/src/screens/Notification/components/NotificationItem.js +20 -17
- package/src/screens/Notification/index.js +2 -9
- package/src/screens/PlayBackCamera/Timer.js +2 -2
- package/src/screens/PlayBackCamera/__test__/index.test.js +2 -87
- package/src/screens/PlayBackCamera/index.js +6 -22
- package/src/screens/ScanChipQR/__test__/ScanChipQR.test.js +20 -7
- package/src/screens/ScanChipQR/components/QRScan/index.js +0 -1
- package/src/screens/ScanChipQR/hooks/index.js +16 -15
- package/src/screens/ScanSensorQR/__test__/ScanSensorQR.test.js +24 -8
- package/src/screens/ScriptDetail/__test__/index.test.js +86 -17
- package/src/screens/ScriptDetail/index.js +14 -19
- package/src/screens/SelectUnit/__test__/index.test.js +55 -12
- package/src/screens/SelectUnit/index.js +4 -9
- package/src/screens/SetSchedule/index.js +11 -15
- package/src/screens/SharedUnit/__test__/TabHeader.test.js +2 -0
- package/src/screens/SharedUnit/index.js +0 -2
- package/src/screens/Sharing/Components/SensorItem.js +12 -10
- package/src/screens/Sharing/InfoMemberUnit.js +1 -1
- package/src/screens/Sharing/MemberList.js +11 -12
- package/src/screens/Sharing/SelectPermission.js +76 -121
- package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +29 -47
- package/src/screens/Sharing/__test__/MemberList.test.js +127 -13
- package/src/screens/Sharing/__test__/SelectPermission.test.js +38 -28
- package/src/screens/Sharing/__test__/SelectUser.test.js +38 -17
- package/src/screens/Sharing/hooks/index.js +0 -3
- package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +2 -3
- package/src/screens/SmartIr/components/SelectBrand.js +1 -1
- package/src/screens/SubUnit/AddSubUnit.js +17 -23
- package/src/screens/SubUnit/Detail.js +2 -1
- package/src/screens/SubUnit/EditSubUnit.js +13 -15
- package/src/screens/SubUnit/ManageSubUnit.js +7 -13
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +89 -29
- package/src/screens/SubUnit/__test__/Detail.test.js +8 -31
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +89 -21
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +1 -27
- package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +45 -48
- package/src/screens/SubUnit/hooks/useManageSubUnit.js +7 -7
- package/src/screens/SyncLGDevice/AddLGDevice.js +0 -1
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +91 -22
- package/src/screens/TDSGuide/index.js +1 -4
- package/src/screens/UVIndexGuide/index.js +1 -1
- package/src/screens/Unit/ChooseLocation.js +14 -7
- package/src/screens/Unit/Detail.js +75 -30
- package/src/screens/Unit/ManageUnit.js +0 -1
- package/src/screens/Unit/SelectAddress.js +23 -45
- package/src/screens/Unit/SmartAccount.js +4 -4
- package/src/screens/Unit/Station/index.js +0 -4
- package/src/screens/Unit/Summaries.js +2 -18
- package/src/screens/Unit/__test__/CheckSendEmail.test.js +29 -24
- package/src/screens/Unit/__test__/ChooseLocation.test.js +14 -27
- package/src/screens/Unit/__test__/Detail.test.js +200 -99
- package/src/screens/Unit/__test__/ManageUnit.test.js +42 -18
- package/src/screens/Unit/__test__/SelectAddress.test.js +49 -159
- package/src/screens/Unit/__test__/SmartAccount.test.js +9 -17
- package/src/screens/Unit/__test__/SmartAccountItem.test.js +1 -0
- package/src/screens/Unit/components/MyUnitDevice/index.js +4 -4
- package/src/screens/Unit/components/SharedUnit/index.js +0 -1
- package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
- package/src/screens/Unit/components/__test__/SharedUnit.test.js +34 -31
- package/src/screens/Unit/styles.js +0 -4
- package/src/screens/UnitSummary/__test__/index.test.js +30 -91
- package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +2 -31
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/__test__/index.test.js +4 -7
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/index.js +13 -2
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/ItemPower.test.js +1 -0
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +16 -14
- package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +2 -11
- package/src/screens/UnitSummary/components/RunningDevices/index.js +10 -7
- package/src/screens/UnitSummary/components/Temperature/index.js +4 -4
- package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +2 -10
- package/src/screens/UnitSummary/index.js +1 -15
- package/src/screens/WaterQualityGuide/index.js +1 -1
- package/src/utils/Apis/axios.js +31 -54
- package/src/utils/Converter/time.js +18 -0
- package/src/utils/I18n/translations/en.json +1 -7
- package/src/utils/I18n/translations/vi.json +1 -8
- package/src/utils/Route/index.js +0 -1
- package/src/utils/Utils.js +7 -11
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/ItemPasscode.test.js +0 -24
- package/src/commons/ActionGroup/__test__/NumberUpDownTemplateWithNullConfigValue.test.js +0 -60
- package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +0 -77
- package/src/commons/Calendar/__test__/Calendar.test.js +0 -33
- package/src/commons/Device/Hanet/ItemHanetDevice.test.js +0 -58
- package/src/commons/FieldTemplate/ChooseUserField/ChooseFieldStyles.js +0 -25
- package/src/commons/FieldTemplate/ChooseUserField/ChoosePopup.js +0 -96
- package/src/commons/FieldTemplate/ChooseUserField/ChoosePopupStyles.js +0 -39
- package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +0 -118
- package/src/commons/FieldTemplate/ChooseUserField/index.js +0 -62
- package/src/commons/FieldTemplate/PasscodeField/PasscodeFieldStyles.js +0 -30
- package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +0 -90
- package/src/commons/FieldTemplate/PasscodeField/index.js +0 -43
- package/src/commons/FieldTemplate/ScheduleField/ScheduleFieldStyles.js +0 -13
- package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +0 -179
- package/src/commons/FieldTemplate/ScheduleField/index.js +0 -176
- package/src/commons/PreventAccess/__test__/PreventAccess.test.js +0 -62
- package/src/hooks/Common/useGGHomeDeviceConnected.js +0 -16
- package/src/hooks/IoT/__test__/useGGHomeConnection.test.js +0 -198
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +0 -198
- package/src/hooks/IoT/index.js +0 -4
- package/src/hooks/IoT/useGGHomeConnection.js +0 -91
- package/src/hooks/IoT/useRemoteControl.js +0 -79
- package/src/hooks/index.js +0 -4
- package/src/navigations/UnitStackStyles.js +0 -21
- package/src/screens/Sharing/__test__/MemberList2.test.js +0 -80
- package/src/screens/SideMenuDetail/SideMenuDetailStyles.js +0 -28
- package/src/screens/SideMenuDetail/__test__/index.test.js +0 -154
- package/src/screens/SideMenuDetail/index.js +0 -148
- package/src/screens/Unit/__test__/Summaries.test.js +0 -100
- package/src/screens/Unit/components/MyAllUnit/__test__/MyAllUnit.test.js +0 -36
- package/src/screens/Unit/components/MyAllUnit/__test__/index.test.js +0 -54
- package/src/screens/Unit/hook/useUnitConnectRemoteDevices.js +0 -50
- package/src/utils/Permission/common.js +0 -67
- package/src/utils/Setting/Location.js +0 -30
- package/src/utils/__test__/Utils.test.js +0 -12
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { act } from '@testing-library/react-hooks';
|
|
2
|
-
import
|
|
2
|
+
import axios from 'axios';
|
|
3
3
|
import { API } from '../../../configs';
|
|
4
|
-
import api from '../../../utils/Apis/axios';
|
|
5
4
|
import { getConfigGlobalState, setConfigGlobalState } from '../../states';
|
|
6
5
|
import { lgThinqConnect, sendCommandOverLGThinq } from '../LG';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
jest.mock('axios');
|
|
9
8
|
|
|
10
9
|
describe('Remote Control LG Thinq', () => {
|
|
11
10
|
let options;
|
|
@@ -14,6 +13,8 @@ describe('Remote Control LG Thinq', () => {
|
|
|
14
13
|
|
|
15
14
|
beforeEach(() => {
|
|
16
15
|
setConfigGlobalState('configValues', {});
|
|
16
|
+
axios.get.mockClear();
|
|
17
|
+
axios.post.mockClear();
|
|
17
18
|
|
|
18
19
|
options = [
|
|
19
20
|
{
|
|
@@ -52,52 +53,116 @@ describe('Remote Control LG Thinq', () => {
|
|
|
52
53
|
});
|
|
53
54
|
|
|
54
55
|
it('Connect to LGThinq basic will fetch device status', async () => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
const response = {
|
|
57
|
+
status: 200,
|
|
58
|
+
data: {
|
|
59
|
+
airFlow: {
|
|
60
|
+
windStrength: 'LOW',
|
|
61
|
+
},
|
|
58
62
|
},
|
|
63
|
+
};
|
|
64
|
+
axios.get.mockImplementation(async () => {
|
|
65
|
+
return response;
|
|
59
66
|
});
|
|
60
67
|
|
|
61
68
|
let configValues = getConfigGlobalState('configValues');
|
|
62
69
|
expect(configValues).toEqual({});
|
|
70
|
+
|
|
71
|
+
jest.useFakeTimers();
|
|
63
72
|
await lgThinqConnect(options);
|
|
73
|
+
await act(async () => {
|
|
74
|
+
await jest.runAllTimers();
|
|
75
|
+
});
|
|
76
|
+
|
|
64
77
|
configValues = getConfigGlobalState('configValues');
|
|
65
|
-
expect(configValues).toEqual({});
|
|
78
|
+
expect(configValues).toEqual({ 1: 'LOW' });
|
|
66
79
|
});
|
|
67
80
|
|
|
68
81
|
it('Send command over lg thinq will call sendCommandOverInternet then fetch device status', async () => {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
82
|
+
const responseGet = {
|
|
83
|
+
status: 200,
|
|
84
|
+
data: {
|
|
85
|
+
airFlow: {
|
|
86
|
+
windStrength: 'AUTO',
|
|
87
|
+
},
|
|
72
88
|
},
|
|
89
|
+
};
|
|
90
|
+
axios.get.mockImplementation(async () => {
|
|
91
|
+
return responseGet;
|
|
73
92
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
93
|
+
|
|
94
|
+
const responsePost = {
|
|
95
|
+
status: 200,
|
|
96
|
+
data: {},
|
|
97
|
+
};
|
|
98
|
+
axios.post.mockImplementation(async () => {
|
|
99
|
+
return responsePost;
|
|
81
100
|
});
|
|
101
|
+
|
|
102
|
+
jest.useFakeTimers();
|
|
103
|
+
setConfigGlobalState('configValues', { 1: 'LOW' });
|
|
82
104
|
await sendCommandOverLGThinq(sensor, action, 'AUTO');
|
|
83
|
-
|
|
105
|
+
await act(async () => {
|
|
106
|
+
await jest.runAllTimers();
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
expect(axios.post).toHaveBeenCalledTimes(1);
|
|
110
|
+
expect(axios.post).toHaveBeenCalledWith(
|
|
111
|
+
API.SENSOR.QUICK_ACTION(sensor.id),
|
|
112
|
+
{
|
|
113
|
+
key: action.key,
|
|
114
|
+
data: JSON.stringify({ airFlow: { windStrength: 'AUTO' } }),
|
|
115
|
+
source: 'lg_thinq',
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
expect(axios.get).toHaveBeenCalledTimes(0);
|
|
119
|
+
expect(axios.get).not.toHaveBeenCalledWith(
|
|
120
|
+
API.IOT.LG.DEVICE_STATUS(sensor.id),
|
|
121
|
+
{}
|
|
122
|
+
);
|
|
123
|
+
let configValues = getConfigGlobalState('configValues');
|
|
84
124
|
expect(configValues).toEqual({ 1: 'LOW' });
|
|
85
125
|
});
|
|
86
126
|
|
|
87
127
|
it('Send command over lg thinq but fetch device status failed', async () => {
|
|
88
|
-
|
|
89
|
-
|
|
128
|
+
const responseGet = {
|
|
129
|
+
data: {},
|
|
130
|
+
};
|
|
131
|
+
axios.get.mockImplementation(async () => {
|
|
132
|
+
return responseGet;
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
const responsePost = {
|
|
136
|
+
status: 200,
|
|
137
|
+
data: {},
|
|
138
|
+
};
|
|
139
|
+
axios.post.mockImplementation(async () => {
|
|
140
|
+
return responsePost;
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
jest.useFakeTimers();
|
|
144
|
+
|
|
90
145
|
setConfigGlobalState('configValues', { 1: 'LOW' });
|
|
91
146
|
await sendCommandOverLGThinq(sensor, action, 'AUTO');
|
|
147
|
+
await act(async () => {
|
|
148
|
+
await jest.runAllTimers();
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
expect(axios.post).toHaveBeenCalledTimes(1);
|
|
152
|
+
expect(axios.get).toHaveBeenCalledTimes(0);
|
|
153
|
+
expect(axios.get).not.toHaveBeenCalledWith(
|
|
154
|
+
API.IOT.LG.DEVICE_STATUS(sensor.id),
|
|
155
|
+
{}
|
|
156
|
+
);
|
|
92
157
|
let configValues = getConfigGlobalState('configValues');
|
|
93
158
|
expect(configValues).toEqual({ 1: 'LOW' });
|
|
94
159
|
});
|
|
95
160
|
|
|
96
161
|
it('Send command over lg thinq but empty actions', async () => {
|
|
97
162
|
action.lg_actions = [];
|
|
98
|
-
let configValues = getConfigGlobalState('configValues');
|
|
99
163
|
await sendCommandOverLGThinq(sensor, action, 'AUTO');
|
|
100
|
-
expect(
|
|
164
|
+
expect(axios.post).not.toHaveBeenCalled();
|
|
165
|
+
expect(axios.get).not.toHaveBeenCalled();
|
|
101
166
|
});
|
|
102
167
|
|
|
103
168
|
it('Send command over lg thinq for timer', async () => {
|
|
@@ -144,41 +209,115 @@ describe('Remote Control LG Thinq', () => {
|
|
|
144
209
|
},
|
|
145
210
|
},
|
|
146
211
|
};
|
|
147
|
-
|
|
212
|
+
axios.get.mockImplementation(async () => {
|
|
213
|
+
return responseGet;
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
const responsePost = {
|
|
217
|
+
status: 200,
|
|
218
|
+
data: {},
|
|
219
|
+
};
|
|
220
|
+
axios.post.mockImplementation(async () => {
|
|
221
|
+
return responsePost;
|
|
222
|
+
});
|
|
148
223
|
jest.useFakeTimers();
|
|
149
|
-
|
|
224
|
+
|
|
150
225
|
await lgThinqConnect(options);
|
|
226
|
+
|
|
151
227
|
setConfigGlobalState('configValues', { 1: 0, 2: 0 });
|
|
152
228
|
await sendCommandOverLGThinq(sensor, action, [18, 30]);
|
|
229
|
+
expect(axios.post).toHaveBeenCalledTimes(1);
|
|
230
|
+
expect(axios.post).toHaveBeenCalledWith(
|
|
231
|
+
API.SENSOR.QUICK_ACTION(sensor.id),
|
|
232
|
+
{
|
|
233
|
+
key: action.key,
|
|
234
|
+
data: JSON.stringify({
|
|
235
|
+
timer: { absoluteHourToStart: 18, absoluteMinuteToStart: 30 },
|
|
236
|
+
}),
|
|
237
|
+
source: 'lg_thinq',
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
|
|
153
241
|
await act(async () => {
|
|
154
242
|
await jest.runAllTimers();
|
|
155
243
|
});
|
|
244
|
+
expect(axios.get).toHaveBeenCalledTimes(1);
|
|
245
|
+
expect(axios.get).toHaveBeenCalledWith(API.IOT.LG.DEVICE_STATUS(2), {});
|
|
156
246
|
let configValues = getConfigGlobalState('configValues');
|
|
157
|
-
expect(configValues).toEqual({ 1:
|
|
247
|
+
expect(configValues).toEqual({ 1: 18, 2: 30 });
|
|
158
248
|
});
|
|
159
249
|
|
|
160
250
|
it('Send command over lg thinq will call sendCommandOverInternet with boolean', async () => {
|
|
161
|
-
|
|
162
|
-
|
|
251
|
+
const responsePost = {
|
|
252
|
+
status: 200,
|
|
253
|
+
data: {},
|
|
254
|
+
};
|
|
255
|
+
axios.post.mockImplementation(async () => {
|
|
256
|
+
return responsePost;
|
|
257
|
+
});
|
|
258
|
+
|
|
163
259
|
await sendCommandOverLGThinq(sensor, action, true);
|
|
164
|
-
expect(
|
|
260
|
+
expect(axios.post).toHaveBeenCalledTimes(1);
|
|
261
|
+
expect(axios.post).toHaveBeenCalledWith(
|
|
262
|
+
API.SENSOR.QUICK_ACTION(sensor.id),
|
|
263
|
+
{
|
|
264
|
+
key: action.key,
|
|
265
|
+
data: JSON.stringify({ airFlow: { windStrength: true } }),
|
|
266
|
+
source: 'lg_thinq',
|
|
267
|
+
}
|
|
268
|
+
);
|
|
165
269
|
});
|
|
166
270
|
|
|
167
271
|
it('Send command over lg thinq will call sendCommandOverInternet with number', async () => {
|
|
168
|
-
|
|
169
|
-
|
|
272
|
+
const responsePost = {
|
|
273
|
+
status: 200,
|
|
274
|
+
data: {},
|
|
275
|
+
};
|
|
276
|
+
axios.post.mockImplementation(async () => {
|
|
277
|
+
return responsePost;
|
|
278
|
+
});
|
|
279
|
+
|
|
170
280
|
await sendCommandOverLGThinq(sensor, action, 7);
|
|
171
|
-
expect(
|
|
281
|
+
expect(axios.post).toHaveBeenCalledTimes(1);
|
|
282
|
+
expect(axios.post).toHaveBeenCalledWith(
|
|
283
|
+
API.SENSOR.QUICK_ACTION(sensor.id),
|
|
284
|
+
{
|
|
285
|
+
key: action.key,
|
|
286
|
+
data: JSON.stringify({ airFlow: { windStrength: 7 } }),
|
|
287
|
+
source: 'lg_thinq',
|
|
288
|
+
}
|
|
289
|
+
);
|
|
172
290
|
});
|
|
173
291
|
|
|
174
292
|
it('Send command over lg thinq will call sendCommandOverInternet with number, write first in message', async () => {
|
|
175
|
-
let configValues = getConfigGlobalState('configValues');
|
|
176
293
|
action.lg_actions[0].message = {
|
|
177
294
|
temperature: { targetTemperature: 0, locationName: 'FRIDGE', unit: 'C' },
|
|
178
295
|
};
|
|
179
|
-
|
|
296
|
+
|
|
297
|
+
const responsePost = {
|
|
298
|
+
status: 200,
|
|
299
|
+
data: {},
|
|
300
|
+
};
|
|
301
|
+
axios.post.mockImplementation(async () => {
|
|
302
|
+
return responsePost;
|
|
303
|
+
});
|
|
304
|
+
|
|
180
305
|
await sendCommandOverLGThinq(sensor, action, 7);
|
|
181
|
-
expect(
|
|
306
|
+
expect(axios.post).toHaveBeenCalledTimes(1);
|
|
307
|
+
expect(axios.post).toHaveBeenCalledWith(
|
|
308
|
+
API.SENSOR.QUICK_ACTION(sensor.id),
|
|
309
|
+
{
|
|
310
|
+
key: action.key,
|
|
311
|
+
data: JSON.stringify({
|
|
312
|
+
temperature: {
|
|
313
|
+
targetTemperature: 7,
|
|
314
|
+
locationName: 'FRIDGE',
|
|
315
|
+
unit: 'C',
|
|
316
|
+
},
|
|
317
|
+
}),
|
|
318
|
+
source: 'lg_thinq',
|
|
319
|
+
}
|
|
320
|
+
);
|
|
182
321
|
});
|
|
183
322
|
|
|
184
323
|
it('fetch temperature case', async () => {
|
|
@@ -240,7 +379,9 @@ describe('Remote Control LG Thinq', () => {
|
|
|
240
379
|
],
|
|
241
380
|
},
|
|
242
381
|
};
|
|
243
|
-
|
|
382
|
+
axios.get.mockImplementation(async () => {
|
|
383
|
+
return response;
|
|
384
|
+
});
|
|
244
385
|
|
|
245
386
|
let configValues = getConfigGlobalState('configValues');
|
|
246
387
|
expect(configValues).toEqual({});
|
|
@@ -252,6 +393,6 @@ describe('Remote Control LG Thinq', () => {
|
|
|
252
393
|
});
|
|
253
394
|
|
|
254
395
|
configValues = getConfigGlobalState('configValues');
|
|
255
|
-
expect(configValues).toEqual({});
|
|
396
|
+
expect(configValues).toEqual({ 1: -10, 2: 7 });
|
|
256
397
|
});
|
|
257
398
|
});
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import {
|
|
2
|
+
SEND_COMMAND_OVER_BLUETOOTH_FAIL,
|
|
3
|
+
sendCommandOverBluetooth,
|
|
4
|
+
} from './Bluetooth';
|
|
5
|
+
import { sendCommandOverInternet } from './Internet';
|
|
6
|
+
import { sendCommandOverGoogleHome } from './GoogleHome';
|
|
7
|
+
import { ToastBottomHelper } from '../../utils/Utils';
|
|
8
|
+
import t from '../../hooks/Common/useTranslations';
|
|
9
|
+
import { sendCommandOverLGThinq } from './LG';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
11
|
+
export const sendRemoteCommand = async (
|
|
12
|
+
sensor,
|
|
13
|
+
action,
|
|
14
|
+
data,
|
|
15
|
+
userId = null,
|
|
16
|
+
actionName
|
|
17
|
+
) => {
|
|
18
|
+
// No action, raise not authorized
|
|
19
|
+
let result = false;
|
|
20
|
+
if (!action) {
|
|
21
|
+
ToastBottomHelper.error(
|
|
22
|
+
t('your_account_has_not_been_authorized_to_control')
|
|
23
|
+
);
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
if (action.command_prefer_over_bluetooth) {
|
|
27
|
+
try {
|
|
28
|
+
result = await sendCommandOverBluetooth(sensor, action, data, userId);
|
|
29
|
+
} catch (err) {
|
|
30
|
+
if (err === SEND_COMMAND_OVER_BLUETOOTH_FAIL) {
|
|
31
|
+
result = await sendCommandOverInternet(
|
|
32
|
+
sensor,
|
|
33
|
+
action,
|
|
34
|
+
data,
|
|
35
|
+
'bluetooth',
|
|
36
|
+
actionName
|
|
37
|
+
);
|
|
38
|
+
} else {
|
|
39
|
+
throw err;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (action.command_prefer_over_internet) {
|
|
44
|
+
result = await sendCommandOverInternet(sensor, action, data, 'internet');
|
|
45
|
+
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
if (action.command_prefer_over_googlehome) {
|
|
48
|
+
result = await sendCommandOverGoogleHome(sensor, action, data);
|
|
49
|
+
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
if (action.command_prefer_over_lg) {
|
|
52
|
+
result = await sendCommandOverLGThinq(sensor, action, data);
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { memo, useContext, useEffect } from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
3
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
4
|
import { createStackNavigator } from '@react-navigation/stack';
|
|
5
5
|
import { BleManager } from 'react-native-ble-plx';
|
|
@@ -52,10 +52,9 @@ import ConfirmUnitDeletion from '../screens/ConfirmUnitDeletion';
|
|
|
52
52
|
import InfoMemberUnit from '../screens/Sharing/InfoMemberUnit';
|
|
53
53
|
import EnterPassword from '../screens/EnterPassword';
|
|
54
54
|
import { HanetCameraStack } from './HanetCameraStack';
|
|
55
|
+
|
|
55
56
|
import { axiosGet } from '../utils/Apis/axios';
|
|
56
57
|
import { API } from '../configs';
|
|
57
|
-
import SideMenuDetail from '../screens/SideMenuDetail';
|
|
58
|
-
import { styles } from './UnitStackStyles';
|
|
59
58
|
|
|
60
59
|
const Stack = createStackNavigator();
|
|
61
60
|
|
|
@@ -173,9 +172,12 @@ export const UnitStack = memo((props) => {
|
|
|
173
172
|
component={ChooseLocation}
|
|
174
173
|
options={{
|
|
175
174
|
headerShown: true,
|
|
175
|
+
headerTitleStyle: {
|
|
176
|
+
...styles.headerLocation,
|
|
177
|
+
},
|
|
176
178
|
headerTitle: () => (
|
|
177
179
|
<View style={styles.headerLocation}>
|
|
178
|
-
<Text color={Colors.Gray9}
|
|
180
|
+
<Text type="H3" color={Colors.Gray9} bold>
|
|
179
181
|
{t('choose_on_map')}
|
|
180
182
|
</Text>
|
|
181
183
|
|
|
@@ -261,13 +263,6 @@ export const UnitStack = memo((props) => {
|
|
|
261
263
|
headerShown: false,
|
|
262
264
|
}}
|
|
263
265
|
/>
|
|
264
|
-
<Stack.Screen
|
|
265
|
-
name={Route.SideMenuDetail}
|
|
266
|
-
component={SideMenuDetail}
|
|
267
|
-
options={{
|
|
268
|
-
headerShown: false,
|
|
269
|
-
}}
|
|
270
|
-
/>
|
|
271
266
|
<Stack.Screen
|
|
272
267
|
name={Route.UnitMemberList}
|
|
273
268
|
component={SharingMemberList}
|
|
@@ -403,3 +398,17 @@ export const UnitStack = memo((props) => {
|
|
|
403
398
|
</Stack.Navigator>
|
|
404
399
|
);
|
|
405
400
|
});
|
|
401
|
+
|
|
402
|
+
const styles = StyleSheet.create({
|
|
403
|
+
icLeft: {
|
|
404
|
+
marginLeft: Device.isIOS ? 8 : 0,
|
|
405
|
+
},
|
|
406
|
+
headerLocation: {
|
|
407
|
+
alignItems: 'center',
|
|
408
|
+
justifyContent: 'center',
|
|
409
|
+
},
|
|
410
|
+
headerContent: {
|
|
411
|
+
textAlign: 'center',
|
|
412
|
+
paddingBottom: 8,
|
|
413
|
+
},
|
|
414
|
+
});
|
|
@@ -83,7 +83,7 @@ const AQIGuide = memo(() => {
|
|
|
83
83
|
|
|
84
84
|
return (
|
|
85
85
|
<SafeAreaView style={styles.container}>
|
|
86
|
-
<ScrollView style={styles.container}
|
|
86
|
+
<ScrollView style={styles.container}>
|
|
87
87
|
{titles.map((item, index) => {
|
|
88
88
|
const { title, des } = item;
|
|
89
89
|
return (
|
|
@@ -2,10 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { SectionList, Text, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { create } from 'react-test-renderer';
|
|
4
4
|
import { act } from '@testing-library/react-hooks';
|
|
5
|
-
import MockAdapter from 'axios-mock-adapter';
|
|
6
|
-
|
|
7
5
|
import ActivityLog from '../';
|
|
8
|
-
import {
|
|
6
|
+
import { Constants } from '../../../configs';
|
|
9
7
|
import { SCProvider } from '../../../context';
|
|
10
8
|
import { mockSCStore } from '../../../context/mockStore';
|
|
11
9
|
import ItemLog from '../ItemLog';
|
|
@@ -13,7 +11,7 @@ import DateTimeRangeChange from '../../../commons/DateTimeRangeChange';
|
|
|
13
11
|
import DateTimePickerModal from 'react-native-modal-datetime-picker';
|
|
14
12
|
import Modal from 'react-native-modal';
|
|
15
13
|
import { AUTOMATE_TYPE, TESTID } from '../../../configs/Constants';
|
|
16
|
-
import
|
|
14
|
+
import axios from 'axios';
|
|
17
15
|
|
|
18
16
|
const mockUseSelector = jest.fn();
|
|
19
17
|
|
|
@@ -32,7 +30,7 @@ jest.mock('react', () => {
|
|
|
32
30
|
};
|
|
33
31
|
});
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
jest.mock('axios');
|
|
36
34
|
|
|
37
35
|
const wrapComponent = (route) => (
|
|
38
36
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -54,7 +52,9 @@ describe('Test Activity log', () => {
|
|
|
54
52
|
Date.now = jest.fn(() => new Date('2021-07-02T15:48:24.917932Z'));
|
|
55
53
|
|
|
56
54
|
it('render empty list', async () => {
|
|
57
|
-
|
|
55
|
+
axios.get.mockImplementation(async () => {
|
|
56
|
+
return { status: 400 };
|
|
57
|
+
});
|
|
58
58
|
await act(async () => {
|
|
59
59
|
tree = await create(wrapComponent(route));
|
|
60
60
|
});
|
|
@@ -69,39 +69,21 @@ describe('Test Activity log', () => {
|
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
it('render without params', async () => {
|
|
73
|
-
await act(async () => {
|
|
74
|
-
tree = await create(wrapComponent({}));
|
|
75
|
-
});
|
|
76
|
-
const instance = tree.root;
|
|
77
|
-
const SectionListElement = instance.findAllByType(SectionList);
|
|
78
|
-
expect(SectionListElement).toHaveLength(1);
|
|
79
|
-
const TextElement = instance.findAllByType(Text);
|
|
80
|
-
expect(TextElement[2].props.style).toEqual([
|
|
81
|
-
{
|
|
82
|
-
color: '#000',
|
|
83
|
-
fontFamily: 'SFProDisplay-Regular',
|
|
84
|
-
fontSize: undefined,
|
|
85
|
-
lineHeight: undefined,
|
|
86
|
-
textAlign: 'left',
|
|
87
|
-
textDecorationLine: 'none',
|
|
88
|
-
},
|
|
89
|
-
{ textAlign: 'center' },
|
|
90
|
-
]);
|
|
91
|
-
});
|
|
92
|
-
|
|
93
72
|
it('render list', async () => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
73
|
+
axios.get.mockImplementationOnce(() => ({
|
|
74
|
+
status: 200,
|
|
75
|
+
data: {
|
|
76
|
+
results: [
|
|
77
|
+
{
|
|
78
|
+
id: 1,
|
|
79
|
+
content_code: 'ACTIVATED_BY',
|
|
80
|
+
params: { username: 'name' },
|
|
81
|
+
created_at: '2021-07-01T15:48:24.917932Z',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
count: 1,
|
|
85
|
+
},
|
|
86
|
+
}));
|
|
105
87
|
await act(async () => {
|
|
106
88
|
tree = await create(wrapComponent(route));
|
|
107
89
|
});
|
|
@@ -111,6 +93,9 @@ describe('Test Activity log', () => {
|
|
|
111
93
|
});
|
|
112
94
|
|
|
113
95
|
it('test open and close 2 modal', async () => {
|
|
96
|
+
axios.get.mockImplementation(async () => {
|
|
97
|
+
return { status: 400 };
|
|
98
|
+
});
|
|
114
99
|
await act(async () => {
|
|
115
100
|
tree = await create(wrapComponent(route));
|
|
116
101
|
});
|