@@ -126,13 +126,15 @@ describe.each([[StoreType.Memory], [StoreType.IndexedDB]])("queueToDevice (%s st
126
126
eventType : "org.example.foo" ,
127
127
batch : [ FAKE_MSG ] ,
128
128
} ) ;
129
- expect ( await httpBackend . flush ( undefined , 1 , 1 ) ) . toEqual ( 1 ) ;
129
+ // flush the 500 response
130
+ expect ( await httpBackend . flush ( "/sendToDevice/org.example.foo/" , 1 , 20 ) ) . toEqual ( 1 ) ;
130
131
await flushPromises ( ) ;
131
132
132
133
client . retryImmediately ( ) ;
133
134
135
+ // flush the 200 response
134
136
// longer timeout here to try & avoid flakiness
135
- expect ( await httpBackend . flush ( undefined , 1 , 3000 ) ) . toEqual ( 1 ) ;
137
+ expect ( await httpBackend . flush ( "/sendToDevice/org.example.foo/" , 1 , 3000 ) ) . toEqual ( 1 ) ;
136
138
} ) ;
137
139
138
140
it ( "retries on when client is started" , async function ( ) {
@@ -150,13 +152,15 @@ describe.each([[StoreType.Memory], [StoreType.IndexedDB]])("queueToDevice (%s st
150
152
eventType : "org.example.foo" ,
151
153
batch : [ FAKE_MSG ] ,
152
154
} ) ;
153
- expect ( await httpBackend . flush ( undefined , 1 , 1 ) ) . toEqual ( 1 ) ;
155
+ // flush the 500 response
156
+ expect ( await httpBackend . flush ( "/sendToDevice/org.example.foo/" , 1 , 20 ) ) . toEqual ( 1 ) ;
154
157
await flushPromises ( ) ;
155
158
156
159
client . stopClient ( ) ;
157
160
await Promise . all ( [ client . startClient ( ) , httpBackend . flush ( "/_matrix/client/versions" , 1 , 20 ) ] ) ;
158
161
159
- expect ( await httpBackend . flush ( undefined , 1 , 20 ) ) . toEqual ( 1 ) ;
162
+ // flush the 200 response
163
+ expect ( await httpBackend . flush ( "/sendToDevice/org.example.foo/" , 1 , 20 ) ) . toEqual ( 1 ) ;
160
164
} ) ;
161
165
162
166
it ( "retries when a message is retried" , async function ( ) {
0 commit comments