diff --git a/src/client/web/src/client/files_mock.ts b/src/client/web/src/client/files_mock.ts index c0cc4c4..062422c 100644 --- a/src/client/web/src/client/files_mock.ts +++ b/src/client/web/src/client/files_mock.ts @@ -3,6 +3,7 @@ import { UploadStatusResp, ListResp, ListUploadingsResp, + ListSharingsResp, } from "./"; export class FilesClient { @@ -22,6 +23,10 @@ export class FilesClient { private listHomeMockResp: Promise>; private listUploadingsMockResp: Promise>; private deleteUploadingMockResp: Promise; + private addSharingMockResp: Promise; + private deleteSharingMockResp: Promise; + private listSharingsMockResp: Promise>; + private isSharingMockResp: Promise; constructor(url: string) { this.url = url; @@ -65,17 +70,35 @@ export class FilesClient { listUploadingsMock = (resp: Promise>) => { this.listUploadingsMockResp = resp; - } + }; deleteUploadingMock = (resp: Promise) => { this.deleteUploadingMockResp = resp; - } + }; + + addSharingMock = (resp: Promise) => { + this.addSharingMockResp = resp; + }; + + deleteSharingMock = (resp: Promise) => { + this.deleteSharingMockResp = resp; + }; + + listSharingsMock = (resp: Promise) => { + this.listSharingsMockResp = resp; + }; + + isSharingMock = (resp: Promise) => { + this.isSharingMockResp = resp; + }; create = (filePath: string, fileSize: number): Promise => { if (this.createMockRespID < this.createMockResps.length) { return this.createMockResps[this.createMockRespID++]; } - throw new Error(`this.createMockRespID (${this.createMockRespID}) out of bound: ${this.createMockResps.length}`); + throw new Error( + `this.createMockRespID (${this.createMockRespID}) out of bound: ${this.createMockResps.length}` + ); }; delete = (filePath: string): Promise => { @@ -102,14 +125,18 @@ export class FilesClient { if (this.uploadChunkMockRespID < this.uploadChunkMockResps.length) { return this.uploadChunkMockResps[this.uploadChunkMockRespID++]; } - throw new Error(`this.uploadChunkMockRespID (${this.uploadChunkMockRespID}) out of bound: ${this.uploadChunkMockResps.length}`); + throw new Error( + `this.uploadChunkMockRespID (${this.uploadChunkMockRespID}) out of bound: ${this.uploadChunkMockResps.length}` + ); }; uploadStatus = (filePath: string): Promise> => { if (this.uploadStatusMockRespID < this.uploadStatusMockResps.length) { return this.uploadStatusMockResps[this.uploadStatusMockRespID++]; } - throw new Error(`this.uploadStatusMockRespID (${this.uploadStatusMockRespID}) out of bound: ${this.uploadStatusMockResps.length}`); + throw new Error( + `this.uploadStatusMockRespID (${this.uploadStatusMockRespID}) out of bound: ${this.uploadStatusMockResps.length}` + ); }; list = (dirPath: string): Promise> => { @@ -124,7 +151,23 @@ export class FilesClient { return this.listUploadingsMockResp; }; - deleteUploading = (filePath:string): Promise> => { + deleteUploading = (filePath: string): Promise> => { return this.deleteUploadingMockResp; }; + + addSharing = (dirPath: string): Promise => { + return this.addSharingMockResp; + }; + + deleteSharing = (dirPath: string): Promise => { + return this.deleteSharingMockResp; + }; + + listSharings = (): Promise> => { + return this.listSharingsMockResp; + }; + + isSharing = (dirPath: string): Promise => { + return this.isSharingMockResp; + }; }