storj/web/satellite/tests/unit/mock/api/apiKeys.ts
VitaliiShpital 2284008b8c web/satellite: onboarding tour: api keys and upload data steps
Change-Id: I8ffa6d688a22c1568495a7e0e176096cadcd6eaa
2020-05-04 13:26:12 +00:00

28 lines
799 B
TypeScript

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
import { ApiKey, ApiKeyCursor, ApiKeysApi, ApiKeysPage } from '@/types/apiKeys';
/**
* Mock for ApiKeysApi
*/
export class ApiKeysMock implements ApiKeysApi {
private mockApiKeysPage: ApiKeysPage;
public setMockApiKeysPage(mockApiKeysPage: ApiKeysPage): void {
this.mockApiKeysPage = mockApiKeysPage;
}
get(projectId: string, cursor: ApiKeyCursor): Promise<ApiKeysPage> {
return Promise.resolve(this.mockApiKeysPage);
}
create(projectId: string, name: string): Promise<ApiKey> {
return Promise.resolve(new ApiKey('testId', 'testName', 'test', 'testKey'));
}
delete(ids: string[]): Promise<void> {
throw new Error('Method not implemented');
}
}