parent
30c963a5f0
commit
61a1c93f0f
89 changed files with 15859 additions and 2 deletions
41
client/libs/__mocks__/api_share.js
Normal file
41
client/libs/__mocks__/api_share.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
let _infos = [];
|
||||
const shadowedId = "shadowedId";
|
||||
const publicId = "publicId";
|
||||
|
||||
export function __addInfos(infos) {
|
||||
_infos = [..._infos, ...infos];
|
||||
}
|
||||
|
||||
export function __truncInfos(info) {
|
||||
_infos = [];
|
||||
}
|
||||
|
||||
export const del = shareId => {
|
||||
_infos = _infos.filter(info => {
|
||||
return !info.shareId == shareId;
|
||||
});
|
||||
return Promise.resolve(true);
|
||||
};
|
||||
|
||||
export const list = () => {
|
||||
return Promise.resolve(_infos);
|
||||
};
|
||||
|
||||
export const shadowId = shareId => {
|
||||
return Promise.resolve(shadowedId);
|
||||
};
|
||||
|
||||
export const publishId = shareId => {
|
||||
return Promise.resolve(publicId);
|
||||
};
|
||||
|
||||
export const setDownLimit = (shareId, downLimit) => {
|
||||
_infos = _infos.map(info => {
|
||||
return info.shareId == shareId ? { ...info, downLimit } : info;
|
||||
});
|
||||
return Promise.resolve(true);
|
||||
};
|
||||
|
||||
export const addLocalFiles = () => {
|
||||
return Promise.resolve(true);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue