From 33bafb8e2bc4c732ad36999157a5acc198ce8e41 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 13 Mar 2019 21:13:55 +0100 Subject: [PATCH 1/2] Don't show 'Personal' header in settings when Admin section is not there Signed-off-by: Jan-Christoph Borchardt --- settings/templates/settings/frame.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/settings/templates/settings/frame.php b/settings/templates/settings/frame.php index 1734a92b06..e32c4ed2fc 100644 --- a/settings/templates/settings/frame.php +++ b/settings/templates/settings/frame.php @@ -30,8 +30,10 @@ script('files', 'jquery.fileupload');
    -
  • t('Personal')); ?>
  • + +
  • t('Personal')); ?>
  • getURLGenerator()->linkToRoute('settings.PersonalSettings.index', ['section' => $form['anchor']]); From 970d52fc298c53d9386dcca83f2eb5fca21167af Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 18 Mar 2019 14:16:40 +0100 Subject: [PATCH 2/2] Adjust acceptance tests Signed-off-by: Morris Jobke --- .../acceptance/features/access-levels.feature | 3 ++- .../features/bootstrap/SettingsMenuContext.php | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/features/access-levels.feature b/tests/acceptance/features/access-levels.feature index fb6b180be7..9d5695897c 100644 --- a/tests/acceptance/features/access-levels.feature +++ b/tests/acceptance/features/access-levels.feature @@ -12,7 +12,8 @@ Feature: access-levels Scenario: regular users cannot see admin-level items on the Settings page Given I am logged in When I visit the settings page - Then I see that the "Personal" settings panel is shown + Then I see that the "Personal info" entry in the settings panel is shown + And I see that the "Personal" settings panel is not shown And I see that the "Administration" settings panel is not shown Scenario: admin users can see admin-level items on the Settings page diff --git a/tests/acceptance/features/bootstrap/SettingsMenuContext.php b/tests/acceptance/features/bootstrap/SettingsMenuContext.php index 3dd5022ecc..e4e20997fc 100644 --- a/tests/acceptance/features/bootstrap/SettingsMenuContext.php +++ b/tests/acceptance/features/bootstrap/SettingsMenuContext.php @@ -93,6 +93,15 @@ class SettingsMenuContext implements Context, ActorAwareInterface { describedAs($itemText . " item in Settings panel"); } + /** + * @param string $itemText + * @return Locator + */ + private static function settingsPanelEntryFor($itemText) { + return Locator::forThe()->xpath("//div[@id = 'app-navigation']//ul//li[normalize-space() = '$itemText']")-> + describedAs($itemText . " entry in Settings panel"); + } + /** * @return array */ @@ -188,6 +197,15 @@ class SettingsMenuContext implements Context, ActorAwareInterface { ); } + /** + * @Then I see that the :itemText entry in the settings panel is shown + */ + public function iSeeThatTheItemEntryInTheSettingsPanelIsShown($itemText) { + PHPUnit_Framework_Assert::assertTrue( + $this->actor->find(self::settingsPanelEntryFor($itemText), 10)->isVisible() + ); + } + /** * @Then I see that the :itemText settings panel is not shown */