TechDocs: Fix frontend tests due to async apiOrigin function

This commit is contained in:
Himanshu Mishra
2021-01-28 20:17:58 +01:00
parent ae893e99f9
commit 4ddf8d5e27
2 changed files with 2 additions and 1 deletions
@@ -57,6 +57,7 @@ describe('<TechDocsPage />', () => {
const techdocsStorageApi: Partial<TechDocsStorageApi> = {
getEntityDocs: (): Promise<string> => Promise.resolve('String'),
getBaseUrl: (): Promise<string> => Promise.resolve('String'),
getApiOrigin: (): Promise<string> => Promise.resolve('String'),
};
const apiRegistry = ApiRegistry.from([
@@ -21,7 +21,7 @@ import { TechDocsStorage } from '../../api';
const DOC_STORAGE_URL = 'https://example-host.storage.googleapis.com';
const techdocsStorageApi: TechDocsStorage = {
getBaseUrl: () => new Promise(resolve => resolve(DOC_STORAGE_URL)),
getBaseUrl: jest.fn(() => Promise.resolve(DOC_STORAGE_URL)),
getEntityDocs: () => new Promise(resolve => resolve('yes!')),
};