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.

JitsiConferenceErrors.spec.ts 4.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import * as exported from "./JitsiConferenceErrors";
  2. // this test is brittle on purpose because it's designed to ensure that the TypeScript conversion maintains backward compatibility
  3. describe( "/JitsiConferenceErrors members", () => {
  4. const {
  5. AUTHENTICATION_REQUIRED,
  6. CHAT_ERROR,
  7. SETTINGS_ERROR,
  8. CONFERENCE_DESTROYED,
  9. CONFERENCE_MAX_USERS,
  10. CONNECTION_ERROR,
  11. CONFERENCE_RESTARTED,
  12. NOT_ALLOWED_ERROR,
  13. MEMBERS_ONLY_ERROR,
  14. CONFERENCE_ACCESS_DENIED,
  15. FOCUS_DISCONNECTED,
  16. FOCUS_LEFT,
  17. GRACEFUL_SHUTDOWN,
  18. ICE_FAILED,
  19. INCOMPATIBLE_SERVER_VERSIONS,
  20. OFFER_ANSWER_FAILED,
  21. PASSWORD_NOT_SUPPORTED,
  22. PASSWORD_REQUIRED,
  23. RESERVATION_ERROR,
  24. VIDEOBRIDGE_NOT_AVAILABLE,
  25. JitsiConferenceErrors,
  26. ...others
  27. } = exported as any; // TODO: remove cast after typescript conversion
  28. it( "known members", () => {
  29. expect( AUTHENTICATION_REQUIRED ).toBe( 'conference.authenticationRequired' );
  30. expect( CHAT_ERROR ).toBe( 'conference.chatError' );
  31. expect( SETTINGS_ERROR ).toBe( 'conference.settingsError' );
  32. expect( CONFERENCE_DESTROYED ).toBe( 'conference.destroyed' );
  33. expect( CONFERENCE_MAX_USERS ).toBe( 'conference.max_users' );
  34. expect( CONNECTION_ERROR ).toBe( 'conference.connectionError' );
  35. expect( CONFERENCE_RESTARTED ).toBe( 'conference.restarted' );
  36. expect( NOT_ALLOWED_ERROR ).toBe( 'conference.connectionError.notAllowed' );
  37. expect( MEMBERS_ONLY_ERROR ).toBe( 'conference.connectionError.membersOnly' );
  38. expect( CONFERENCE_ACCESS_DENIED ).toBe( 'conference.connectionError.accessDenied' );
  39. expect( FOCUS_DISCONNECTED ).toBe( 'conference.focusDisconnected' );
  40. expect( FOCUS_LEFT ).toBe( 'conference.focusLeft' );
  41. expect( GRACEFUL_SHUTDOWN ).toBe( 'conference.gracefulShutdown' );
  42. expect( ICE_FAILED ).toBe( 'conference.iceFailed' );
  43. expect( INCOMPATIBLE_SERVER_VERSIONS ).toBe( 'conference.incompatible_server_versions' );
  44. expect( OFFER_ANSWER_FAILED ).toBe( 'conference.offerAnswerFailed' );
  45. expect( PASSWORD_NOT_SUPPORTED ).toBe( 'conference.passwordNotSupported' );
  46. expect( PASSWORD_REQUIRED ).toBe( 'conference.passwordRequired' );
  47. expect( RESERVATION_ERROR ).toBe( 'conference.reservationError' );
  48. expect( VIDEOBRIDGE_NOT_AVAILABLE ).toBe( 'conference.videobridgeNotAvailable' );
  49. if ( JitsiConferenceErrors ) {
  50. expect( JitsiConferenceErrors.AUTHENTICATION_REQUIRED ).toBe( 'conference.authenticationRequired' );
  51. expect( JitsiConferenceErrors.CHAT_ERROR ).toBe( 'conference.chatError' );
  52. expect( JitsiConferenceErrors.SETTINGS_ERROR ).toBe( 'conference.settingsError' );
  53. expect( JitsiConferenceErrors.CONFERENCE_DESTROYED ).toBe( 'conference.destroyed' );
  54. expect( JitsiConferenceErrors.CONFERENCE_MAX_USERS ).toBe( 'conference.max_users' );
  55. expect( JitsiConferenceErrors.CONNECTION_ERROR ).toBe( 'conference.connectionError' );
  56. expect( JitsiConferenceErrors.CONFERENCE_RESTARTED ).toBe( 'conference.restarted' );
  57. expect( JitsiConferenceErrors.NOT_ALLOWED_ERROR ).toBe( 'conference.connectionError.notAllowed' );
  58. expect( JitsiConferenceErrors.MEMBERS_ONLY_ERROR ).toBe( 'conference.connectionError.membersOnly' );
  59. expect( JitsiConferenceErrors.CONFERENCE_ACCESS_DENIED ).toBe( 'conference.connectionError.accessDenied' );
  60. expect( JitsiConferenceErrors.FOCUS_DISCONNECTED ).toBe( 'conference.focusDisconnected' );
  61. expect( JitsiConferenceErrors.FOCUS_LEFT ).toBe( 'conference.focusLeft' );
  62. expect( JitsiConferenceErrors.GRACEFUL_SHUTDOWN ).toBe( 'conference.gracefulShutdown' );
  63. expect( JitsiConferenceErrors.ICE_FAILED ).toBe( 'conference.iceFailed' );
  64. expect( JitsiConferenceErrors.INCOMPATIBLE_SERVER_VERSIONS ).toBe( 'conference.incompatible_server_versions' );
  65. expect( JitsiConferenceErrors.OFFER_ANSWER_FAILED ).toBe( 'conference.offerAnswerFailed' );
  66. expect( JitsiConferenceErrors.PASSWORD_NOT_SUPPORTED ).toBe( 'conference.passwordNotSupported' );
  67. expect( JitsiConferenceErrors.PASSWORD_REQUIRED ).toBe( 'conference.passwordRequired' );
  68. expect( JitsiConferenceErrors.RESERVATION_ERROR ).toBe( 'conference.reservationError' );
  69. expect( JitsiConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE ).toBe( 'conference.videobridgeNotAvailable' );
  70. }
  71. } );
  72. it( "unknown members", () => {
  73. const keys = Object.keys( others );
  74. expect( keys ).withContext( `Extra members: ${ keys.join( ", " ) }` ).toEqual( [] );
  75. } );
  76. } );