update tests to be more robust against catalog-client changes

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-11-14 16:50:17 +01:00
parent 68360a5fc6
commit 9bafcfc209
13 changed files with 269 additions and 224 deletions
@@ -24,7 +24,7 @@ import {
import { CatalogIdentityClient } from './CatalogIdentityClient';
describe('CatalogIdentityClient', () => {
const catalogApi: jest.Mocked<CatalogApi> = {
const catalogApi = {
getLocationById: jest.fn(),
getEntityByRef: jest.fn(),
getEntities: jest.fn(),
@@ -48,7 +48,7 @@ describe('CatalogIdentityClient', () => {
catalogApi.getEntities.mockResolvedValueOnce({ items: [{} as UserEntity] });
tokenManager.getToken.mockResolvedValue({ token: 'my-token' });
const client = new CatalogIdentityClient({
catalogApi,
catalogApi: catalogApi as Partial<CatalogApi> as CatalogApi,
tokenManager,
});
@@ -106,7 +106,7 @@ describe('CatalogIdentityClient', () => {
tokenManager.getToken.mockResolvedValue({ token: 'my-token' });
const client = new CatalogIdentityClient({
catalogApi,
catalogApi: catalogApi as Partial<CatalogApi> as CatalogApi,
tokenManager,
});