@@ -29,6 +29,7 @@ import {
29
29
import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts" ;
30
30
import { render , RenderResult } from "@testing-library/react" ;
31
31
import { FeatureSupport , THREAD_RELATION_TYPE , ThreadFilterType , Thread } from "matrix-js-sdk/src/models/thread" ;
32
+ import { logger } from "../../../../matrix-js-sdk/src/logger" ;
32
33
33
34
import MatrixClientContext from "../../../src/contexts/MatrixClientContext" ;
34
35
import { mkRoom , stubClient } from "../../test-utils" ;
@@ -219,6 +220,14 @@ describe('TimelinePanel', () => {
219
220
} ,
220
221
} ) ;
221
222
223
+ {
224
+ const ev = timeline . getEvents ( ) . find ( it => ! it ?. getType ( ) ) ;
225
+ if ( ev ) {
226
+ logger . error ( "This should never occur, got an event without type: " , ev ) ;
227
+ throw new Error ( "This should never occur, got an event without type: " + JSON . stringify ( ev . event ) ) ;
228
+ }
229
+ }
230
+
222
231
const thread = room . createThread ( 'event_root' , rootEvent , [ ] , true ) ;
223
232
// So that we do not have to mock the thread loading
224
233
thread . initialEventsFetched = true ;
@@ -231,6 +240,14 @@ describe('TimelinePanel', () => {
231
240
await thread . addEvent ( reply1 , true ) ;
232
241
await timeline . addEvent ( thread . rootEvent , true ) ;
233
242
243
+ {
244
+ const ev = timeline . getEvents ( ) . find ( it => ! it ?. getType ( ) ) ;
245
+ if ( ev ) {
246
+ logger . error ( "This should never occur, got an event without type: " , ev ) ;
247
+ throw new Error ( "This should never occur, got an event without type: " + JSON . stringify ( ev . event ) ) ;
248
+ }
249
+ }
250
+
234
251
const dom = render (
235
252
< MatrixClientContext . Provider value = { client } >
236
253
< TimelinePanel
0 commit comments