Added moderation menu item check for non moderators to be hidden

This commit is contained in:
Grzegorz Leoniec 2019-01-18 10:25:49 +01:00
parent 12d713d528
commit 9a63da733f
No known key found for this signature in database
GPG Key ID: 3AA43686D4EB1377
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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)
})