fix: allows empty objects to be retained in db

This commit is contained in:
Jarrod Flesch
2023-02-28 10:40:21 -05:00
parent 5ac436e184
commit 0247e2d106
8 changed files with 47 additions and 4 deletions

View File

@@ -524,6 +524,19 @@ describe('Fields', () => {
},
})).rejects.toThrow('The following field is invalid: json');
});
it('should save empty json objects', async () => {
const createdJSON = await payload.create({
collection: 'json-fields',
data: {
json: {
state: {},
},
},
});
expect(createdJSON.json.state).toBeDefined();
});
});
describe('richText', () => {