0

fix(test): fix test to reflect chat message updates

This commit is contained in:
Gabe Kangas 2023-06-27 15:19:41 -07:00
parent f9d0d66271
commit 8a4039217f
No known key found for this signature in database
GPG Key ID: 4345B2060657F330

View File

@ -25,14 +25,13 @@ test('send a chat message', async (done) => {
test('fetch chat messages by admin', async (done) => {
const res = await getAdminResponse('chat/messages');
const expectedBody = `<p>` + testMessage.body + `</p>`;
const message = res.body.filter((m) => m.body === testMessage.body)[0];
const message = res.body.filter((m) => m.body === expectedBody)[0];
if (!message) {
throw new Error('Message not found');
}
const expectedBody = testMessage.body;
expect(message.body).toBe(expectedBody);
expect(message.user.displayName).toBe(userDisplayName);
expect(message.type).toBe(testMessage.type);