modified lib-jitsi-meet dev repo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

JitsiMediaDevicesEvents.spec.ts 1.4KB

123456789101112131415161718192021222324252627282930313233
  1. import * as exported from "./JitsiMediaDevicesEvents";
  2. // this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
  3. describe( "/JitsiMediaDevicesEvents members", () => {
  4. const {
  5. DEVICE_LIST_CHANGED,
  6. PERMISSIONS_CHANGED,
  7. PERMISSION_PROMPT_IS_SHOWN,
  8. SLOW_GET_USER_MEDIA,
  9. JitsiMediaDevicesEvents,
  10. ...others
  11. } = exported;
  12. it( "known members", () => {
  13. expect( DEVICE_LIST_CHANGED ).toBe( 'mediaDevices.devicechange' );
  14. expect( PERMISSIONS_CHANGED ).toBe( 'rtc.permissions_changed' );
  15. expect( PERMISSION_PROMPT_IS_SHOWN ).toBe( 'mediaDevices.permissionPromptIsShown' );
  16. expect( SLOW_GET_USER_MEDIA ).toBe( 'mediaDevices.slowGetUserMedia' );
  17. expect( JitsiMediaDevicesEvents ).toBeDefined();
  18. expect( JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED ).toBe( 'mediaDevices.devicechange' );
  19. expect( JitsiMediaDevicesEvents.PERMISSIONS_CHANGED ).toBe( 'rtc.permissions_changed' );
  20. expect( JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN ).toBe( 'mediaDevices.permissionPromptIsShown' );
  21. expect( JitsiMediaDevicesEvents.SLOW_GET_USER_MEDIA ).toBe( 'mediaDevices.slowGetUserMedia' );
  22. } );
  23. it( "unknown members", () => {
  24. const keys = Object.keys( others );
  25. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  26. } );
  27. } );