diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-03-23 19:36:18 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-03-23 20:48:13 +0100 |
commit | fef9fb3bc0a93b94ca87968246fbac69c4590e2f (patch) | |
tree | 9a75b3e054c63e145d9c9feb978ace693324be4f /core/js | |
parent | 20d069b56ca3226de63a7ca1e5baf76556001720 (diff) | |
download | nextcloud-server-fef9fb3bc0a93b94ca87968246fbac69c4590e2f.tar.gz nextcloud-server-fef9fb3bc0a93b94ca87968246fbac69c4590e2f.zip |
fix(tests): Add mock for `window._oc_webroot`
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/tests/specs/l10nSpec.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/js/tests/specs/l10nSpec.js b/core/js/tests/specs/l10nSpec.js index af01526c569..c1d596badf6 100644 --- a/core/js/tests/specs/l10nSpec.js +++ b/core/js/tests/specs/l10nSpec.js @@ -13,10 +13,15 @@ describe('OC.L10N tests', function() { beforeEach(function() { window._oc_appswebroots[TEST_APP] = OC.getRootPath() + '/apps3/jsunittestapp'; + + window.OC = window.OC ?? {} + window.OC.appswebroots = window.OC.appswebroots || {} + window.OC.appswebroots[TEST_APP] = OC.getRootPath() + '/apps3/jsunittestapp' }); afterEach(function() { OC.L10N._unregister(TEST_APP); delete window._oc_appswebroots[TEST_APP]; + delete window.OC.appswebroots[TEST_APP]; }); describe('text translation', function() { @@ -121,6 +126,7 @@ describe('OC.L10N tests', function() { expect(callbackStub.notCalled).toEqual(true); var req = fakeServer.requests[0]; + console.warn('fff-', window.OC.appswebroots) loading .then(promiseStub) .then(function() { |