diff --git a/packages/catalog-client/src/CatalogClient.ts b/packages/catalog-client/src/CatalogClient.ts index 92432e7088..04206edcdb 100644 --- a/packages/catalog-client/src/CatalogClient.ts +++ b/packages/catalog-client/src/CatalogClient.ts @@ -146,7 +146,7 @@ export class CatalogClient implements CatalogApi { `${await this.discoveryApi.getBaseUrl('catalog')}/entities/by-uid/${uid}`, { headers: options?.token - ? { authorization: `Bearer ${options.token}` } + ? { Authorization: `Bearer ${options.token}` } : {}, method: 'DELETE', }, @@ -171,7 +171,7 @@ export class CatalogClient implements CatalogApi { const url = `${await this.discoveryApi.getBaseUrl('catalog')}${path}`; const response = await fetch(url, { headers: options?.token - ? { authorization: `Bearer ${options.token}` } + ? { Authorization: `Bearer ${options.token}` } : {}, }); @@ -191,7 +191,7 @@ export class CatalogClient implements CatalogApi { const url = `${await this.discoveryApi.getBaseUrl('catalog')}${path}`; const response = await fetch(url, { headers: options?.token - ? { authorization: `Bearer ${options.token}` } + ? { Authorization: `Bearer ${options.token}` } : {}, }); diff --git a/plugins/catalog-import/src/components/ImportComponentPage.test.tsx b/plugins/catalog-import/src/components/ImportComponentPage.test.tsx index ed73d1c435..4cadea85c0 100644 --- a/plugins/catalog-import/src/components/ImportComponentPage.test.tsx +++ b/plugins/catalog-import/src/components/ImportComponentPage.test.tsx @@ -57,7 +57,7 @@ describe('', () => { new CatalogImportClient({ discoveryApi: {} as any, githubAuthApi: { - getAccessToken: (_, __) => Promise.resolve('token'), + getAccessToken: async () => 'token', }, identityApi, configApi: {} as any, diff --git a/plugins/catalog/src/CatalogClientWrapper.test.ts b/plugins/catalog/src/CatalogClientWrapper.test.ts index d95d274ee9..87dcd8f74b 100644 --- a/plugins/catalog/src/CatalogClientWrapper.test.ts +++ b/plugins/catalog/src/CatalogClientWrapper.test.ts @@ -63,7 +63,6 @@ describe('CatalogClientWrapper', () => { describe('getEntities', () => { it('injects authorization token', async () => { - expect.assertions(2); const client = new CatalogClientWrapper({ client: new MockedCatalogClient({ discoveryApi }), identityApi, @@ -79,7 +78,6 @@ describe('CatalogClientWrapper', () => { describe('getLocationById', () => { it('omits authorization token when guest', async () => { - expect.assertions(2); const client = new CatalogClientWrapper({ client: new MockedCatalogClient({ discoveryApi }), identityApi: guestIdentityApi, @@ -99,7 +97,6 @@ describe('CatalogClientWrapper', () => { name: 'name', }; it('injects authorization token', async () => { - expect.assertions(2); const client = new CatalogClientWrapper({ client: new MockedCatalogClient({ discoveryApi }), identityApi, @@ -117,7 +114,6 @@ describe('CatalogClientWrapper', () => { describe('addLocation', () => { const location = { target: 'target' }; it('injects authorization token', async () => { - expect.assertions(2); const client = new CatalogClientWrapper({ client: new MockedCatalogClient({ discoveryApi }), identityApi, @@ -140,7 +136,6 @@ describe('CatalogClientWrapper', () => { }, }; it('injects authorization token', async () => { - expect.assertions(2); const client = new CatalogClientWrapper({ client: new MockedCatalogClient({ discoveryApi }), identityApi, @@ -158,7 +153,6 @@ describe('CatalogClientWrapper', () => { describe('removeEntityByUid', () => { it('injects authorization token', async () => { const uid = 'uid'; - expect.assertions(2); const client = new CatalogClientWrapper({ client: new MockedCatalogClient({ discoveryApi }), identityApi, diff --git a/plugins/fossa/src/api/FossaClient.ts b/plugins/fossa/src/api/FossaClient.ts index 4428ec7dbb..5693895901 100644 --- a/plugins/fossa/src/api/FossaClient.ts +++ b/plugins/fossa/src/api/FossaClient.ts @@ -41,7 +41,7 @@ export class FossaClient implements FossaApi { const apiUrl = `${await this.discoveryApi.getBaseUrl('proxy')}/fossa`; const idToken = await this.identityApi.getIdToken(); const response = await fetch(`${apiUrl}/${path}`, { - headers: idToken ? { authorization: `Bearer ${idToken}` } : {}, + headers: idToken ? { Authorization: `Bearer ${idToken}` } : {}, }); if (response.status === 200) { return await response.json(); diff --git a/plugins/rollbar/src/api/RollbarClient.ts b/plugins/rollbar/src/api/RollbarClient.ts index dfc82b09e5..d3ad3d63db 100644 --- a/plugins/rollbar/src/api/RollbarClient.ts +++ b/plugins/rollbar/src/api/RollbarClient.ts @@ -60,7 +60,7 @@ export class RollbarClient implements RollbarApi { const url = `${await this.discoveryApi.getBaseUrl('rollbar')}${path}`; const idToken = await this.identityApi.getIdToken(); const response = await fetch(url, { - headers: idToken ? { authorization: `Bearer ${idToken}` } : {}, + headers: idToken ? { Authorization: `Bearer ${idToken}` } : {}, }); if (!response.ok) {