Skip to content

Commit 0102d51

Browse files
committed
fix(voip): reorder imports before jest.mock calls; remove spurious async; fix blank line in import group
1 parent 95d06c8 commit 0102d51

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

app/lib/services/voip/MediaCallEvents.ios.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
*
44
* iOS-only paths: isIOS = true, pushTokenRegistered, mute, endCall.
55
*/
6+
7+
import type { VoipPayload } from '../../../definitions/Voip';
8+
import { registerPushToken } from '../restApi';
9+
import { createVoipEventDispatcher, type MediaCallEventsAdapters } from './MediaCallEvents';
10+
import { useCallStore } from './useCallStore';
11+
612
jest.mock('react-native', () => ({
713
Platform: { OS: 'ios' },
814
DeviceEventEmitter: { addListener: jest.fn(() => ({ remove: jest.fn() })) },
@@ -39,11 +45,6 @@ jest.mock('../../native/NativeVoip', () => ({
3945
}
4046
}));
4147

42-
import type { VoipPayload } from '../../../definitions/Voip';
43-
import { registerPushToken } from '../restApi';
44-
import { createVoipEventDispatcher, type MediaCallEventsAdapters } from './MediaCallEvents';
45-
import { useCallStore } from './useCallStore';
46-
4748
jest.mock('../../methods/helpers', () => ({
4849
isIOS: true,
4950
normalizeDeepLinkingServerHost: jest.requireActual('../../methods/helpers/normalizeDeepLinkingServerHost')
@@ -208,7 +209,7 @@ describe('createVoipEventDispatcher — acceptSucceeded (iOS)', () => {
208209
getState.mockReturnValue({ setNativeAcceptedCallId: mockSetNativeAcceptedCallId });
209210
});
210211

211-
it('applies REST signals and returns true for iOS cold-start same-workspace', async () => {
212+
it('applies REST signals and returns true for iOS cold-start same-workspace', () => {
212213
const { mediaSessionInstance } = jest.requireMock('./MediaSessionInstance');
213214
const callId = 'answered-ios-uuid';
214215
mockServerSelector.mockReturnValue('https://same.example.com');

app/lib/services/voip/MediaCallEvents.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import type { VoipPayload } from '../../../definitions/Voip';
2+
import { createVoipEventDispatcher, type MediaCallEventsAdapters } from './MediaCallEvents';
3+
import { useCallStore } from './useCallStore';
4+
15
jest.mock('react-native-callkeep', () => ({
26
__esModule: true,
37
default: {
@@ -25,10 +29,6 @@ jest.mock('../../native/NativeVoip', () => ({
2529
}
2630
}));
2731

28-
import type { VoipPayload } from '../../../definitions/Voip';
29-
import { createVoipEventDispatcher, type MediaCallEventsAdapters } from './MediaCallEvents';
30-
import { useCallStore } from './useCallStore';
31-
3232
jest.mock('../../methods/helpers', () => ({
3333
...jest.requireActual('../../methods/helpers'),
3434
isIOS: false

app/lib/services/voip/MediaSessionInstance.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { IClientMediaCall } from '@rocket.chat/media-signaling';
22
import { waitFor } from '@testing-library/react-native';
33

44
import { voipNative, type InMemoryVoipNative } from './VoipNative';
5-
65
import type { IDDPMessage } from '../../../definitions/IDDPMessage';
76
import Navigation from '../../navigation/appNavigation';
87
import { getDMSubscriptionByUsername } from '../../database/services/Subscription';

app/lib/services/voip/VoipNative.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import type { VoipPayload } from '../../../definitions/Voip';
2+
import { InMemoryVoipNative, type VoipNativeEvent } from './VoipNative';
3+
14
jest.mock('react-native-webrtc', () => ({ registerGlobals: jest.fn() }));
25
jest.mock('react-native-callkeep', () => ({
36
__esModule: true,
@@ -25,9 +28,6 @@ jest.mock('../../native/NativeVoip', () => ({
2528
}
2629
}));
2730

28-
import type { VoipPayload } from '../../../definitions/Voip';
29-
import { InMemoryVoipNative, type VoipNativeEvent } from './VoipNative';
30-
3131
function buildPayload(callId = 'call-1'): VoipPayload {
3232
return {
3333
callId,

0 commit comments

Comments
 (0)