File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ 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' ;
23- import { Capability } from ' ../src/interfaces/Capabilities' ;
22+ import { CurrentApiVersions , UnstableApiVersion } from " ../src/interfaces/ApiVersion" ;
23+ import { Capability } from " ../src/interfaces/Capabilities" ;
2424import { IRoomEvent } from "../src/interfaces/IRoomEvent" ;
2525import { IWidgetApiRequest } from "../src/interfaces/IWidgetApiRequest" ;
2626import { IReadRelationsFromWidgetActionRequest } from "../src/interfaces/ReadRelationsAction" ;
@@ -759,6 +759,15 @@ describe("ClientWidgetApi", () => {
759759 const roomId = "!room:example.org" ;
760760 const otherRoomId = "!other-room:example.org" ;
761761 clientWidgetApi . setViewedRoomId ( roomId ) ;
762+ const originalSend = transport . send ;
763+
764+ jest . spyOn ( transport , "send" ) . mockImplementation ( ( action , data ) => {
765+ if ( action === WidgetApiToWidgetAction . SupportedApiVersions ) {
766+ return Promise . resolve ( { supported_versions : CurrentApiVersions } ) ;
767+ }
768+ return Promise . resolve ( { } ) ;
769+ } ) ;
770+
762771 const topicEvent = createRoomEvent ( {
763772 room_id : roomId ,
764773 type : "m.room.topic" ,
You can’t perform that action at this time.
0 commit comments