Files
ThreadNet-Web/apps/web/playwright/e2e/retention/retention-global.spec.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

54 lines
1.6 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 { rejectToastIfExists } from "@element-hq/element-web-playwright-common";
import { isDendrite } from "../../plugins/homeserver/dendrite";
import { checkRetentionInRoom } from "./utils";
import { test } from "../../element-web-test";
const ONE_MINUTE_STR = "60s";
test.use({
synapseConfig: {
retention: {
enabled: true,
default_policy: {
max_lifetime: ONE_MINUTE_STR,
},
allowed_lifetime_min: ONE_MINUTE_STR,
allowed_lifetime_max: ONE_MINUTE_STR,
},
experimental_features: {
msc1763_enabled: true,
},
},
});
test.describe("global retention rules", () => {
test.skip(isDendrite, "dendrite does not support retention");
test.use({
displayName: "Tom",
botCreateOpts: {
displayName: "Bob",
},
labsFlags: ["feature_retention"],
});
test.beforeEach(async ({ app, homeserver, page, user }) => {
await rejectToastIfExists(page, "Verify this device");
await rejectToastIfExists(page, "Notifications");
await page.clock.install();
});
test("should apply", async ({ app, bot, page }) => {
const roomId = await app.client.createRoom({
name: "Test",
invite: [bot.credentials.userId],
});
await checkRetentionInRoom({ app, bot, page }, roomId);
});
});