File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1457,6 +1457,35 @@ describe('MatrixClient', () => {
1457
1457
expect ( spy . callCount ) . toBe ( 1 ) ;
1458
1458
} ) ;
1459
1459
1460
+ it ( 'should process banned rooms as left rooms' , async ( ) => {
1461
+ const { client : realClient } = createTestClient ( ) ;
1462
+ const client = < ProcessSyncClient > ( < any > realClient ) ;
1463
+
1464
+ const userId = "@syncing:example.org" ;
1465
+ const roomId = "!testing:example.org" ;
1466
+ const events = [
1467
+ {
1468
+ type : "m.room.member" ,
1469
+ state_key : userId ,
1470
+ unsigned : { age : 0 } ,
1471
+ content : { membership : "ban" } ,
1472
+ } ,
1473
+ ] ;
1474
+
1475
+ client . userId = userId ;
1476
+
1477
+ const spy = simple . stub ( ) . callFn ( ( rid , ev ) => {
1478
+ expect ( ev ) . toMatchObject ( events [ 0 ] ) ;
1479
+ expect ( rid ) . toEqual ( roomId ) ;
1480
+ } ) ;
1481
+ realClient . on ( "room.leave" , spy ) ;
1482
+
1483
+ const roomsObj = { } ;
1484
+ roomsObj [ roomId ] = { timeline : { events : events } } ;
1485
+ await client . processSync ( { rooms : { leave : roomsObj } } ) ;
1486
+ expect ( spy . callCount ) . toBe ( 1 ) ;
1487
+ } ) ;
1488
+
1460
1489
it ( 'should process left rooms account data' , async ( ) => {
1461
1490
const { client : realClient } = createTestClient ( ) ;
1462
1491
const client = < ProcessSyncClient > ( < any > realClient ) ;
You can’t perform that action at this time.
0 commit comments