aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-10-10 14:24:34 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2023-10-19 22:04:20 +0200
commit363d9ebb130862d5fc5617e94b1c369caf02553f (patch)
tree075425b702790fdd13c58fb396d72c1e6a22f544 /tests
parent08cff0777aac169dd9c758b73faa0060004fc7a0 (diff)
downloadnextcloud-server-363d9ebb130862d5fc5617e94b1c369caf02553f.tar.gz
nextcloud-server-363d9ebb130862d5fc5617e94b1c369caf02553f.zip
feat(NavigationManager): Always sort the default app first
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/NavigationManagerTest.php61
1 files changed, 56 insertions, 5 deletions
diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php
index 65289799d59..64ffd64394d 100644
--- a/tests/lib/NavigationManagerTest.php
+++ b/tests/lib/NavigationManagerTest.php
@@ -95,7 +95,7 @@ class NavigationManagerTest extends TestCase {
//'icon' => 'optional',
'href' => 'url',
'active' => true,
- 'unread' => 0
+ 'unread' => 0,
],
'entry id2' => [
'id' => 'entry id',
@@ -106,7 +106,8 @@ class NavigationManagerTest extends TestCase {
'active' => false,
'type' => 'link',
'classes' => '',
- 'unread' => 0
+ 'unread' => 0,
+ 'default' => true,
]
]
];
@@ -349,7 +350,10 @@ class NavigationManagerTest extends TestCase {
'active' => false,
'type' => 'link',
'classes' => '',
- 'unread' => 0
+ 'unread' => 0,
+ 'default' => true,
+ 'app' => 'test',
+ 'key' => 0,
]],
['logout' => $defaults['logout']]
),
@@ -372,7 +376,7 @@ class NavigationManagerTest extends TestCase {
'active' => false,
'type' => 'settings',
'classes' => '',
- 'unread' => 0
+ 'unread' => 0,
]],
['logout' => $defaults['logout']]
),
@@ -382,6 +386,47 @@ class NavigationManagerTest extends TestCase {
],
]]
],
+ 'with-multiple' => [
+ array_merge(
+ ['accessibility_settings' => $defaults['accessibility_settings']],
+ ['settings' => $defaults['settings']],
+ ['test' => [
+ 'id' => 'test',
+ 'order' => 100,
+ 'href' => '/apps/test/',
+ 'icon' => '/apps/test/img/app.svg',
+ 'name' => 'Test',
+ 'active' => false,
+ 'type' => 'link',
+ 'classes' => '',
+ 'unread' => 0,
+ 'default' => false,
+ 'app' => 'test',
+ 'key' => 0,
+ ],
+ 'test1' => [
+ 'id' => 'test1',
+ 'order' => 50,
+ 'href' => '/apps/test/',
+ 'icon' => '/apps/test/img/app.svg',
+ 'name' => 'Other test',
+ 'active' => false,
+ 'type' => 'link',
+ 'classes' => '',
+ 'unread' => 0,
+ 'default' => true, // because of order
+ 'app' => 'test',
+ 'key' => 1,
+ ]],
+ ['logout' => $defaults['logout']]
+ ),
+ ['navigations' => [
+ 'navigation' => [
+ ['route' => 'test.page.index', 'name' => 'Test'],
+ ['route' => 'test.page.index', 'name' => 'Other test', 'order' => 50],
+ ]
+ ]]
+ ],
'admin' => [
array_merge(
$adminSettings,
@@ -395,7 +440,10 @@ class NavigationManagerTest extends TestCase {
'active' => false,
'type' => 'link',
'classes' => '',
- 'unread' => 0
+ 'unread' => 0,
+ 'default' => true,
+ 'app' => 'test',
+ 'key' => 0,
]],
['logout' => $defaults['logout']]
),
@@ -448,6 +496,9 @@ class NavigationManagerTest extends TestCase {
'active' => false,
'classes' => '',
'unread' => 0,
+ 'default' => true,
+ 'app' => 'test',
+ 'key' => 0,
],
];
$navigation = ['navigations' => [