]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(tests): Adjust legacy tests for nextcloud-router update 43093/head
authorFerdinand Thiessen <opensource@fthiessen.de>
Wed, 24 Jan 2024 18:28:00 +0000 (19:28 +0100)
committerFerdinand Thiessen <opensource@fthiessen.de>
Thu, 25 Jan 2024 16:55:06 +0000 (17:55 +0100)
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
apps/files_sharing/tests/js/publicAppSpec.js
core/js/tests/specHelper.js
core/js/tests/specs/coreSpec.js
core/js/tests/specs/l10nSpec.js

index 229e57ac4ed1eb210d71c98d1a75792593302322..72a31088c6c4671642a82bf05bc797953d379df5 100644 (file)
@@ -30,8 +30,8 @@ describe('OCA.Sharing.PublicApp tests', function() {
        var $preview;
 
        beforeEach(function() {
-               originalWebroot = OC.webroot;
-               OC.webroot = '/owncloud';
+               originalWebroot = window._oc_webroot;
+               window._oc_webroot = '/owncloud';
                protocolStub = sinon.stub(OC, 'getProtocol').returns('https');
                hostStub = sinon.stub(OC, 'getHost').returns('example.com:9876');
 
@@ -45,7 +45,7 @@ describe('OCA.Sharing.PublicApp tests', function() {
        });
 
        afterEach(function() {
-               OC.webroot = originalWebroot;
+               window._oc_webroot = originalWebroot;
                protocolStub.restore();
                hostStub.restore();
        });
index 498eed757d6815b99780c1a559d039fb717f8008..d2afe2b67cfaf060b79064a2171d6a77d7e94da3 100644 (file)
@@ -95,8 +95,8 @@ window._oc_capabilities = {
 }
 
 // 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/'
 };
index b7339ce71889cd421255788b3e746dba7aba8ba6..8b689fbcecf0b11e8dc7f3cd8a63f24f16e839ef 100644 (file)
@@ -42,16 +42,16 @@ describe('Core base tests', function() {
        describe('Base values', function() {
                it('Sets webroots', function() {
                        expect(OC.getRootPath()).toBeDefined();
-                       expect(OC.appswebroots).toBeDefined();
+                       expect(window._oc_appswebroots).toBeDefined();
                });
        });
        describe('filePath', function() {
                beforeEach(function() {
-                       OC.webroot = 'http://localhost';
-                       OC.appswebroots.files = OC.getRootPath() + '/apps3/files';
+                       window._oc_webroot = 'http://localhost';
+                       window._oc_appswebroots.files = OC.getRootPath() + '/apps3/files';
                });
                afterEach(function() {
-                       delete OC.appswebroots.files;
+                       delete window._oc_appswebroots.files;
                });
 
                it('Uses a direct link for css and images,' , function() {
@@ -70,11 +70,11 @@ describe('Core base tests', function() {
                var TESTAPP_ROOT = OC.getRootPath() + '/appsx/testapp';
 
                beforeEach(function() {
-                       OC.appswebroots[TESTAPP] = TESTAPP_ROOT;
+                       window._oc_appswebroots[TESTAPP] = TESTAPP_ROOT;
                });
                afterEach(function() {
                        // restore original array
-                       delete OC.appswebroots[TESTAPP];
+                       delete window._oc_appswebroots[TESTAPP];
                });
                it('Generates correct links for core apps', function() {
                        expect(OC.linkTo('core', 'somefile.php')).toEqual(OC.getRootPath() + '/core/somefile.php');
index eaa9f5744c25ce825028439625f834e4d1b8f835..af01526c56938a42db4bc05fa65b3bc2010668b0 100644 (file)
@@ -12,11 +12,11 @@ describe('OC.L10N tests', function() {
        var TEST_APP = 'jsunittestapp';
 
        beforeEach(function() {
-               OC.appswebroots[TEST_APP] = OC.getRootPath() + '/apps3/jsunittestapp';
+               window._oc_appswebroots[TEST_APP] = OC.getRootPath() + '/apps3/jsunittestapp';
        });
        afterEach(function() {
                OC.L10N._unregister(TEST_APP);
-               delete OC.appswebroots[TEST_APP];
+               delete window._oc_appswebroots[TEST_APP];
        });
 
        describe('text translation', function() {