fix policy test

This commit is contained in:
Pierre Noël 2021-08-27 14:30:08 +02:00
parent 9362311924
commit 9a2fe3c715
2 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ describe('Policy util', () => {
},
};
expect(policyUtils.get('test-policy', 'test-plugin')).toBe(policyFn);
expect(policyUtils.get('test-policy', { pluginName: 'test-plugin' })).toBe(policyFn);
});
test('Retrieves an api policy locally', () => {
@ -70,7 +70,7 @@ describe('Policy util', () => {
},
};
expect(policyUtils.get('test-policy', undefined, 'test-api')).toBe(policyFn);
expect(policyUtils.get('test-policy', { apiName: 'test-api' })).toBe(policyFn);
});
});
});

View File

@ -137,7 +137,7 @@ const policyResolvers = [
},
];
const get = (policy, { pluginName, apiName }) => {
const get = (policy, { pluginName, apiName } = {}) => {
if (typeof policy === 'function') {
return policy;
}