mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 15:44:59 +00:00
fix policy test
This commit is contained in:
parent
9362311924
commit
9a2fe3c715
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -137,7 +137,7 @@ const policyResolvers = [
|
||||
},
|
||||
];
|
||||
|
||||
const get = (policy, { pluginName, apiName }) => {
|
||||
const get = (policy, { pluginName, apiName } = {}) => {
|
||||
if (typeof policy === 'function') {
|
||||
return policy;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user