Skip to content

Commit 7cc03ae

Browse files
author
Tim Mendoza
committed
Update e2e test
1 parent 7d7f552 commit 7cc03ae

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

test/e2e/e2e.test.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,30 @@ describe('the RTC Twilio-CLI Plugin', () => {
150150

151151
const conversationServiceSid = jwt.decode(body.token).grants.chat.service_sid;
152152

153+
const room = await twilioClient.video.rooms(ROOM_NAME).fetch();
154+
155+
// Find the deployed conversations service
153156
const deployedConversationsServices = await twilioClient.conversations.services.list();
154157
const deployedConversationsService = deployedConversationsServices.find(
155158
service => (service.sid = conversationServiceSid)
156159
);
157160

161+
// Find the conversation
162+
const conversation = await twilioClient.conversations
163+
.services(deployedConversationsService.sid)
164+
.conversations(room.sid)
165+
.fetch();
166+
167+
// Find the participant that has been added to the conversation
158168
const conversationParticipants = await twilioClient.conversations
159-
.conversations(conversationServiceSid)
169+
.conversations(conversation.sid)
160170
.participants.list();
161-
162171
const conversationParticipant = conversationParticipants.find(
163172
participant => participant.identity === 'test user'
164173
);
165174

166175
expect(deployedConversationsService).toBeDefined();
176+
expect(conversation).toBeDefined();
167177
expect(conversationParticipant).toBeDefined();
168178
});
169179

0 commit comments

Comments
 (0)