aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/tests/specHelper.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/tests/specHelper.js')
-rw-r--r--core/js/tests/specHelper.js42
1 files changed, 21 insertions, 21 deletions
diff --git a/core/js/tests/specHelper.js b/core/js/tests/specHelper.js
index d8ac35f827d..77958488df7 100644
--- a/core/js/tests/specHelper.js
+++ b/core/js/tests/specHelper.js
@@ -1,23 +1,8 @@
/**
-* ownCloud
-*
-* @author Vincent Petry
-* @copyright 2014 Vincent Petry <pvince81@owncloud.com>
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
-* License as published by the Free Software Foundation; either
-* version 3 of the License, or any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
-*
-* You should have received a copy of the GNU Affero General Public
-* License along with this library. If not, see <http://www.gnu.org/licenses/>.
-*
-*/
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2014 ownCloud Inc.
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
/**
* Simulate the variables that are normally set by PHP code
@@ -86,12 +71,23 @@ window.firstDay = 0;
// setup dummy webroots
/* jshint camelcase: false */
window.oc_debug = true;
+
+// Mock @nextcloud/capabilities
+window._oc_capabilities = {
+ files_sharing: {
+ api_enabled: true
+ }
+}
+
// FIXME: OC.webroot is supposed to be only the path!!!
-OC.webroot = location.href + '/';
-OC.appswebroots = {
+window._oc_webroot = location.href + '/';
+window._oc_appswebroots = {
"files": window.webroot + '/apps/files/',
"files_sharing": window.webroot + '/apps/files_sharing/'
};
+
+window.OC ??= {};
+
OC.config = {
session_lifetime: 600 * 1000,
session_keepalive: false,
@@ -118,6 +114,10 @@ window.Snap.prototype = {
window.isPhantom = /phantom/i.test(navigator.userAgent);
document.documentElement.lang = navigator.language;
+const el = document.createElement('input');
+el.id = 'initial-state-core-config';
+el.value = btoa(JSON.stringify(window.OC.config))
+document.body.append(el);
// global setup for all tests
(function setupTests() {