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.

JitsiConnectionEvents.spec.ts 1.6KB

123456789101112131415161718192021222324252627282930313233343536
  1. import * as exported from "./JitsiConnectionEvents";
  2. // this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
  3. describe( "/JitsiConnectionEvents members", () => {
  4. const {
  5. CONNECTION_DISCONNECTED,
  6. CONNECTION_ESTABLISHED,
  7. CONNECTION_FAILED,
  8. WRONG_STATE,
  9. DISPLAY_NAME_REQUIRED,
  10. JitsiConnectionEvents,
  11. ...others
  12. } = exported;
  13. it( "known members", () => {
  14. expect( CONNECTION_DISCONNECTED ).toBe( 'connection.connectionDisconnected' );
  15. expect( CONNECTION_ESTABLISHED ).toBe( 'connection.connectionEstablished' );
  16. expect( CONNECTION_FAILED ).toBe( 'connection.connectionFailed' );
  17. expect( WRONG_STATE ).toBe( 'connection.wrongState' );
  18. expect( DISPLAY_NAME_REQUIRED ).toBe( 'connection.display_name_required' );
  19. expect( JitsiConnectionEvents ).toBeDefined();
  20. expect( JitsiConnectionEvents.CONNECTION_DISCONNECTED ).toBe( 'connection.connectionDisconnected' );
  21. expect( JitsiConnectionEvents.CONNECTION_ESTABLISHED ).toBe( 'connection.connectionEstablished' );
  22. expect( JitsiConnectionEvents.CONNECTION_FAILED ).toBe( 'connection.connectionFailed' );
  23. expect( JitsiConnectionEvents.WRONG_STATE ).toBe( 'connection.wrongState' );
  24. expect( JitsiConnectionEvents.DISPLAY_NAME_REQUIRED ).toBe( 'connection.display_name_required' );
  25. } );
  26. it( "unknown members", () => {
  27. const keys = Object.keys( others );
  28. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  29. } );
  30. } );