mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 23:24:03 +00:00
Fix check for layouts
This commit is contained in:
parent
7f25aaf796
commit
9f404467fa
@ -5,7 +5,7 @@ const createAttributesLayout = (currentContentTypeLayoutData) => {
|
||||
let currentRowIndex = 0;
|
||||
const newLayout = [];
|
||||
|
||||
if (!currentContentTypeLayoutData) {
|
||||
if (!currentContentTypeLayoutData.layouts) {
|
||||
return newLayout;
|
||||
}
|
||||
|
||||
|
||||
@ -203,4 +203,9 @@ describe('Content Manager | EditView | utils | createAttributesLayout', () => {
|
||||
|
||||
expect(createAttributesLayout(currentLayoutData)).toEqual(expected);
|
||||
});
|
||||
|
||||
it('Should return an empty array when no layouts are found', () => {
|
||||
const currentLayoutData = {};
|
||||
expect(createAttributesLayout(currentLayoutData)).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user