Fix ctb mutate when not needed

Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
soupette 2021-03-16 16:11:44 +01:00
parent 80ce19a7e5
commit e83f379b49
2 changed files with 7 additions and 5 deletions

View File

@ -38,7 +38,7 @@ const mutateCTBContentTypeSchema = (nextSchema, prevSchema) => {
}
const isNextSchemaLocalized = get(nextSchema, localizedPath, false);
const isPrevSchemaLocalized = get(prevSchema, localizedPath, false);
const isPrevSchemaLocalized = get(prevSchema, ['schema', ...localizedPath], false);
// No need to perform modification on the schema, if the i18n feature was not changed
// at the ct level

View File

@ -89,11 +89,13 @@ describe('i18n | utils ', () => {
expect(
mutateSchema(ctSchema, {
schema: {
pluginOptions: {
pluginA: { foo: 'bar' },
i18n: { localized: true },
pluginB: { foo: 'bar' },
},
},
})
).toEqual(ctSchema);
});