search: update api tests to mock getCredentials
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -27,16 +27,13 @@ describe('apis', () => {
|
||||
const getBaseUrl = jest.fn().mockResolvedValue(baseUrl);
|
||||
|
||||
const token = 'AUTHTOKEN';
|
||||
const withToken = jest.fn().mockResolvedValue(token);
|
||||
const withoutToken = jest.fn().mockResolvedValue(undefined);
|
||||
const createIdentityApiMock = (getIdToken: any) => ({
|
||||
getIdToken,
|
||||
getUserId: jest.fn(),
|
||||
getProfile: jest.fn(),
|
||||
const withToken = jest.fn().mockResolvedValue({ token });
|
||||
const withoutToken = jest.fn().mockResolvedValue({ token: undefined });
|
||||
const createIdentityApiMock = (getCredentials: any) => ({
|
||||
signOut: jest.fn(),
|
||||
getProfileInfo: jest.fn(),
|
||||
getBackstageIdentity: jest.fn(),
|
||||
getCredentials: jest.fn(),
|
||||
getCredentials,
|
||||
});
|
||||
|
||||
const client = new SearchClient({
|
||||
|
||||
Reference in New Issue
Block a user