Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-11-04 13:14:19 +0300
committerAzul <azul@riseup.net>2021-11-11 12:06:12 +0300
commit04fc4835b8e1d238fda1ecc2cb258f0444233191 (patch)
treea67fa34b9232a3a9ef09c82d2fef0891f16485f8 /src/tests
parented39392235a7fa21db7ed485be4fa08d9f22ff00 (diff)
Mock current user in jest
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/setup.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tests/setup.js b/src/tests/setup.js
index e659a31b2..a26ec8bcd 100644
--- a/src/tests/setup.js
+++ b/src/tests/setup.js
@@ -26,6 +26,15 @@ import Vue from 'vue'
global.t = jest.fn().mockImplementation((app, text) => text)
global.n = jest.fn().mockImplementation((app, text) => text)
+jest.mock('@nextcloud/auth', () => ({
+ getCurrentUser: jest.fn().mockImplementation(() => ({
+ uid: 'user1',
+ displayName: 'User 1',
+ isAdmin: false,
+ }))
+}))
+
+
global.OC = {
requestToken: '123',
webroot: '/nc-webroot',