fix(content-manager): typo when returning a component category

This commit is contained in:
Jamie Howard 2023-03-01 12:08:52 +00:00
parent 5c9a88be04
commit 5925ace19a
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 { return {
uid: component.uid, uid: component.uid,
category: component.categoru, category: component.category,
...configuration, ...configuration,
}; };
}, },