Skip to content

Commit

Permalink
test: edit-room-retention-policy permissionduplicated actions (#33791)
Browse files Browse the repository at this point in the history
Co-authored-by: Tiago Evangelista Pinto <[email protected]>
  • Loading branch information
MartinSchoeler and tiagoevanp authored Nov 7, 2024
1 parent 746d4fe commit d90d7e9
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions apps/meteor/tests/e2e/retention-policy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit d90d7e9

Please sign in to comment.