From 0ef100209d39710a3b4798bb40d314eacffa941c Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Fri, 29 May 2026 13:39:49 -0600 Subject: [PATCH] test: Wait for `subscriptions.read` call before getting read receitps (#40741) --- .../omnichannel/omnichannel-livechat-read-receipts.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-read-receipts.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-read-receipts.spec.ts index a4cf2118b7eae..f8d8730597020 100644 --- a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-read-receipts.spec.ts +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-read-receipts.spec.ts @@ -63,9 +63,13 @@ test.describe('OC - Livechat - Read Receipts', () => { }); await test.step('agent reads the message', async () => { + const markedAsRead = agentPage.waitForResponse( + (res) => /api\/v1\/subscriptions\.read(?:\/|\?|$)/.test(res.url()) && res.request().method() === 'POST', + ); await poHomeOmnichannel.navbar.openChat(visitor.name); await expect(poHomeOmnichannel.content.lastUserMessage).toBeVisible(); await expect(poHomeOmnichannel.content.lastUserMessage).toContainText(testMessage); + await markedAsRead; }); await test.step('read receipts show both agent and visitor names', async () => {