2019-08-30 12:34:51 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2021-02-05 20:57:03 +00:00
|
|
|
import { Project, ProjectFields, ProjectLimits, ProjectsApi, ProjectsCursor, ProjectsPage } from '@/types/projects';
|
2019-08-30 12:34:51 +01:00
|
|
|
|
|
|
|
/**
|
2019-09-27 15:41:04 +01:00
|
|
|
* Mock for ProjectsApi
|
2019-08-30 12:34:51 +01:00
|
|
|
*/
|
|
|
|
export class ProjectsApiMock implements ProjectsApi {
|
2019-09-27 15:41:04 +01:00
|
|
|
private mockProjects: Project[];
|
2019-12-12 16:25:38 +00:00
|
|
|
private mockLimits: ProjectLimits;
|
2021-02-05 20:57:03 +00:00
|
|
|
private mockProjectsPage: ProjectsPage;
|
2019-08-30 12:34:51 +01:00
|
|
|
|
2019-09-27 15:41:04 +01:00
|
|
|
public setMockProjects(mockProjects: Project[]): void {
|
|
|
|
this.mockProjects = mockProjects;
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|
|
|
|
|
2019-12-12 16:25:38 +00:00
|
|
|
public setMockLimits(mockLimits: ProjectLimits): void {
|
|
|
|
this.mockLimits = mockLimits;
|
|
|
|
}
|
|
|
|
|
2020-09-15 13:44:23 +01:00
|
|
|
create(createProjectFields: ProjectFields): Promise<Project> {
|
2019-08-30 12:34:51 +01:00
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
delete(projectId: string): Promise<void> {
|
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
get(): Promise<Project[]> {
|
2019-09-27 15:41:04 +01:00
|
|
|
return Promise.resolve(this.mockProjects);
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|
|
|
|
|
2021-02-05 20:57:03 +00:00
|
|
|
getOwnedProjects(cursor: ProjectsCursor): Promise<ProjectsPage> {
|
|
|
|
return Promise.resolve(this.mockProjectsPage);
|
|
|
|
}
|
|
|
|
|
2020-09-10 10:32:35 +01:00
|
|
|
update(projectId: string, name: string, description: string): Promise<void> {
|
2020-03-18 17:07:29 +00:00
|
|
|
return Promise.resolve();
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|
2019-12-12 16:25:38 +00:00
|
|
|
|
|
|
|
getLimits(projectId: string): Promise<ProjectLimits> {
|
2020-03-18 17:07:29 +00:00
|
|
|
return Promise.resolve(this.mockLimits);
|
2019-12-12 16:25:38 +00:00
|
|
|
}
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|