* fix: refactor to accommodate authentication, transaction and pagination together into ctx.state * feat: allow passing response type to APIContext * feat: preliminary work for initial review * fix: use unknown for base types * fix: api/attachments * fix: api/documents * fix: jsdoc comment for input * fix: replace at() with index access for compatibility * fix: validation err message * fix: error handling * fix: remove unnecessary extend
83 lines
1.7 KiB
Plaintext
83 lines
1.7 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`#documents.create should error with invalid parentDocument 1`] = `
|
|
Object {
|
|
"error": "authorization_error",
|
|
"message": "Authorization error",
|
|
"ok": false,
|
|
"status": 403,
|
|
}
|
|
`;
|
|
|
|
exports[`#documents.delete should require authentication 1`] = `
|
|
Object {
|
|
"error": "authentication_required",
|
|
"message": "Authentication required",
|
|
"ok": false,
|
|
"status": 401,
|
|
}
|
|
`;
|
|
|
|
exports[`#documents.list should require authentication 1`] = `
|
|
Object {
|
|
"error": "authentication_required",
|
|
"message": "Authentication required",
|
|
"ok": false,
|
|
"status": 401,
|
|
}
|
|
`;
|
|
|
|
exports[`#documents.restore should require authentication 1`] = `
|
|
Object {
|
|
"error": "authentication_required",
|
|
"message": "Authentication required",
|
|
"ok": false,
|
|
"status": 401,
|
|
}
|
|
`;
|
|
|
|
exports[`#documents.search should require authentication 1`] = `
|
|
Object {
|
|
"error": "authentication_required",
|
|
"message": "Authentication error",
|
|
"ok": false,
|
|
"status": 401,
|
|
}
|
|
`;
|
|
|
|
exports[`#documents.update should fail if document lastRevision does not match 1`] = `
|
|
Object {
|
|
"error": "invalid_request",
|
|
"message": "Document has changed since last revision",
|
|
"ok": false,
|
|
"status": 400,
|
|
}
|
|
`;
|
|
|
|
exports[`#documents.update should require authentication 1`] = `
|
|
Object {
|
|
"error": "authentication_required",
|
|
"message": "Authentication required",
|
|
"ok": false,
|
|
"status": 401,
|
|
}
|
|
`;
|
|
|
|
exports[`#documents.update should require text while appending 1`] = `
|
|
Object {
|
|
"error": "validation_error",
|
|
"message": "text is required while appending",
|
|
"ok": false,
|
|
"status": 400,
|
|
}
|
|
`;
|
|
|
|
exports[`#documents.viewed should require authentication 1`] = `
|
|
Object {
|
|
"error": "authentication_required",
|
|
"message": "Authentication required",
|
|
"ok": false,
|
|
"status": 401,
|
|
}
|
|
`;
|