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.

JitsiConnectionErrors.spec.ts 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import * as exported from "./JitsiConnectionErrors";
  2. // this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
  3. describe( "/JitsiConnectionErrors members", () => {
  4. const {
  5. CONFERENCE_REQUEST_FAILED,
  6. CONNECTION_DROPPED_ERROR,
  7. NOT_LIVE_ERROR,
  8. OTHER_ERROR,
  9. PASSWORD_REQUIRED,
  10. SERVER_ERROR,
  11. JitsiConnectionErrors,
  12. ...others
  13. } = exported;
  14. it( "known members", () => {
  15. expect( CONFERENCE_REQUEST_FAILED ).toBe( 'connection.conferenceRequestFailed' );
  16. expect( CONNECTION_DROPPED_ERROR ).toBe( 'connection.droppedError' );
  17. expect( NOT_LIVE_ERROR ).toBe( 'connection.notLiveError' );
  18. expect( OTHER_ERROR ).toBe( 'connection.otherError' );
  19. expect( PASSWORD_REQUIRED ).toBe( 'connection.passwordRequired' );
  20. expect( SERVER_ERROR ).toBe( 'connection.serverError' );
  21. expect( JitsiConnectionErrors ).toBeDefined();
  22. expect( JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED ).toBe( 'connection.conferenceRequestFailed' );
  23. expect( JitsiConnectionErrors.CONNECTION_DROPPED_ERROR ).toBe( 'connection.droppedError' );
  24. expect( JitsiConnectionErrors.NOT_LIVE_ERROR ).toBe( 'connection.notLiveError' );
  25. expect( JitsiConnectionErrors.OTHER_ERROR ).toBe( 'connection.otherError' );
  26. expect( JitsiConnectionErrors.PASSWORD_REQUIRED ).toBe( 'connection.passwordRequired' );
  27. expect( JitsiConnectionErrors.SERVER_ERROR ).toBe( 'connection.serverError' );
  28. } );
  29. it( "unknown members", () => {
  30. const keys = Object.keys( others );
  31. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  32. } );
  33. } );