From b833a2f8aaf4ced12d18cbe7b48552fe77db7137 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Thu, 27 May 2021 17:44:35 -0300 Subject: [PATCH] [IMPROVEMENT] Allow discussions to be edited (#3137) * Refactored the filter to work the edit for channel and discussion * Removed the filter which type of room can be edit Co-authored-by: Diego Mello * Fix tests Co-authored-by: Diego Mello --- app/views/RoomInfoView/index.js | 2 +- e2e/tests/room/04-discussion.spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/RoomInfoView/index.js b/app/views/RoomInfoView/index.js index a49aab5b1..93a7e3a16 100644 --- a/app/views/RoomInfoView/index.js +++ b/app/views/RoomInfoView/index.js @@ -214,7 +214,7 @@ class RoomInfoView extends React.Component { } const permissions = await RocketChat.hasPermission([editRoomPermission], room.rid); - if (permissions[0] && !room.prid) { + if (permissions[0]) { this.setState({ showEdit: true }, () => this.setHeader()); } } diff --git a/e2e/tests/room/04-discussion.spec.js b/e2e/tests/room/04-discussion.spec.js index 0a0bc8e75..e5705b26b 100644 --- a/e2e/tests/room/04-discussion.spec.js +++ b/e2e/tests/room/04-discussion.spec.js @@ -131,8 +131,8 @@ describe('Discussion', () => { await expect(element(by.id('room-info-view'))).toExist(); }); - it('should not have edit button', async() => { - await expect(element(by.id('room-info-view-edit-button'))).toBeNotVisible(); + it('should have edit button', async() => { + await expect(element(by.id('room-info-view-edit-button'))).toBeVisible(); }); }); });