mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 07:33:17 +00:00
Add snapshot to permissions registration
This commit is contained in:
parent
ff6127a21f
commit
cd01ef0234
64
packages/strapi-plugin-i18n/config/functions/__tests__/bootstrap.test.js
vendored
Normal file
64
packages/strapi-plugin-i18n/config/functions/__tests__/bootstrap.test.js
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
'use strict';
|
||||
|
||||
const bootstrap = require('../bootstrap');
|
||||
|
||||
describe('Bootstrap', () => {
|
||||
test('Calls actionProvider with consistent permissions', () => {
|
||||
const registerFn = jest.fn();
|
||||
|
||||
global.strapi = {
|
||||
admin: {
|
||||
services: {
|
||||
permission: {
|
||||
actionProvider: {
|
||||
register: registerFn,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
bootstrap();
|
||||
|
||||
expect(registerFn.mock.calls).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"category": "Internationalization",
|
||||
"displayName": "Create",
|
||||
"pluginName": "i18n",
|
||||
"section": "settings",
|
||||
"subCategory": "Locales",
|
||||
"uid": "locale.create",
|
||||
},
|
||||
Object {
|
||||
"category": "Internationalization",
|
||||
"displayName": "Read",
|
||||
"pluginName": "i18n",
|
||||
"section": "settings",
|
||||
"subCategory": "Locales",
|
||||
"uid": "locale.read",
|
||||
},
|
||||
Object {
|
||||
"category": "Internationalization",
|
||||
"displayName": "Update",
|
||||
"pluginName": "i18n",
|
||||
"section": "settings",
|
||||
"subCategory": "Locales",
|
||||
"uid": "locale.update",
|
||||
},
|
||||
Object {
|
||||
"category": "Internationalization",
|
||||
"displayName": "Delete",
|
||||
"pluginName": "i18n",
|
||||
"section": "settings",
|
||||
"subCategory": "Locales",
|
||||
"uid": "locale.delete",
|
||||
},
|
||||
],
|
||||
],
|
||||
]
|
||||
`);
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user