diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-09-14 11:24:11 +0200 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2022-09-14 15:05:35 +0200 |
commit | da01494a372c5b780ee76807325001afd1190b11 (patch) | |
tree | 41192ee5a919603534df3fea65750ffc0ff17a99 /tests | |
parent | 7ea015f0d199e8637392921ea5938394f9b78e73 (diff) | |
download | nextcloud-server-da01494a372c5b780ee76807325001afd1190b11.tar.gz nextcloud-server-da01494a372c5b780ee76807325001afd1190b11.zip |
Add accessibility entry in user menu
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/acceptance/features/header.feature | 6 | ||||
-rw-r--r-- | tests/lib/NavigationManagerTest.php | 36 |
2 files changed, 35 insertions, 7 deletions
diff --git a/tests/acceptance/features/header.feature b/tests/acceptance/features/header.feature index 21f9147c9ac..ac5da75425c 100644 --- a/tests/acceptance/features/header.feature +++ b/tests/acceptance/features/header.feature @@ -5,8 +5,9 @@ Feature: header Given I am logged in as the admin When I open the Settings menu Then I see that the Settings menu is shown - And I see that the Settings menu has only 8 items + And I see that the Settings menu has only 9 items And I see that the "Set status" item in the Settings menu is shown + And I see that the "Appearance and accessibility" item in the Settings menu is shown And I see that the "Personal settings" item in the Settings menu is shown And I see that the "Administration settings" item in the Settings menu is shown And I see that the "Apps" item in the Settings menu is shown @@ -18,8 +19,9 @@ Feature: header Given I am logged in When I open the Settings menu Then I see that the Settings menu is shown - And I see that the Settings menu has only 5 items + And I see that the Settings menu has only 6 items And I see that the "Set status" item in the Settings menu is shown + And I see that the "Appearance and accessibility" item in the Settings menu is shown And I see that the "Settings" item in the Settings menu is shown And I see that the "Help" item in the Settings menu is shown And I see that the "Log out" item in the Settings menu is shown diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php index 8d70b1b25ae..d5c827fe1cb 100644 --- a/tests/lib/NavigationManagerTest.php +++ b/tests/lib/NavigationManagerTest.php @@ -215,7 +215,19 @@ class NavigationManagerTest extends TestCase { return vsprintf($text, $parameters); }); + $this->appManager->expects($this->any()) + ->method('isEnabledForUser') + ->with('theming') + ->willReturn(true); $this->appManager->expects($this->once())->method('getAppInfo')->with('test')->willReturn($navigation); + /* + $this->appManager->expects($this->any()) + ->method('getAppInfo') + ->will($this->returnValueMap([ + ['test', null, null, $navigation], + ['theming', null, null, null], + ])); + */ $this->l10nFac->expects($this->any())->method('get')->willReturn($l); $this->urlGenerator->expects($this->any())->method('imagePath')->willReturnCallback(function ($appName, $file) { return "/apps/$appName/img/$file"; @@ -230,7 +242,7 @@ class NavigationManagerTest extends TestCase { $user->expects($this->any())->method('getUID')->willReturn('user001'); $this->userSession->expects($this->any())->method('getUser')->willReturn($user); $this->userSession->expects($this->any())->method('isLoggedIn')->willReturn(true); - $this->appManager->expects($this->once()) + $this->appManager->expects($this->any()) ->method('getEnabledAppsForUser') ->with($user) ->willReturn(['test']); @@ -248,7 +260,7 @@ class NavigationManagerTest extends TestCase { $apps = [ 'core_apps' => [ 'id' => 'core_apps', - 'order' => 4, + 'order' => 5, 'href' => '/apps/test/', 'icon' => '/apps/settings/img/apps.svg', 'name' => 'Apps', @@ -259,9 +271,20 @@ class NavigationManagerTest extends TestCase { ] ]; $defaults = [ + 'accessibility_settings' => [ + 'type' => 'settings', + 'id' => 'accessibility_settings', + 'order' => 2, + 'href' => '/apps/test/', + 'name' => 'Appearance and accessibility', + 'icon' => '/apps/theming/img/accessibility-dark.svg', + 'active' => false, + 'classes' => '', + 'unread' => 0, + ], 'settings' => [ 'id' => 'settings', - 'order' => 2, + 'order' => 3, 'href' => '/apps/test/', 'icon' => '/apps/settings/img/admin.svg', 'name' => 'Settings', @@ -283,9 +306,10 @@ class NavigationManagerTest extends TestCase { ] ]; $adminSettings = [ + 'accessibility_settings' => $defaults['accessibility_settings'], 'settings' => [ 'id' => 'settings', - 'order' => 2, + 'order' => 3, 'href' => '/apps/test/', 'icon' => '/apps/settings/img/personal.svg', 'name' => 'Personal settings', @@ -296,7 +320,7 @@ class NavigationManagerTest extends TestCase { ], 'admin_settings' => [ 'id' => 'admin_settings', - 'order' => 3, + 'order' => 4, 'href' => '/apps/test/', 'icon' => '/apps/settings/img/admin.svg', 'name' => 'Administration settings', @@ -310,6 +334,7 @@ class NavigationManagerTest extends TestCase { return [ 'minimalistic' => [ array_merge( + ['accessibility_settings' => $defaults['accessibility_settings']], ['settings' => $defaults['settings']], ['test' => [ 'id' => 'test', @@ -332,6 +357,7 @@ class NavigationManagerTest extends TestCase { ], 'minimalistic-settings' => [ array_merge( + ['accessibility_settings' => $defaults['accessibility_settings']], ['settings' => $defaults['settings']], ['test' => [ 'id' => 'test', |