* feat: support user preferences * feat: support team preferences * fix: update snapshots * feat: update last visited url by user * fix: update snapshots * fix: use path instead of complete url * fix: do not expose preferences to other users with the exception of admin * feat: support defaultDocumentStatus as a team preference * feat: allow edit even when collaborative editing is enabled * Revert "feat: allow edit even when collaborative editing is enabled" This reverts commit a22a02a406d01eb418dab32249b8b846bf77c59b. * Revert "feat: support defaultDocumentStatus as a team preference" This reverts commit 4928cffe5c682952b1e469a3e50a1a34d05dcc58. * fix: keep preference as a boolean
302 lines
7.2 KiB
Plaintext
302 lines
7.2 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`#users.activate should activate a suspended user 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"avatarUrl": "https://tiley.herokuapp.com/avatar/111d68d06e2d317b5a59c2c6c5bad808/U.png?c=e600e0",
|
|
"color": "#e600e0",
|
|
"createdAt": "2018-01-02T00:00:00.000Z",
|
|
"email": "user1@example.com",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"isAdmin": false,
|
|
"isSuspended": false,
|
|
"isViewer": false,
|
|
"language": "en_US",
|
|
"lastActiveAt": null,
|
|
"name": "User 1",
|
|
"preferences": null,
|
|
"updatedAt": "2018-01-02T00:00:00.000Z",
|
|
},
|
|
"ok": true,
|
|
"policies": Array [
|
|
Object {
|
|
"abilities": Object {
|
|
"activate": true,
|
|
"delete": true,
|
|
"demote": true,
|
|
"promote": true,
|
|
"read": true,
|
|
"readDetails": true,
|
|
"resendInvite": true,
|
|
"suspend": true,
|
|
"update": false,
|
|
},
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
},
|
|
],
|
|
"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": "https://tiley.herokuapp.com/avatar/111d68d06e2d317b5a59c2c6c5bad808/U.png?c=e600e0",
|
|
"color": "#e600e0",
|
|
"createdAt": "2018-01-02T00:00:00.000Z",
|
|
"email": "user1@example.com",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"isAdmin": false,
|
|
"isSuspended": false,
|
|
"isViewer": false,
|
|
"language": "en_US",
|
|
"lastActiveAt": null,
|
|
"name": "User 1",
|
|
"preferences": null,
|
|
"updatedAt": "2018-01-02T00:00:00.000Z",
|
|
},
|
|
"ok": true,
|
|
"policies": Array [
|
|
Object {
|
|
"abilities": Object {
|
|
"activate": true,
|
|
"delete": true,
|
|
"demote": true,
|
|
"promote": true,
|
|
"read": true,
|
|
"readDetails": true,
|
|
"resendInvite": true,
|
|
"suspend": true,
|
|
"update": false,
|
|
},
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
},
|
|
],
|
|
"status": 200,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.demote should demote an admin to member 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"avatarUrl": "https://tiley.herokuapp.com/avatar/111d68d06e2d317b5a59c2c6c5bad808/U.png?c=e600e0",
|
|
"color": "#e600e0",
|
|
"createdAt": "2018-01-02T00:00:00.000Z",
|
|
"email": "user1@example.com",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"isAdmin": false,
|
|
"isSuspended": false,
|
|
"isViewer": false,
|
|
"language": "en_US",
|
|
"lastActiveAt": null,
|
|
"name": "User 1",
|
|
"preferences": null,
|
|
"updatedAt": "2018-01-02T00:00:00.000Z",
|
|
},
|
|
"ok": true,
|
|
"policies": Array [
|
|
Object {
|
|
"abilities": Object {
|
|
"activate": true,
|
|
"delete": true,
|
|
"demote": true,
|
|
"promote": true,
|
|
"read": true,
|
|
"readDetails": true,
|
|
"resendInvite": true,
|
|
"suspend": true,
|
|
"update": false,
|
|
},
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
},
|
|
],
|
|
"status": 200,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.demote should demote an admin to viewer 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"avatarUrl": "https://tiley.herokuapp.com/avatar/111d68d06e2d317b5a59c2c6c5bad808/U.png?c=e600e0",
|
|
"color": "#e600e0",
|
|
"createdAt": "2018-01-02T00:00:00.000Z",
|
|
"email": "user1@example.com",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"isAdmin": false,
|
|
"isSuspended": false,
|
|
"isViewer": true,
|
|
"language": "en_US",
|
|
"lastActiveAt": null,
|
|
"name": "User 1",
|
|
"preferences": null,
|
|
"updatedAt": "2018-01-02T00:00:00.000Z",
|
|
},
|
|
"ok": true,
|
|
"policies": Array [
|
|
Object {
|
|
"abilities": Object {
|
|
"activate": true,
|
|
"delete": true,
|
|
"demote": true,
|
|
"promote": true,
|
|
"read": true,
|
|
"readDetails": true,
|
|
"resendInvite": true,
|
|
"suspend": true,
|
|
"update": false,
|
|
},
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
},
|
|
],
|
|
"status": 200,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.demote should not allow demoting self 1`] = `
|
|
Object {
|
|
"error": "validation_error",
|
|
"message": "Unable to demote the current user",
|
|
"ok": false,
|
|
"status": 400,
|
|
}
|
|
`;
|
|
|
|
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.promote should promote a new admin 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"avatarUrl": "https://tiley.herokuapp.com/avatar/111d68d06e2d317b5a59c2c6c5bad808/U.png?c=e600e0",
|
|
"color": "#e600e0",
|
|
"createdAt": "2018-01-02T00:00:00.000Z",
|
|
"email": "user1@example.com",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"isAdmin": true,
|
|
"isSuspended": false,
|
|
"isViewer": false,
|
|
"language": "en_US",
|
|
"lastActiveAt": null,
|
|
"name": "User 1",
|
|
"preferences": null,
|
|
"updatedAt": "2018-01-02T00:00:00.000Z",
|
|
},
|
|
"ok": true,
|
|
"policies": Array [
|
|
Object {
|
|
"abilities": Object {
|
|
"activate": true,
|
|
"delete": true,
|
|
"demote": true,
|
|
"promote": false,
|
|
"read": true,
|
|
"readDetails": true,
|
|
"resendInvite": true,
|
|
"suspend": true,
|
|
"update": false,
|
|
},
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
},
|
|
],
|
|
"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 not allow suspending the user themselves 1`] = `
|
|
Object {
|
|
"error": "validation_error",
|
|
"message": "Unable to suspend the current user",
|
|
"ok": false,
|
|
"status": 400,
|
|
}
|
|
`;
|
|
|
|
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": "https://tiley.herokuapp.com/avatar/111d68d06e2d317b5a59c2c6c5bad808/U.png?c=e600e0",
|
|
"color": "#e600e0",
|
|
"createdAt": "2018-01-02T00:00:00.000Z",
|
|
"email": "user1@example.com",
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
"isAdmin": false,
|
|
"isSuspended": true,
|
|
"isViewer": false,
|
|
"language": "en_US",
|
|
"lastActiveAt": null,
|
|
"name": "User 1",
|
|
"preferences": null,
|
|
"updatedAt": "2018-01-02T00:00:00.000Z",
|
|
},
|
|
"ok": true,
|
|
"policies": Array [
|
|
Object {
|
|
"abilities": Object {
|
|
"activate": true,
|
|
"delete": true,
|
|
"demote": false,
|
|
"promote": false,
|
|
"read": true,
|
|
"readDetails": true,
|
|
"resendInvite": true,
|
|
"suspend": true,
|
|
"update": false,
|
|
},
|
|
"id": "46fde1d4-0050-428f-9f0b-0bf77f4bdf61",
|
|
},
|
|
],
|
|
"status": 200,
|
|
}
|
|
`;
|
|
|
|
exports[`#users.update should require authentication 1`] = `
|
|
Object {
|
|
"error": "authentication_required",
|
|
"message": "Authentication required",
|
|
"ok": false,
|
|
"status": 401,
|
|
}
|
|
`;
|