Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

JitsiConnectionEvents.spec.ts 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. CONNECTION_REDIRECTED,
  9. DISPLAY_NAME_REQUIRED,
  10. PROPERTIES_UPDATED,
  11. JitsiConnectionEvents,
  12. ...others
  13. } = exported;
  14. it( "known members", () => {
  15. expect( CONNECTION_DISCONNECTED ).toBe( 'connection.connectionDisconnected' );
  16. expect( CONNECTION_ESTABLISHED ).toBe( 'connection.connectionEstablished' );
  17. expect( CONNECTION_FAILED ).toBe( 'connection.connectionFailed' );
  18. expect( CONNECTION_REDIRECTED ).toBe( 'connection.redirected' );
  19. expect( DISPLAY_NAME_REQUIRED ).toBe( 'connection.display_name_required' );
  20. expect( PROPERTIES_UPDATED ).toBe( 'connection.propertiesUpdated' );
  21. expect( JitsiConnectionEvents ).toBeDefined();
  22. expect( JitsiConnectionEvents.CONNECTION_DISCONNECTED ).toBe( 'connection.connectionDisconnected' );
  23. expect( JitsiConnectionEvents.CONNECTION_ESTABLISHED ).toBe( 'connection.connectionEstablished' );
  24. expect( JitsiConnectionEvents.CONNECTION_FAILED ).toBe( 'connection.connectionFailed' );
  25. expect( JitsiConnectionEvents.CONNECTION_REDIRECTED ).toBe( 'connection.redirected' );
  26. expect( JitsiConnectionEvents.DISPLAY_NAME_REQUIRED ).toBe( 'connection.display_name_required' );
  27. expect( JitsiConnectionEvents.PROPERTIES_UPDATED ).toBe( 'connection.propertiesUpdated' );
  28. } );
  29. it( "unknown members", () => {
  30. const keys = Object.keys( others );
  31. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  32. } );
  33. } );