Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

JitsiConnectionErrors.spec.ts 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. SHARD_CHANGED_ERROR,
  12. JitsiConnectionErrors,
  13. ...others
  14. } = exported;
  15. it( "known members", () => {
  16. expect( CONFERENCE_REQUEST_FAILED ).toBe( 'connection.conferenceRequestFailed' );
  17. expect( CONNECTION_DROPPED_ERROR ).toBe( 'connection.droppedError' );
  18. expect( NOT_LIVE_ERROR ).toBe( 'connection.notLiveError' );
  19. expect( OTHER_ERROR ).toBe( 'connection.otherError' );
  20. expect( PASSWORD_REQUIRED ).toBe( 'connection.passwordRequired' );
  21. expect( SERVER_ERROR ).toBe( 'connection.serverError' );
  22. expect( JitsiConnectionErrors ).toBeDefined();
  23. expect( JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED ).toBe( 'connection.conferenceRequestFailed' );
  24. expect( JitsiConnectionErrors.CONNECTION_DROPPED_ERROR ).toBe( 'connection.droppedError' );
  25. expect( JitsiConnectionErrors.NOT_LIVE_ERROR ).toBe( 'connection.notLiveError' );
  26. expect( JitsiConnectionErrors.OTHER_ERROR ).toBe( 'connection.otherError' );
  27. expect( JitsiConnectionErrors.PASSWORD_REQUIRED ).toBe( 'connection.passwordRequired' );
  28. expect( JitsiConnectionErrors.SERVER_ERROR ).toBe( 'connection.serverError' );
  29. expect( JitsiConnectionErrors.SHARD_CHANGED_ERROR ).toBe( 'connection.shardChangedError' );
  30. } );
  31. it( "unknown members", () => {
  32. const keys = Object.keys( others );
  33. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  34. } );
  35. } );