Files
ThreadNet-Web/apps/web/playwright/e2e/retention/utils.ts
T
Will HuntandGitHub 0889cca885 Update Retention Playwright tests to use real Synapse config endpoint (#33906)
* Use real interface type for SynapseConfig

* Reconfigure for Synapse retention config

* Add beforeEach

* fix import

* lint lint

* fix number type

* fix

* cleanup

* formatted
2026-06-19 17:03:09 +00:00

30 lines
1.0 KiB
TypeScript

/*
* Copyright 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
import { expect, type TestFixtures } from "../../element-web-test";
import type { Page } from "@playwright/test";
export const ONE_MINUTE = 60 * 1000;
export async function checkRetentionInRoom(
{ bot, app, page }: Pick<TestFixtures, "app" | "bot"> & { page: Page },
roomId: string,
) {
await bot.joinRoom(roomId);
await app.viewRoomById(roomId);
const tiles = (
await Promise.all(Array.from({ length: 5 }).map((_o, index) => bot.sendMessage(roomId, `Message ${index}`)))
).map(({ event_id: evtId }) => page.locator(`.mx_RoomView_MessageList .mx_EventTile[data-event-id='${evtId}']`));
for (const tile of tiles) {
await expect(tile).toBeVisible();
}
await page.clock.fastForward(ONE_MINUTE + 1);
for (const tile of tiles) {
await expect(tile).toBeHidden();
}
}