1616 */
1717
1818import { waitFor } from '@testing-library/dom' ;
19+
1920import { ClientWidgetApi } from "../src/ClientWidgetApi" ;
2021import { WidgetDriver } from "../src/driver/WidgetDriver" ;
2122import { UnstableApiVersion } from '../src/interfaces/ApiVersion' ;
@@ -43,11 +44,11 @@ import {
4344} from '../src' ;
4445import { IGetMediaConfigActionFromWidgetActionRequest } from '../src/interfaces/GetMediaConfigAction' ;
4546
46- jest . mock ( '../src/transport/PostmessageTransport' )
47+ jest . mock ( '../src/transport/PostmessageTransport' ) ;
4748
4849afterEach ( ( ) => {
4950 jest . resetAllMocks ( ) ;
50- } )
51+ } ) ;
5152
5253function createRoomEvent ( event : Partial < IRoomEvent > = { } ) : IRoomEvent {
5354 return {
@@ -63,7 +64,7 @@ function createRoomEvent(event: Partial<IRoomEvent> = {}): IRoomEvent {
6364}
6465
6566class CustomMatrixError extends Error {
66- constructor (
67+ public constructor (
6768 message : string ,
6869 public readonly httpStatus : number ,
6970 public readonly name : string ,
@@ -96,7 +97,7 @@ describe('ClientWidgetApi', () => {
9697 let transport : PostmessageTransport ;
9798 let emitEvent : Parameters < PostmessageTransport [ "on" ] > [ "1" ] ;
9899
99- async function loadIframe ( caps : Capability [ ] = [ ] ) {
100+ async function loadIframe ( caps : Capability [ ] = [ ] ) : Promise < void > {
100101 capabilities = caps ;
101102
102103 const ready = new Promise < void > ( resolve => {
@@ -517,7 +518,7 @@ describe('ClientWidgetApi', () => {
517518 } ) ;
518519 } ) ;
519520
520- expect ( driver . sendDelayedEvent ) . not . toBeCalled ( )
521+ expect ( driver . sendDelayedEvent ) . not . toBeCalled ( ) ;
521522 } ) ;
522523
523524 it ( 'sends delayed message events' , async ( ) => {
@@ -736,7 +737,7 @@ describe('ClientWidgetApi', () => {
736737 } ) ;
737738 } ) ;
738739
739- expect ( driver . updateDelayedEvent ) . not . toBeCalled ( )
740+ expect ( driver . updateDelayedEvent ) . not . toBeCalled ( ) ;
740741 } ) ;
741742
742743 it ( 'fails to update delayed events with unsupported action' , async ( ) => {
@@ -761,7 +762,7 @@ describe('ClientWidgetApi', () => {
761762 } ) ;
762763 } ) ;
763764
764- expect ( driver . updateDelayedEvent ) . not . toBeCalled ( )
765+ expect ( driver . updateDelayedEvent ) . not . toBeCalled ( ) ;
765766 } ) ;
766767
767768 it ( 'updates delayed events' , async ( ) => {
@@ -1123,7 +1124,7 @@ describe('ClientWidgetApi', () => {
11231124 driver . readStateEvents . mockResolvedValue ( [
11241125 createRoomEvent ( { type : 'net.example.test' , state_key : 'A' } ) ,
11251126 createRoomEvent ( { type : 'net.example.test' , state_key : 'B' } ) ,
1126- ] )
1127+ ] ) ;
11271128
11281129 const event : IReadEventFromWidgetActionRequest = {
11291130 api : WidgetApiDirection . FromWidget ,
@@ -1151,7 +1152,7 @@ describe('ClientWidgetApi', () => {
11511152
11521153 expect ( driver . readStateEvents ) . toBeCalledWith (
11531154 'net.example.test' , undefined , 0 , null ,
1154- )
1155+ ) ;
11551156 } ) ;
11561157
11571158 it ( 'fails to read state events with any state key' , async ( ) => {
@@ -1176,13 +1177,13 @@ describe('ClientWidgetApi', () => {
11761177 } ) ;
11771178 } ) ;
11781179
1179- expect ( driver . readStateEvents ) . not . toBeCalled ( )
1180+ expect ( driver . readStateEvents ) . not . toBeCalled ( ) ;
11801181 } ) ;
11811182
11821183 it ( 'reads state events with a specific state key' , async ( ) => {
11831184 driver . readStateEvents . mockResolvedValue ( [
11841185 createRoomEvent ( { type : 'net.example.test' , state_key : 'B' } ) ,
1185- ] )
1186+ ] ) ;
11861187
11871188 const event : IReadEventFromWidgetActionRequest = {
11881189 api : WidgetApiDirection . FromWidget ,
@@ -1209,7 +1210,7 @@ describe('ClientWidgetApi', () => {
12091210
12101211 expect ( driver . readStateEvents ) . toBeCalledWith (
12111212 'net.example.test' , 'B' , 0 , null ,
1212- )
1213+ ) ;
12131214 } ) ;
12141215
12151216 it ( 'fails to read state events with a specific state key' , async ( ) => {
@@ -1235,9 +1236,9 @@ describe('ClientWidgetApi', () => {
12351236 } ) ;
12361237 } ) ;
12371238
1238- expect ( driver . readStateEvents ) . not . toBeCalled ( )
1239+ expect ( driver . readStateEvents ) . not . toBeCalled ( ) ;
12391240 } ) ;
1240- } )
1241+ } ) ;
12411242
12421243 describe ( 'org.matrix.msc3869.read_relations action' , ( ) => {
12431244 it ( 'should present as supported api version' , ( ) => {
0 commit comments