* Big upgrades * WIP: Stash * Stash, 30 flow errors left * Downgrade mobx * WIP * When I understand the difference between class and instance methods * 💚 * Fixes: File import Model saving edge cases pinning and starring docs Collection editing Upgrade mobx devtools * Notification settings saving works * Disabled settings * Document mailer * Working notifications * Colletion created notification Ensure not notified for own actions * Tidy up * Document updated event only for document creation Add indexes Notification setting on user creation * Commentary * Fixed: Notification setting on signup * Fix document move / duplicate stale data Add BaseModel.refresh method * Fixes: Title in sidebar not updated after editing document * 💚 * Improve / restore error handling Better handle offline errors * 👕
221 lines
5.1 KiB
Plaintext
221 lines
5.1 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`#users.activate should activate a suspended user 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"avatarUrl": "http://example.com/avatar.png",
|
|
"createdAt": "2018-01-01T00:00:00.000Z",
|
|
"email": "user1@example.com",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"isAdmin": false,
|
|
"isSuspended": false,
|
|
"name": "User 1",
|
|
"username": "user1",
|
|
},
|
|
"ok": true,
|
|
"status": 200,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.activate should require admin 1`] = `
|
|
Object {
|
|
"error": "admin_required",
|
|
"message": "An admin role is required to access this resource",
|
|
"ok": false,
|
|
"status": 403,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.delete should require authentication 1`] = `
|
|
Object {
|
|
"error": "authentication_required",
|
|
"message": "Authentication required",
|
|
"ok": false,
|
|
"status": 401,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.demote should demote an admin 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"avatarUrl": "http://example.com/avatar.png",
|
|
"createdAt": "2018-01-01T00:00:00.000Z",
|
|
"email": "user1@example.com",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"isAdmin": false,
|
|
"isSuspended": false,
|
|
"name": "User 1",
|
|
"username": "user1",
|
|
},
|
|
"ok": true,
|
|
"status": 200,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.demote should require admin 1`] = `
|
|
Object {
|
|
"error": "admin_required",
|
|
"message": "An admin role is required to access this resource",
|
|
"ok": false,
|
|
"status": 403,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.demote shouldn't demote admins if only one available 1`] = `
|
|
Object {
|
|
"error": "validation_error",
|
|
"message": "At least one admin is required",
|
|
"ok": false,
|
|
"status": 400,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.list should require admin for detailed info 1`] = `
|
|
Object {
|
|
"data": Array [
|
|
Object {
|
|
"avatarUrl": "http://example.com/avatar.png",
|
|
"createdAt": "2018-01-01T00:00:00.000Z",
|
|
"id": "fa952cff-fa64-4d42-a6ea-6955c9689046",
|
|
"name": "Admin User",
|
|
"username": "admin",
|
|
},
|
|
Object {
|
|
"avatarUrl": "http://example.com/avatar.png",
|
|
"createdAt": "2018-01-01T00:00:00.000Z",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"name": "User 1",
|
|
"username": "user1",
|
|
},
|
|
],
|
|
"ok": true,
|
|
"pagination": Object {
|
|
"limit": 15,
|
|
"nextPath": "/api/users.list?limit=15&offset=15",
|
|
"offset": 0,
|
|
},
|
|
"status": 200,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.list should return teams paginated user list 1`] = `
|
|
Object {
|
|
"data": Array [
|
|
Object {
|
|
"avatarUrl": "http://example.com/avatar.png",
|
|
"createdAt": "2018-01-01T00:00:00.000Z",
|
|
"email": "user1@example.com",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"isAdmin": false,
|
|
"isSuspended": false,
|
|
"name": "User 1",
|
|
"username": "user1",
|
|
},
|
|
Object {
|
|
"avatarUrl": "http://example.com/avatar.png",
|
|
"createdAt": "2018-01-01T00:00:00.000Z",
|
|
"email": "admin@example.com",
|
|
"id": "fa952cff-fa64-4d42-a6ea-6955c9689046",
|
|
"isAdmin": true,
|
|
"isSuspended": false,
|
|
"name": "Admin User",
|
|
"username": "admin",
|
|
},
|
|
],
|
|
"ok": true,
|
|
"pagination": Object {
|
|
"limit": 15,
|
|
"nextPath": "/api/users.list?limit=15&offset=15",
|
|
"offset": 0,
|
|
},
|
|
"status": 200,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.promote should promote a new admin 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"avatarUrl": "http://example.com/avatar.png",
|
|
"createdAt": "2018-01-01T00:00:00.000Z",
|
|
"email": "user1@example.com",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"isAdmin": true,
|
|
"isSuspended": false,
|
|
"name": "User 1",
|
|
"username": "user1",
|
|
},
|
|
"ok": true,
|
|
"status": 200,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.promote should require admin 1`] = `
|
|
Object {
|
|
"error": "admin_required",
|
|
"message": "An admin role is required to access this resource",
|
|
"ok": false,
|
|
"status": 403,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.suspend should require admin 1`] = `
|
|
Object {
|
|
"error": "admin_required",
|
|
"message": "An admin role is required to access this resource",
|
|
"ok": false,
|
|
"status": 403,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.suspend should suspend an user 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"avatarUrl": "http://example.com/avatar.png",
|
|
"createdAt": "2018-01-01T00:00:00.000Z",
|
|
"email": "user1@example.com",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"isAdmin": false,
|
|
"isSuspended": true,
|
|
"name": "User 1",
|
|
"username": "user1",
|
|
},
|
|
"ok": true,
|
|
"status": 200,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.suspend shouldn't allow suspending the user themselves 1`] = `
|
|
Object {
|
|
"error": "validation_error",
|
|
"message": "Unable to suspend the current user",
|
|
"ok": false,
|
|
"status": 400,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.update should require authentication 1`] = `
|
|
Object {
|
|
"error": "authentication_required",
|
|
"message": "Authentication required",
|
|
"ok": false,
|
|
"status": 401,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.update should update user profile information 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"avatarUrl": "http://example.com/avatar.png",
|
|
"createdAt": "2018-01-01T00:00:00.000Z",
|
|
"email": "user1@example.com",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"isAdmin": false,
|
|
"isSuspended": false,
|
|
"name": "New name",
|
|
"username": "user1",
|
|
},
|
|
"ok": true,
|
|
"status": 200,
|
|
}
|
|
`;
|