storj/web/satellite/tests/unit/mock/api/projects.ts
VitaliiShpital 7d5e0259f6 satellite/projects: initial update project name functionality implemented
WHAT:
added functionality for user to update project name. Logic only, without actual GUI updates.

WHY:
better user experience

Change-Id: I1e38e33ba827b0bdf2c89e29de24e4e87edb474a
2020-09-15 12:21:56 +03:00

41 lines
1.1 KiB
TypeScript

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
import { CreateProjectFields, Project, ProjectLimits, ProjectsApi } from '@/types/projects';
/**
* Mock for ProjectsApi
*/
export class ProjectsApiMock implements ProjectsApi {
private mockProjects: Project[];
private mockLimits: ProjectLimits;
public setMockProjects(mockProjects: Project[]): void {
this.mockProjects = mockProjects;
}
public setMockLimits(mockLimits: ProjectLimits): void {
this.mockLimits = mockLimits;
}
create(createProjectFields: CreateProjectFields): Promise<Project> {
throw new Error('not implemented');
}
delete(projectId: string): Promise<void> {
throw new Error('not implemented');
}
get(): Promise<Project[]> {
return Promise.resolve(this.mockProjects);
}
update(projectId: string, name: string, description: string): Promise<void> {
return Promise.resolve();
}
getLimits(projectId: string): Promise<ProjectLimits> {
return Promise.resolve(this.mockLimits);
}
}