From 9a63da733f1e736bb8b68504d3fafe380731a41d Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Fri, 18 Jan 2019 10:25:49 +0100 Subject: [PATCH] Added moderation menu item check for non moderators to be hidden --- cypress/integration/05.ReportContent.feature | 7 +++++-- cypress/integration/common/report.js | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cypress/integration/05.ReportContent.feature b/cypress/integration/05.ReportContent.feature index 09d5871a3..29509fdcd 100644 --- a/cypress/integration/05.ReportContent.feature +++ b/cypress/integration/05.ReportContent.feature @@ -39,5 +39,8 @@ Feature: Report and Moderate And I visit the "moderation" page Then I see my reported user - #Scenario: Normal user can't see the moderation page - #Given I am logged in as "user" + Scenario: Normal user can't see the moderation page + Given I am logged in as "user" + + When I can click on my profile picture in the top right corner + Then I can't see the moderation menu item diff --git a/cypress/integration/common/report.js b/cypress/integration/common/report.js index 67275e61b..72a45a903 100644 --- a/cypress/integration/common/report.js +++ b/cypress/integration/common/report.js @@ -97,3 +97,10 @@ Then('I see my reported user', () => { .contains(lastReportTitle.trim()) }) }) + +Then(`I can't see the moderation menu item`, () => { + cy.get('.avatar-menu').click() + cy.get('.avatar-menu-popover') + .find('a[href="/moderation"]') + .should('have.length', 0) +})