From 927e7fcf67e4e1216e1551160919cd018f12b963 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 9 Nov 2023 16:41:21 +0100 Subject: fix(AppManager): Ensure that app manager can handle empty app keys on the navigation entries Signed-off-by: Ferdinand Thiessen --- tests/lib/App/AppManagerTest.php | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php index 410bfa287fc..3733d6cd2e9 100644 --- a/tests/lib/App/AppManagerTest.php +++ b/tests/lib/App/AppManagerTest.php @@ -660,6 +660,17 @@ class AppManagerTest extends TestCase { true, 'settings', ], + // system default app and user apporder + [ + // system default is settings + 'unexist,settings', + '', + // apporder says default app is files (order is lower) + '{"files_id":{"app":"files","order":1},"settings_id":{"app":"settings","order":2}}', + true, + // system default should override apporder + 'settings' + ], // user-customized defaultapp [ '', @@ -680,7 +691,7 @@ class AppManagerTest extends TestCase { [ 'unexist,settings', 'files', - '{"settings":{"app":"settings","order":1},"files":{"app":"files","order":2}}', + '{"settings_id":{"app":"settings","order":1},"files_id":{"app":"files","order":2}}', true, 'files', ], @@ -688,10 +699,18 @@ class AppManagerTest extends TestCase { [ '', '', - '{"settings":{"app":"settings","order":1},"files":{"app":"files","order":2}}', + '{"settings_id":{"app":"settings","order":1},"files":{"app":"files","order":2}}', true, 'settings', ], + // user-customized apporder fallback with missing app key (entries added by closures does not always have an app key set (Nextcloud 27 spreed app for example)) + [ + '', + '', + '{"spreed":{"order":1},"files":{"app":"files","order":2}}', + true, + 'files', + ], // user-customized apporder, but called without fallback [ '', @@ -700,6 +719,14 @@ class AppManagerTest extends TestCase { false, '', ], + // user-customized apporder with an app that has multiple routes + [ + '', + '', + '{"settings_id":{"app":"settings","order":1},"settings_id_2":{"app":"settings","order":3},"id_files":{"app":"files","order":2}}', + true, + 'settings', + ], ]; } -- cgit v1.2.3