@@ -38,7 +38,7 @@ function createFailedDecryptionEvent() {
3838}
3939
4040describe ( "DecryptionFailureTracker" , function ( ) {
41- it ( "tracks a failed decryption for a visible event" , function ( done ) {
41+ it ( "tracks a failed decryption for a visible event" , function ( ) {
4242 const failedDecryptionEvent = createFailedDecryptionEvent ( ) ;
4343
4444 let count = 0 ;
@@ -59,11 +59,9 @@ describe("DecryptionFailureTracker", function () {
5959 tracker . trackFailures ( ) ;
6060
6161 expect ( count ) . not . toBe ( 0 , "should track a failure for an event that failed decryption" ) ;
62-
63- done ( ) ;
6462 } ) ;
6563
66- it ( "tracks a failed decryption with expected raw error for a visible event" , function ( done ) {
64+ it ( "tracks a failed decryption with expected raw error for a visible event" , function ( ) {
6765 const failedDecryptionEvent = createFailedDecryptionEvent ( ) ;
6866
6967 let count = 0 ;
@@ -89,11 +87,9 @@ describe("DecryptionFailureTracker", function () {
8987
9088 expect ( count ) . not . toBe ( 0 , "should track a failure for an event that failed decryption" ) ;
9189 expect ( reportedRawCode ) . toBe ( "INBOUND_SESSION_MISMATCH_ROOM_ID" , "Should add the rawCode to the event context" ) ;
92-
93- done ( ) ;
9490 } ) ;
9591
96- it ( "tracks a failed decryption for an event that becomes visible later" , function ( done ) {
92+ it ( "tracks a failed decryption for an event that becomes visible later" , function ( ) {
9793 const failedDecryptionEvent = createFailedDecryptionEvent ( ) ;
9894
9995 let count = 0 ;
@@ -114,11 +110,9 @@ describe("DecryptionFailureTracker", function () {
114110 tracker . trackFailures ( ) ;
115111
116112 expect ( count ) . not . toBe ( 0 , "should track a failure for an event that failed decryption" ) ;
117-
118- done ( ) ;
119113 } ) ;
120114
121- it ( "does not track a failed decryption for an event that never becomes visible" , function ( done ) {
115+ it ( "does not track a failed decryption for an event that never becomes visible" , function ( ) {
122116 const failedDecryptionEvent = createFailedDecryptionEvent ( ) ;
123117
124118 let count = 0 ;
@@ -137,11 +131,9 @@ describe("DecryptionFailureTracker", function () {
137131 tracker . trackFailures ( ) ;
138132
139133 expect ( count ) . toBe ( 0 , "should not track a failure for an event that never became visible" ) ;
140-
141- done ( ) ;
142134 } ) ;
143135
144- it ( "does not track a failed decryption where the event is subsequently successfully decrypted" , ( done ) => {
136+ it ( "does not track a failed decryption where the event is subsequently successfully decrypted" , ( ) => {
145137 const decryptedEvent = createFailedDecryptionEvent ( ) ;
146138 const tracker = new DecryptionFailureTracker (
147139 ( total ) => {
@@ -164,13 +156,12 @@ describe("DecryptionFailureTracker", function () {
164156
165157 // Immediately track the newest failures
166158 tracker . trackFailures ( ) ;
167- done ( ) ;
168159 } ) ;
169160
170161 it (
171162 "does not track a failed decryption where the event is subsequently successfully decrypted " +
172163 "and later becomes visible" ,
173- ( done ) => {
164+ ( ) => {
174165 const decryptedEvent = createFailedDecryptionEvent ( ) ;
175166 const tracker = new DecryptionFailureTracker (
176167 ( total ) => {
@@ -193,11 +184,10 @@ describe("DecryptionFailureTracker", function () {
193184
194185 // Immediately track the newest failures
195186 tracker . trackFailures ( ) ;
196- done ( ) ;
197187 } ,
198188 ) ;
199189
200- it ( "only tracks a single failure per event, despite multiple failed decryptions for multiple events" , ( done ) => {
190+ it ( "only tracks a single failure per event, despite multiple failed decryptions for multiple events" , ( ) => {
201191 const decryptedEvent = createFailedDecryptionEvent ( ) ;
202192 const decryptedEvent2 = createFailedDecryptionEvent ( ) ;
203193
@@ -231,11 +221,9 @@ describe("DecryptionFailureTracker", function () {
231221 tracker . trackFailures ( ) ;
232222
233223 expect ( count ) . toBe ( 2 , count + " failures tracked, should only track a single failure per event" ) ;
234-
235- done ( ) ;
236224 } ) ;
237225
238- it ( "should not track a failure for an event that was tracked previously" , ( done ) => {
226+ it ( "should not track a failure for an event that was tracked previously" , ( ) => {
239227 const decryptedEvent = createFailedDecryptionEvent ( ) ;
240228
241229 let count = 0 ;
@@ -261,11 +249,9 @@ describe("DecryptionFailureTracker", function () {
261249 tracker . trackFailures ( ) ;
262250
263251 expect ( count ) . toBe ( 1 , "should only track a single failure per event" ) ;
264-
265- done ( ) ;
266252 } ) ;
267253
268- xit ( "should not track a failure for an event that was tracked in a previous session" , ( done ) => {
254+ it . skip ( "should not track a failure for an event that was tracked in a previous session" , ( ) => {
269255 // This test uses localStorage, clear it beforehand
270256 localStorage . clear ( ) ;
271257
@@ -304,8 +290,6 @@ describe("DecryptionFailureTracker", function () {
304290 secondTracker . trackFailures ( ) ;
305291
306292 expect ( count ) . toBe ( 1 , count + " failures tracked, should only track a single failure per event" ) ;
307-
308- done ( ) ;
309293 } ) ;
310294
311295 it ( "should count different error codes separately for multiple failures with different error codes" , ( ) => {
0 commit comments