File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import { waitFor } from "@testing-library/dom";
1919
2020import { ClientWidgetApi } from "../src/ClientWidgetApi" ;
2121import { WidgetDriver } from "../src/driver/WidgetDriver" ;
22- import { UnstableApiVersion } from "../src/interfaces/ApiVersion" ;
22+ import { CurrentApiVersions , UnstableApiVersion } from "../src/interfaces/ApiVersion" ;
2323import { Capability } from "../src/interfaces/Capabilities" ;
2424import { IRoomEvent } from "../src/interfaces/IRoomEvent" ;
2525import { IWidgetApiRequest } from "../src/interfaces/IWidgetApiRequest" ;
@@ -759,6 +759,14 @@ describe("ClientWidgetApi", () => {
759759 const roomId = "!room:example.org" ;
760760 const otherRoomId = "!other-room:example.org" ;
761761 clientWidgetApi . setViewedRoomId ( roomId ) ;
762+
763+ jest . spyOn ( transport , "send" ) . mockImplementation ( ( action , data ) => {
764+ if ( action === WidgetApiToWidgetAction . SupportedApiVersions ) {
765+ return Promise . resolve ( { supported_versions : CurrentApiVersions } ) ;
766+ }
767+ return Promise . resolve ( { } ) ;
768+ } ) ;
769+
762770 const topicEvent = createRoomEvent ( {
763771 room_id : roomId ,
764772 type : "m.room.topic" ,
You can’t perform that action at this time.
0 commit comments