Merge branch 'main' into data-transfer/limit-token-name-length

This commit is contained in:
Simone Taeggi 2023-03-01 16:48:44 +01:00
commit 7545ef3f5c
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,28 @@
'use strict';
const componentsService = require('../components');
const configuration = {
test: 'value',
some: 'config',
};
jest.mock('../configuration', () =>
jest.fn(() => ({
getConfiguration: jest.fn(() => configuration),
}))
);
describe('componentService', () => {
test('findComponent', async () => {
const { findConfiguration } = componentsService({});
const component = {
uid: 'blog.test-compo',
category: 'blog',
};
const result = await findConfiguration(component);
expect(result).toEqual({ ...component, ...configuration });
});
});

View File

@ -41,7 +41,7 @@ module.exports = ({ strapi }) => ({
return {
uid: component.uid,
category: component.categoru,
category: component.category,
...configuration,
};
},