🔢 Shared with me filters (#79)

 feat: shared with me filters
🐛 Fix try to access the service with init
🌐 feat: shared with me i18n
🌐russian translation

---------

Co-authored-by: Anton SHEPILOV <ashepilov@linagora.com>
This commit is contained in:
Montassar Ghanmy
2023-06-17 15:37:33 +01:00
committed by GitHub
parent fddd3b4ebd
commit 441c2b780f
19 changed files with 482 additions and 404 deletions
@@ -171,7 +171,7 @@ describe("the Drive feature", () => {
});
it("did search for an item and check that all the fields for 'shared_with_me' view", async () => {
jest.setTimeout(10000);
jest.setTimeout(20000);
//given:: user uploaded one doc and give permission to another user
const oneUser = await TestHelpers.getInstance(platform, true);
const anotherUser = await TestHelpers.getInstance(platform, true);
@@ -187,7 +187,7 @@ describe("the Drive feature", () => {
});
await oneUser.updateDocument(doc.id, doc);
await new Promise(resolve => setTimeout(resolve, 3000));
await new Promise(resolve => setTimeout(resolve, 5000));
//when:: user search for a doc
const searchResponse = await anotherUser.searchDocument({ view: "shared_with_me" });
@@ -211,6 +211,34 @@ describe("the Drive feature", () => {
expect(actual.shared_by?.first_name).toEqual(oneUser.user.first_name);
});
it("'shared_with_me' shouldn't return files uploaded by me", async () => {
jest.setTimeout(20000);
//given:: user uploaded one doc and give permission to another user
const oneUser = await TestHelpers.getInstance(platform, true);
const anotherUser = await TestHelpers.getInstance(platform, true);
const doc = await oneUser.uploadRandomFileAndCreateDocument();
await new Promise(r => setTimeout(r, 3000));
//give permissions to the file
doc.access_info.entities.push({
type: "user",
id: anotherUser.user.id,
level: "read",
grantor: null,
});
await oneUser.updateDocument(doc.id, doc);
//another user also uploaded several files
await anotherUser.uploadRandomFileAndCreateDocument();
await new Promise(resolve => setTimeout(resolve, 5000));
//when:: user search for a doc
const searchResponse = await anotherUser.sharedWithMeDocuments({});
//then::
expect(searchResponse.entities?.length).toEqual(1);
const actual = searchResponse.entities[0];
})
it("did search for an item that doesn't exist", async () => {
await createItem();