Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3eb9bd9

Browse files
authored
Merge pull request#68 from Resgrid/develop
CU-868ex18rd And16k SignalR update.
2 parentsfbf3e9e +ec07343 commit3eb9bd9

19 files changed

+2607
-292
lines changed

‎jest-setup.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ global.window = {};
66
//@ts-ignore
77
global.window=global;
88

9+
// Enable Jest fake timers globally for proper timer handling
10+
jest.useFakeTimers();
11+
12+
// Polyfill setImmediate if needed (for React Native environment)
13+
if(typeofglobal.setImmediate==='undefined'){
14+
//@ts-ignore - Simple polyfill for setImmediate
15+
global.setImmediate=(callback:(...args:any[])=>void, ...args:any[])=>{
16+
returnsetTimeout(callback,0, ...args);
17+
};
18+
}
19+
920
// Mock React Native Appearance for NativeWind
1021
jest.mock('react-native/Libraries/Utilities/Appearance',()=>({
1122
getColorScheme:jest.fn(()=>'light'),

‎package.json‎

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"@notifee/react-native":"^9.1.8",
8686
"@novu/react-native":"~2.6.6",
8787
"@react-native-community/netinfo":"11.4.1",
88-
"@rnmapbox/maps":"10.1.38",
88+
"@rnmapbox/maps":"10.1.42-rc.0",
8989
"@semantic-release/git":"^10.0.1",
9090
"@sentry/react-native":"~6.10.0",
9191
"@shopify/flash-list":"1.7.3",
@@ -137,26 +137,27 @@
137137
"react-error-boundary":"~4.0.13",
138138
"react-hook-form":"~7.53.0",
139139
"react-i18next":"~15.0.1",
140-
"react-native":"0.76.9",
140+
"react-native":"0.77.3",
141141
"react-native-base64":"~0.2.1",
142142
"react-native-ble-manager":"^12.1.5",
143143
"react-native-calendars":"^1.1313.0",
144144
"react-native-callkeep":"github:Irfanwani/react-native-callkeep#957193d0716f1c2dfdc18e627cbff0f8a0800971",
145145
"react-native-edge-to-edge":"~1.1.2",
146146
"react-native-flash-message":"~0.4.2",
147-
"react-native-gesture-handler":"~2.20.2",
147+
"react-native-gesture-handler":"~2.22.0",
148148
"react-native-get-random-values":"^1.11.0",
149149
"react-native-keyboard-controller":"~1.15.2",
150150
"react-native-logs":"~5.3.0",
151151
"react-native-mmkv":"~3.1.0",
152152
"react-native-permissions":"^5.4.1",
153-
"react-native-reanimated":"~3.16.1",
153+
"react-native-reanimated":"~3.16.7",
154154
"react-native-restart":"0.0.27",
155-
"react-native-safe-area-context":"4.12.0",
156-
"react-native-screens":"~4.4.0",
155+
"react-native-safe-area-context":"~5.1.0",
156+
"react-native-screens":"~4.8.0",
157157
"react-native-svg":"~15.8.0",
158+
"react-native-url-polyfill":"^2.0.0",
158159
"react-native-web":"~0.19.13",
159-
"react-native-webview":"13.12.5",
160+
"react-native-webview":"~13.13.1",
160161
"react-query-kit":"~3.3.0",
161162
"sanitize-html":"^2.17.0",
162163
"tailwind-variants":"~0.2.1",
@@ -226,7 +227,13 @@
226227
},
227228
"install": {
228229
"exclude": [
229-
"eslint-config-expo"
230+
"eslint-config-expo",
231+
"react-native@~0.76.6",
232+
"react-native-reanimated@~3.16.1",
233+
"react-native-gesture-handler@~2.20.0",
234+
"react-native-screens@~4.4.0",
235+
"react-native-safe-area-context@~4.12.0",
236+
"react-native-webview@~13.12.5"
230237
]
231238
}
232239
},

‎src/api/common/client.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ export const api = axiosInstance;
120120
// Helper function to create API endpoints
121121
exportconstcreateApiEndpoint=(endpoint:string)=>{
122122
return{
123-
get:<T,>(params?:Record<string,unknown>)=>api.get<T>(endpoint,{ params}),
124-
post:<T,>(data:Record<string,unknown>)=>api.post<T>(endpoint,data),
125-
put:<T,>(data:Record<string,unknown>)=>api.put<T>(endpoint,data),
126-
delete:<T,>(params?:Record<string,unknown>)=>api.delete<T>(endpoint,{ params}),
123+
get:<T,>(params?:Record<string,unknown>,signal?:AbortSignal)=>api.get<T>(endpoint,{ params, signal}),
124+
post:<T,>(data:Record<string,unknown>,signal?:AbortSignal)=>api.post<T>(endpoint,data,{ signal}),
125+
put:<T,>(data:Record<string,unknown>,signal?:AbortSignal)=>api.put<T>(endpoint,data,{ signal}),
126+
delete:<T,>(params?:Record<string,unknown>,signal?:AbortSignal)=>api.delete<T>(endpoint,{ params, signal}),
127127
};
128128
};

‎src/api/mapping/mapping.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { type GetMapLayersResult } from '@/models/v4/mapping/getMapLayersResult'
33

44
import{createApiEndpoint}from'../common/client';
55

6-
constgetMayLayersApi=createApiEndpoint('/Mapping/GetMayLayers');
6+
constgetMayLayersApi=createApiEndpoint('/Mapping/GetMapLayers');
77

88
constgetMapDataAndMarkersApi=createApiEndpoint('/Mapping/GetMapDataAndMarkers');
99

10-
exportconstgetMapDataAndMarkers=async()=>{
11-
constresponse=awaitgetMapDataAndMarkersApi.get<GetMapDataAndMarkersResult>();
10+
exportconstgetMapDataAndMarkers=async(signal?:AbortSignal)=>{
11+
constresponse=awaitgetMapDataAndMarkersApi.get<GetMapDataAndMarkersResult>(undefined,signal);
1212
returnresponse.data;
1313
};
1414

‎src/app/_layout.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Import URL polyfill at the very top to ensure URL is available globally
2+
import'react-native-url-polyfill/auto';
13
// Import global CSS file
24
import'../../global.css';
35
import'../lib/i18n';

‎src/components/settings/__tests__/server-url-bottom-sheet-simple.test.tsx‎

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,25 @@ jest.mock('nativewind', () => ({
1212
useColorScheme:()=>({colorScheme:'light'}),
1313
}));
1414

15-
// Mock React Native APIs with isolated mocking
16-
jest.mock('react-native/Libraries/Settings/Settings.ios',()=>({}));
17-
jest.mock('react-native/Libraries/Settings/NativeSettingsManager',()=>({
18-
getConstants:()=>({}),
19-
get:jest.fn(),
20-
set:jest.fn(),
21-
}));
22-
23-
// Partial mock of React Native - preserve all original exports and only override Platform.OS
2415
jest.mock('react-native',()=>({
25-
...jest.requireActual('react-native'),
2616
Platform:{
27-
...jest.requireActual('react-native').Platform,
2817
OS:'ios',
18+
select:jest.fn().mockImplementation((obj)=>obj.ios||obj.default),
2919
},
20+
ScrollView:({ children, ...props}:any)=>{
21+
constReact=require('react');
22+
returnReact.createElement('View',{testID:'scroll-view', ...props},children);
23+
},
24+
useWindowDimensions:()=>({
25+
width:400,
26+
height:800,
27+
}),
28+
}));
29+
30+
jest.mock('@/hooks/use-analytics',()=>({
31+
useAnalytics:()=>({
32+
trackEvent:jest.fn(),
33+
}),
3034
}));
3135

3236
jest.mock('react-hook-form',()=>({

‎src/features/livekit-call/store/__tests__/useLiveKitCallStore.test.ts‎

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ describe('useLiveKitCallStore with CallKeep Integration', () => {
9595
// Reset the store to initial state
9696
useLiveKitCallStore.setState({
9797
availableRooms:[
98-
{id:'emergency-channel',name:'Emergency Channel'},
99-
{id:'tactical-1',name:'Tactical 1'},
100-
{id:'dispatch',name:'Dispatch'},
98+
{id:'general-chat',name:'General Chat'},
99+
{id:'dev-team-sync',name:'Dev Team Sync'},
100+
{id:'product-updates',name:'Product Updates'},
101101
],
102102
selectedRoomForJoining:null,
103103
currentRoomId:null,
@@ -155,11 +155,11 @@ describe('useLiveKitCallStore with CallKeep Integration', () => {
155155

156156
describe('Room Connection with CallKeep',()=>{
157157
beforeEach(()=>{
158-
// Mock successful connection flow
158+
// Mock successful connection flow with proper async handling
159159
mockRoom.on.mockImplementation((event:any,callback:any)=>{
160160
if(event==='connectionStateChanged'){
161-
//Simulate connected state
162-
setTimeout(()=>callback('connected'),0);
161+
//Store the callback for manual triggering
162+
(mockRoomasany)._connectionStateCallback=callback;
163163
}
164164
returnmockRoom;
165165
});
@@ -169,20 +169,28 @@ describe('useLiveKitCallStore with CallKeep Integration', () => {
169169
const{ result}=renderHook(()=>useLiveKitCallStore());
170170

171171
awaitact(async()=>{
172-
awaitresult.current.actions.connectToRoom('emergency-channel','test-participant');
173-
// Wait for the connection state change event to fire
174-
awaitnewPromise(resolve=>setTimeout(resolve,100));
172+
awaitresult.current.actions.connectToRoom('general-chat','test-participant');
173+
174+
// Manually trigger the connection state change
175+
if((mockRoomasany)._connectionStateCallback){
176+
(mockRoomasany)._connectionStateCallback('connected');
177+
}
175178
});
176179

177-
expect(mockCallKeepService.startCall).toHaveBeenCalledWith('emergency-channel');
180+
expect(mockCallKeepService.startCall).toHaveBeenCalledWith('general-chat');
178181
});
179182

180183
it('should not start CallKeep call on Android',async()=>{
181184
mockPlatform.OS='android';
182185
const{ result}=renderHook(()=>useLiveKitCallStore());
183186

184187
awaitact(async()=>{
185-
awaitresult.current.actions.connectToRoom('emergency-channel','test-participant');
188+
awaitresult.current.actions.connectToRoom('dev-team-sync','test-participant');
189+
190+
// Manually trigger the connection state change
191+
if((mockRoomasany)._connectionStateCallback){
192+
(mockRoomasany)._connectionStateCallback('connected');
193+
}
186194
});
187195

188196
expect(mockCallKeepService.startCall).not.toHaveBeenCalled();
@@ -195,14 +203,17 @@ describe('useLiveKitCallStore with CallKeep Integration', () => {
195203
const{ result}=renderHook(()=>useLiveKitCallStore());
196204

197205
awaitact(async()=>{
198-
awaitresult.current.actions.connectToRoom('emergency-channel','test-participant');
199-
// Wait for the connection state change event to fire
200-
awaitnewPromise(resolve=>setTimeout(resolve,100));
206+
awaitresult.current.actions.connectToRoom('general-chat','test-participant');
207+
208+
// Manually trigger the connection state change
209+
if((mockRoomasany)._connectionStateCallback){
210+
(mockRoomasany)._connectionStateCallback('connected');
211+
}
201212
});
202213

203214
expect(mockLogger.warn).toHaveBeenCalledWith({
204215
message:'Failed to start CallKeep call (background audio may not work)',
205-
context:{ error,roomId:'emergency-channel'},
216+
context:{ error,roomId:'general-chat'},
206217
});
207218
});
208219
});
@@ -345,6 +356,7 @@ describe('useLiveKitCallStore with CallKeep Integration', () => {
345356
const{ result}=renderHook(()=>useLiveKitCallStore());
346357

347358
expect(result.current.availableRooms).toHaveLength(3);
359+
expect(result.current.availableRooms[0]).toEqual({id:'general-chat',name:'General Chat'});
348360
expect(result.current.selectedRoomForJoining).toBeNull();
349361
expect(result.current.currentRoomId).toBeNull();
350362
expect(result.current.isConnecting).toBe(false);
@@ -430,6 +442,8 @@ describe('useLiveKitCallStore with CallKeep Integration', () => {
430442
message:'Error setting microphone state',
431443
context:{ error,enabled:true},
432444
});
445+
446+
// Check that error state was set after the await completes
433447
expect(result.current.error).toBe('Could not change microphone state.');
434448
});
435449

@@ -500,7 +514,6 @@ describe('useLiveKitCallStore with CallKeep Integration', () => {
500514
});
501515

502516
describe('Error Handling',()=>{
503-
describe('Error Handling',()=>{
504517
it('should handle room initialization errors',async()=>{
505518
// Make the Room constructor throw an error
506519
MockedRoom.mockImplementationOnce(()=>{
@@ -534,17 +547,4 @@ describe('useLiveKitCallStore with CallKeep Integration', () => {
534547
expect(result.current.error).toBeNull();
535548
});
536549
});
537-
538-
it('should handle basic error state management',async()=>{
539-
const{ result}=renderHook(()=>useLiveKitCallStore());
540-
541-
// Test basic error clearing functionality since token fetching isn't implemented
542-
act(()=>{
543-
// Set an error state and then clear it
544-
result.current.actions._clearError();
545-
});
546-
547-
expect(result.current.error).toBeNull();
548-
});
549-
});
550550
});

‎src/features/livekit-call/store/useLiveKitCallStore.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import{ConnectionState,typeLocalParticipant,typeParticipant,typeRemoteParticipant,Room,typeRoomConnectOptions,RoomEvent,typeRoomOptions}from'livekit-client';// livekit-react-native re-exports these
22
import{Platform}from'react-native';
3-
importcreatefrom'zustand';
3+
import{create}from'zustand';
44

55
import{logger}from'../../../lib/logging';
66
import{callKeepService}from'../../../services/callkeep.service.ios';

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp