🐛 Not all the data is shown in the shared with me section (#376)
* 🐛Not all the data is shown in the shared with me section
This commit is contained in:
@@ -343,15 +343,15 @@ export default class UserApi {
|
||||
) {
|
||||
const response = await this.platform.app.inject({
|
||||
method: "POST",
|
||||
url: `${UserApi.DOC_URL}/companies/${this.platform.workspace.company_id}/shared-with-me`,
|
||||
url: `${UserApi.DOC_URL}/companies/${this.platform.workspace.company_id}/browse/shared_with_me`,
|
||||
headers: {
|
||||
authorization: `Bearer ${this.jwt}`
|
||||
},
|
||||
payload
|
||||
});
|
||||
|
||||
return deserialize<SearchResultMockClass>(
|
||||
SearchResultMockClass,
|
||||
return deserialize<DriveItemDetailsMockClass>(
|
||||
DriveItemDetailsMockClass,
|
||||
response.body);
|
||||
};
|
||||
|
||||
|
||||
@@ -126,10 +126,32 @@ describe("The Documents Browser Window and API", () => {
|
||||
await new Promise(r => setTimeout(r, 3000));
|
||||
|
||||
//then file become searchable
|
||||
expect((await anotherUser.browseDocuments("shared_with_me", {})).children).toHaveLength(1);
|
||||
expect((await anotherUser.browseDocuments("shared_with_me", {pageSize: 1})).children).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("Share With Me should return all the files that was share by user at one", async () => {
|
||||
const sharedWIthMeFolder = "shared_with_me";
|
||||
const oneUser = await UserApi.getInstance(platform, true, {companyRole: "admin"});
|
||||
const anotherUser = await UserApi.getInstance(platform, true, {companyRole: "admin"});
|
||||
|
||||
let files = await oneUser.uploadAllFilesOneByOne();
|
||||
|
||||
await anotherUser.uploadAllFilesOneByOne();
|
||||
await new Promise(r => setTimeout(r, 5000));
|
||||
|
||||
//give permissions to the file
|
||||
files[2].access_info.entities.push({
|
||||
type: "user",
|
||||
id: anotherUser.user.id,
|
||||
level: "read",
|
||||
grantor: null,
|
||||
});
|
||||
await oneUser.updateDocument(files[2].id, files[2]);
|
||||
await new Promise(r => setTimeout(r, 3000));
|
||||
|
||||
//then file become searchable
|
||||
expect((await anotherUser.browseDocuments("shared_with_me", {pagination: {limitStr: 100}})).children).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ describe("the Drive Search feature", () => {
|
||||
const searchResponse = await userTwo.sharedWithMeDocuments({});
|
||||
|
||||
//then::
|
||||
expect(searchResponse.entities?.length).toEqual(1);
|
||||
expect(searchResponse.children?.length).toEqual(1);
|
||||
})
|
||||
|
||||
it("did search for an item that doesn't exist", async () => {
|
||||
@@ -146,7 +146,7 @@ describe("the Drive Search feature", () => {
|
||||
|
||||
it("did search a file shared by another user", async () => {
|
||||
//then file become searchable
|
||||
expect((await userTwo.sharedWithMeDocuments({})).entities).toHaveLength(1);
|
||||
expect((await userTwo.sharedWithMeDocuments({})).children).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("did search a file by file owner", async () => {
|
||||
|
||||
Reference in New Issue
Block a user