Skip to content

Commit 7a5a2bc

Browse files
committed
Set some missing fields in test
1 parent 9341bf0 commit 7a5a2bc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/ClientWidgetApi-test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ describe('ClientWidgetApi', () => {
246246
});
247247

248248
it('should reject requests when the driver throws an exception', async () => {
249+
const roomId = '!room:example.org';
250+
249251
driver.sendEvent.mockRejectedValue(
250252
new Error("M_BAD_JSON: Content must be a JSON object"),
251253
);
@@ -258,6 +260,7 @@ describe('ClientWidgetApi', () => {
258260
data: {
259261
type: 'm.room.message',
260262
content: 'hello',
263+
room_id: roomId,
261264
},
262265
};
263266

@@ -276,6 +279,8 @@ describe('ClientWidgetApi', () => {
276279
});
277280

278281
it('should reject with Matrix API error response thrown by driver', async () => {
282+
const roomId = '!room:example.org';
283+
279284
driver.processError.mockImplementation(processCustomMatrixError);
280285

281286
driver.sendEvent.mockRejectedValue(
@@ -297,6 +302,7 @@ describe('ClientWidgetApi', () => {
297302
data: {
298303
type: 'm.room.message',
299304
content: 'hello',
305+
room_id: roomId,
300306
},
301307
};
302308

@@ -329,6 +335,8 @@ describe('ClientWidgetApi', () => {
329335

330336
describe('send_event action for delayed events', () => {
331337
it('fails to send delayed events', async () => {
338+
const roomId = '!room:example.org';
339+
332340
const event: ISendEventFromWidgetActionRequest = {
333341
api: WidgetApiDirection.FromWidget,
334342
widgetId: 'test',
@@ -338,6 +346,7 @@ describe('ClientWidgetApi', () => {
338346
type: 'm.room.message',
339347
content: {},
340348
delay: 5000,
349+
room_id: roomId,
341350
},
342351
};
343352

@@ -458,6 +467,8 @@ describe('ClientWidgetApi', () => {
458467
});
459468

460469
it('should reject requests when the driver throws an exception', async () => {
470+
const roomId = '!room:example.org';
471+
461472
driver.sendDelayedEvent.mockRejectedValue(
462473
new Error("M_BAD_JSON: Content must be a JSON object"),
463474
);
@@ -470,6 +481,7 @@ describe('ClientWidgetApi', () => {
470481
data: {
471482
type: 'm.room.message',
472483
content: 'hello',
484+
room_id: roomId,
473485
delay: 5000,
474486
parent_delay_id: 'fp',
475487
},
@@ -491,6 +503,8 @@ describe('ClientWidgetApi', () => {
491503
});
492504

493505
it('should reject with Matrix API error response thrown by driver', async () => {
506+
const roomId = '!room:example.org';
507+
494508
driver.processError.mockImplementation(processCustomMatrixError);
495509

496510
driver.sendDelayedEvent.mockRejectedValue(
@@ -512,6 +526,7 @@ describe('ClientWidgetApi', () => {
512526
data: {
513527
type: 'm.room.message',
514528
content: 'hello',
529+
room_id: roomId,
515530
delay: 5000,
516531
parent_delay_id: 'fp',
517532
},

0 commit comments

Comments
 (0)