diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-11-04 13:14:19 +0300 |
---|---|---|
committer | Azul <azul@riseup.net> | 2021-11-11 12:06:12 +0300 |
commit | 04fc4835b8e1d238fda1ecc2cb258f0444233191 (patch) | |
tree | a67fa34b9232a3a9ef09c82d2fef0891f16485f8 /src | |
parent | ed39392235a7fa21db7ed485be4fa08d9f22ff00 (diff) |
Mock current user in jest
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/setup.js | 9 |
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', |