🐛 [Bug] Unstable Backend Tests
Created by: ulfgebhardt
🐛 Bugreport
!!! duplicate of #4572 (closed)
FAIL src/middleware/permissionsMiddleware.spec.js (10.062s)
authorization
given an owner, an other user, an admin, a moderator
access email address
unauthenticated
✓ throws an error and does not expose the owner's email address (939ms)
authenticated
as the owner
✓ exposes the owner's email address (626ms)
as another regular user
✓ throws an error and does not expose the owner's email address (640ms)
as a moderator
✓ throws an error and does not expose the owner's email address (655ms)
as an administrator
✓ exposes the owner's email address (605ms)
access Signup
admin invite only
as user
✓ denies permission (981ms)
as admin
✓ returns an email (1077ms)
public registration
as anyone
✓ returns an email (985ms)
invite registration
as anyone with valid invite code
✓ returns an email (1029ms)
as anyone without valid invite
✕ denies permission (882ms)
● authorization › given an owner, an other user, an admin, a moderator › access Signup › invite registration › as anyone without valid invite › denies permission
TypeError: Cannot read property 'get' of undefined
100 | options.avatar,
101 | ])
> 102 | await Promise.all([user.relateTo(email, 'primaryEmail'), email.relateTo(user, 'belongsTo')])
| ^
103 | if (avatar) await user.relateTo(avatar, 'avatar')
104 | return user
105 | })
at node_modules/neode/build/Services/RelateTo.js:53:38
at runMicrotasks (<anonymous>)
at async Promise.all (index 0)
at Array.<anonymous> (src/db/factories.js:102:5)