Fixed older router tests

Signed-off-by: Harry Hogg <hhogg@spotify.com>
This commit is contained in:
Harry Hogg
2023-02-02 14:58:03 +00:00
committed by Vincenzo Scamporlino
parent 8dbacc2228
commit 47e5d7712a
@@ -44,7 +44,10 @@ import {
IdentityApiGetIdentityRequest,
BackstageIdentityResponse,
} from '@backstage/plugin-auth-node';
import { PermissionEvaluator } from '@backstage/plugin-permission-common';
import {
AuthorizeResult,
PermissionEvaluator,
} from '@backstage/plugin-permission-common';
const mockAccess = jest.fn();
@@ -142,7 +145,14 @@ describe('createRouter', () => {
const permissionApi: PermissionEvaluator = {
authorize: jest.fn(),
authorizeConditional: jest.fn(),
authorizeConditional: jest.fn().mockResolvedValue([
{
result: AuthorizeResult.ALLOW,
},
{
result: AuthorizeResult.ALLOW,
},
]),
};
jest.spyOn(taskBroker, 'dispatch');
@@ -753,7 +763,14 @@ data: {"id":1,"taskId":"a-random-id","type":"completion","createdAt":"","body":{
const permissionApi: PermissionEvaluator = {
authorize: jest.fn(),
authorizeConditional: jest.fn(),
authorizeConditional: jest.fn().mockResolvedValue([
{
result: AuthorizeResult.ALLOW,
},
{
result: AuthorizeResult.ALLOW,
},
]),
};
const router = await createRouter({