Revoked share links (#664)
* Move to revokation API for share links
* Respect revoked share links
Add documentation for shares endpoints
* 💚
This commit is contained in:
@ -36,7 +36,7 @@ describe('#documents.info', async () => {
|
||||
expect(body.data.id).toEqual(document.id);
|
||||
});
|
||||
|
||||
it('should return redacted documents from shareId without token', async () => {
|
||||
it('should return redacted document from shareId without token', async () => {
|
||||
const { document } = await seed();
|
||||
const share = await buildShare({
|
||||
documentId: document.id,
|
||||
@ -55,6 +55,20 @@ describe('#documents.info', async () => {
|
||||
expect(body.data.updatedBy).toEqual(undefined);
|
||||
});
|
||||
|
||||
it('should not return document from revoked shareId', async () => {
|
||||
const { document, user } = await seed();
|
||||
const share = await buildShare({
|
||||
documentId: document.id,
|
||||
teamId: document.teamId,
|
||||
});
|
||||
await share.revoke(user.id);
|
||||
|
||||
const res = await server.post('/api/documents.info', {
|
||||
body: { shareId: share.id },
|
||||
});
|
||||
expect(res.status).toEqual(400);
|
||||
});
|
||||
|
||||
it('should return documents from shareId with token', async () => {
|
||||
const { user, document, collection } = await seed();
|
||||
const share = await buildShare({
|
||||
|
Reference in New Issue
Block a user