-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
JitsiMediaDevicesEvents.spec.ts
30 lines (24 loc) · 1.23 KB
/
JitsiMediaDevicesEvents.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import * as exported from "./JitsiMediaDevicesEvents";
// this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
describe( "/JitsiMediaDevicesEvents members", () => {
const {
DEVICE_LIST_CHANGED,
PERMISSIONS_CHANGED,
PERMISSION_PROMPT_IS_SHOWN,
JitsiMediaDevicesEvents,
...others
} = exported;
it( "known members", () => {
expect( DEVICE_LIST_CHANGED ).toBe( 'mediaDevices.devicechange' );
expect( PERMISSIONS_CHANGED ).toBe( 'rtc.permissions_changed' );
expect( PERMISSION_PROMPT_IS_SHOWN ).toBe( 'mediaDevices.permissionPromptIsShown' );
expect( JitsiMediaDevicesEvents ).toBeDefined();
expect( JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED ).toBe( 'mediaDevices.devicechange' );
expect( JitsiMediaDevicesEvents.PERMISSIONS_CHANGED ).toBe( 'rtc.permissions_changed' );
expect( JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN ).toBe( 'mediaDevices.permissionPromptIsShown' );
} );
it( "unknown members", () => {
const keys = Object.keys( others );
expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
} );
} );