@@ -43,6 +43,8 @@ import {
43
43
import { getMockClientWithEventEmitter , makeBeaconInfoEvent , makePollStartEvent , stubClient } from "../test-utils" ;
44
44
import dis from "../../src/dispatcher/dispatcher" ;
45
45
import { Action } from "../../src/dispatcher/actions" ;
46
+ import { mkVoiceBroadcastInfoStateEvent } from "../voice-broadcast/utils/test-utils" ;
47
+ import { VoiceBroadcastInfoState } from "../../src/voice-broadcast/types" ;
46
48
47
49
jest . mock ( "../../src/dispatcher/dispatcher" ) ;
48
50
@@ -151,6 +153,20 @@ describe("EventUtils", () => {
151
153
} ,
152
154
} ) ;
153
155
156
+ const voiceBroadcastStart = mkVoiceBroadcastInfoStateEvent (
157
+ "!room:example.com" ,
158
+ VoiceBroadcastInfoState . Started ,
159
+ "@user:example.com" ,
160
+ "ABC123" ,
161
+ ) ;
162
+
163
+ const voiceBroadcastStop = mkVoiceBroadcastInfoStateEvent (
164
+ "!room:example.com" ,
165
+ VoiceBroadcastInfoState . Stopped ,
166
+ "@user:example.com" ,
167
+ "ABC123" ,
168
+ ) ;
169
+
154
170
describe ( "isContentActionable()" , ( ) => {
155
171
type TestCase = [ string , MatrixEvent ] ;
156
172
it . each < TestCase > ( [
@@ -161,6 +177,7 @@ describe("EventUtils", () => {
161
177
[ "room member event" , roomMemberEvent ] ,
162
178
[ "event without msgtype" , noMsgType ] ,
163
179
[ "event without content body property" , noContentBody ] ,
180
+ [ "broadcast stop event" , voiceBroadcastStop ] ,
164
181
] ) ( "returns false for %s" , ( _description , event ) => {
165
182
expect ( isContentActionable ( event ) ) . toBe ( false ) ;
166
183
} ) ;
@@ -171,6 +188,7 @@ describe("EventUtils", () => {
171
188
[ "event with empty content body" , emptyContentBody ] ,
172
189
[ "event with a content body" , niceTextMessage ] ,
173
190
[ "beacon_info event" , beaconInfoEvent ] ,
191
+ [ "broadcast start event" , voiceBroadcastStart ] ,
174
192
] ) ( "returns true for %s" , ( _description , event ) => {
175
193
expect ( isContentActionable ( event ) ) . toBe ( true ) ;
176
194
} ) ;
0 commit comments