aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-09-25 14:21:23 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2023-10-20 00:24:17 +0200
commite9d4036389097708a6075d8882c32b1c7db4fb0f (patch)
tree97216c9a992ca14660193d5b0926fc72997bd044 /tests
parent363d9ebb130862d5fc5617e94b1c369caf02553f (diff)
downloadnextcloud-server-e9d4036389097708a6075d8882c32b1c7db4fb0f.tar.gz
nextcloud-server-e9d4036389097708a6075d8882c32b1c7db4fb0f.zip
feat(theming): Allow to configure default apps and app order in frontend settings
* Also add API for setting the value using ajax. * Add cypress tests for app order and defaul apps Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/App/AppManagerTest.php58
1 files changed, 56 insertions, 2 deletions
diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php
index 73ac7b79909..104b0941644 100644
--- a/tests/lib/App/AppManagerTest.php
+++ b/tests/lib/App/AppManagerTest.php
@@ -609,20 +609,47 @@ class AppManagerTest extends TestCase {
'',
'',
'{}',
+ true,
'files',
],
+ // none specified, without fallback
+ [
+ '',
+ '',
+ '{}',
+ false,
+ '',
+ ],
// unexisting or inaccessible app specified, default to files
[
'unexist',
'',
'{}',
+ true,
'files',
],
+ // unexisting or inaccessible app specified, without fallbacks
+ [
+ 'unexist',
+ '',
+ '{}',
+ false,
+ '',
+ ],
// non-standard app
[
'settings',
'',
'{}',
+ true,
+ 'settings',
+ ],
+ // non-standard app, without fallback
+ [
+ 'settings',
+ '',
+ '{}',
+ false,
'settings',
],
// non-standard app with fallback
@@ -630,13 +657,31 @@ class AppManagerTest extends TestCase {
'unexist,settings',
'',
'{}',
+ true,
'settings',
],
// user-customized defaultapp
[
+ '',
+ 'files',
+ '',
+ true,
+ 'files',
+ ],
+ // user-customized defaultapp with systemwide
+ [
+ 'unexist,settings',
+ 'files',
+ '',
+ true,
+ 'files',
+ ],
+ // user-customized defaultapp with system wide and apporder
+ [
'unexist,settings',
'files',
'{"settings":[1],"files":[2]}',
+ true,
'files',
],
// user-customized apporder fallback
@@ -644,15 +689,24 @@ class AppManagerTest extends TestCase {
'',
'',
'{"settings":[1],"files":[2]}',
+ true,
'settings',
],
+ // user-customized apporder, but called without fallback
+ [
+ '',
+ '',
+ '{"settings":[1],"files":[2]}',
+ false,
+ '',
+ ],
];
}
/**
* @dataProvider provideDefaultApps
*/
- public function testGetDefaultAppForUser($defaultApps, $userDefaultApps, $userApporder, $expectedApp) {
+ public function testGetDefaultAppForUser($defaultApps, $userDefaultApps, $userApporder, $withFallbacks, $expectedApp) {
$user = $this->newUser('user1');
$this->userSession->expects($this->once())
@@ -671,6 +725,6 @@ class AppManagerTest extends TestCase {
['user1', 'core', 'apporder', '[]', $userApporder],
]);
- $this->assertEquals($expectedApp, $this->manager->getDefaultAppForUser());
+ $this->assertEquals($expectedApp, $this->manager->getDefaultAppForUser(null, $withFallbacks));
}
}