diff --git a/apps/meteor/tests/e2e/retention-policy.spec.ts b/apps/meteor/tests/e2e/retention-policy.spec.ts index 9d6dab66448d..066f1166abe4 100644 --- a/apps/meteor/tests/e2e/retention-policy.spec.ts +++ b/apps/meteor/tests/e2e/retention-policy.spec.ts @@ -104,17 +104,10 @@ test.describe.serial('retention-policy', () => { await auxContext.page.close(); }); test('should not show prune section in edit channel for users without permission', async () => { - await auxContext.poHomeChannel.sidenav.openChat(targetChannel); - await auxContext.poHomeChannel.tabs.btnRoomInfo.click(); - await auxContext.poHomeChannel.tabs.room.btnEdit.click(); - await expect(poHomeChannel.tabs.room.pruneAccordion).not.toBeVisible(); }); test('users without permission should be able to edit the channel', async () => { - await auxContext.poHomeChannel.sidenav.openChat(targetChannel); - await auxContext.poHomeChannel.tabs.btnRoomInfo.click(); - await auxContext.poHomeChannel.tabs.room.btnEdit.click(); await auxContext.poHomeChannel.tabs.room.advancedSettingsAccordion.click(); await auxContext.poHomeChannel.tabs.room.checkboxReadOnly.check(); await auxContext.poHomeChannel.tabs.room.btnSave.click(); @@ -174,21 +167,20 @@ test.describe.serial('retention-policy', () => { expect((await setSettingValueById(api, 'RetentionPolicy_TTL_Channels', timeUnitToMs(TIMEUNIT.days, 15))).status()).toBe(200); }); - test('should display the default max age in edit channel', async () => { + test.beforeEach(async () => { await poHomeChannel.sidenav.openChat(targetChannel); await poHomeChannel.tabs.btnRoomInfo.click(); await poHomeChannel.tabs.room.btnEdit.click(); await poHomeChannel.tabs.room.pruneAccordion.click(); + }); + + test('should display the default max age in edit channel', async () => { await poHomeChannel.tabs.room.checkboxOverrideGlobalRetention.click(); await expect(poHomeChannel.tabs.room.getMaxAgeLabel('15')).toBeVisible(); }); test('should display overridden retention max age value', async () => { - await poHomeChannel.sidenav.openChat(targetChannel); - await poHomeChannel.tabs.btnRoomInfo.click(); - await poHomeChannel.tabs.room.btnEdit.click(); - await poHomeChannel.tabs.room.pruneAccordion.click(); await poHomeChannel.tabs.room.checkboxOverrideGlobalRetention.click(); await poHomeChannel.tabs.room.inputRetentionMaxAge.fill('365'); await poHomeChannel.tabs.room.btnSave.click(); @@ -203,19 +195,10 @@ test.describe.serial('retention-policy', () => { }); test('should ignore threads be checked accordingly with the global default value', async () => { - await poHomeChannel.sidenav.openChat(targetChannel); - await poHomeChannel.tabs.btnRoomInfo.click(); - await poHomeChannel.tabs.room.btnEdit.click(); - await poHomeChannel.tabs.room.pruneAccordion.click(); - await expect(poHomeChannel.tabs.room.checkboxIgnoreThreads).toBeChecked({ checked: ignoreThreadsSetting }); }); test('should override ignore threads default value', async () => { - await poHomeChannel.sidenav.openChat(targetChannel); - await poHomeChannel.tabs.btnRoomInfo.click(); - await poHomeChannel.tabs.room.btnEdit.click(); - await poHomeChannel.tabs.room.pruneAccordion.click(); await poHomeChannel.tabs.room.checkboxIgnoreThreads.click(); await poHomeChannel.tabs.room.btnSave.click(); await poHomeChannel.dismissToast();