chore(scaffolder-backend): update unit tests for router

Signed-off-by: Frank Kong <frkong@redhat.com>
This commit is contained in:
Frank Kong
2024-05-02 22:53:12 -04:00
parent 210dc0d2bd
commit b75d78761c
@@ -235,6 +235,11 @@ describe('createRouter', () => {
result: AuthorizeResult.ALLOW,
},
]);
jest.spyOn(permissionApi, 'authorize').mockImplementation(async () => [
{
result: AuthorizeResult.ALLOW,
},
]);
});
afterEach(() => {
@@ -741,6 +746,11 @@ data: {"id":1,"taskId":"a-random-id","type":"completion","createdAt":"","body":{
result: AuthorizeResult.ALLOW,
},
]);
jest.spyOn(permissionApi, 'authorize').mockImplementation(async () => [
{
result: AuthorizeResult.ALLOW,
},
]);
});
afterEach(() => {
@@ -895,11 +905,6 @@ data: {"id":1,"taskId":"a-random-id","type":"completion","createdAt":"","body":{
it('filters steps that the user is not authorized to see', async () => {
jest
.spyOn(permissionApi, 'authorizeConditional')
.mockImplementationOnce(async () => [
{
result: AuthorizeResult.ALLOW,
},
])
.mockImplementation(async () => [
{
result: AuthorizeResult.ALLOW,