diff --git a/client/coral-admin/src/components/Drawer.js b/client/coral-admin/src/components/Drawer.js index 0385b1773..70da8ad5e 100644 --- a/client/coral-admin/src/components/Drawer.js +++ b/client/coral-admin/src/components/Drawer.js @@ -5,14 +5,15 @@ import {IndexLink, Link} from 'react-router'; import styles from './Drawer.css'; import t from 'coral-framework/services/i18n'; import {can} from 'coral-framework/services/perms'; +import cn from 'classnames'; const CoralDrawer = ({handleLogout, auth = {}}) => ( - + { auth && auth.user && can(auth.user, 'ACCESS_ADMIN') ?
{t('configure.dashboard')} @@ -20,19 +21,21 @@ const CoralDrawer = ({handleLogout, auth = {}}) => ( { can(auth.user, 'MODERATE_COMMENTS') && ( {t('configure.moderate')} ) } - {t('configure.stories')} - {t('configure.community')} @@ -41,7 +44,7 @@ const CoralDrawer = ({handleLogout, auth = {}}) => ( can(auth.user, 'UPDATE_CONFIG') && ( {t('configure.configure')} diff --git a/test/e2e/page_objects/admin.js b/test/e2e/page_objects/admin.js index ffdcf8a29..92f2ac0e1 100644 --- a/test/e2e/page_objects/admin.js +++ b/test/e2e/page_objects/admin.js @@ -15,9 +15,13 @@ module.exports = { 'passwordInput': '.talk-admin-login-sign-in #password', 'signInButton': '.talk-admin-login-sign-in-button', 'storiesNav': '.talk-admin-nav-stories', + 'storiesDrawerNav': '.talk-admin-drawer-nav .talk-admin-nav-stories', 'storiesSection': '.talk-admin-stories', 'communityNav': '.talk-admin-nav-community', + 'communityDrawerNav': '.talk-admin-drawer-nav .talk-admin-nav-community', 'communitySection': '.talk-admin-community', - 'moderationContainer': '.talk-admin-moderation-container' + 'moderationContainer': '.talk-admin-moderation-container', + 'drawerButton': '.mdl-layout__drawer-button', + 'drawerOverlay': 'div.mdl-layout__obfuscator.is-visible', } }; diff --git a/test/e2e/specs/02_admin.js b/test/e2e/specs/02_admin.js index 03f460c1b..4a60780bb 100644 --- a/test/e2e/specs/02_admin.js +++ b/test/e2e/specs/02_admin.js @@ -1,10 +1,9 @@ module.exports = { '@tags': ['admin', 'login'], - beforeEach: (client) => { - - // Testing Desktop - client.resizeWindow(1280, 800); - }, + beforeEach: (client) => { + + client.resizeWindow(1024, 800); + }, 'Admin logs in': (client) => { const adminPage = client.page.admin(); const {testData: {admin}} = client.globals; @@ -29,9 +28,14 @@ module.exports = { adminPage .navigate() - .waitForElementVisible('@storiesNav') - .click('@storiesNav') + .waitForElementVisible('@drawerButton') + .click('@drawerButton') + .waitForElementVisible('@storiesDrawerNav') + .click('@storiesDrawerNav') + .waitForElementVisible('@drawerOverlay') + .click('@drawerOverlay') .waitForElementVisible('@storiesSection'); + }, 'Admin goes to Community': (client) => { @@ -39,9 +43,13 @@ module.exports = { adminPage .navigate() - .waitForElementVisible('@communityNav') - .click('@communityNav') - .waitForElementVisible('@communitySection'); + .waitForElementVisible('@drawerButton') + .click('@drawerButton') + .waitForElementVisible('@communityDrawerNav') + .click('@communityDrawerNav') + .waitForElementVisible('@drawerOverlay') + .click('@drawerOverlay') + .waitForElementVisible('@communitySection'); }, after: (client) => { client.end();