chore: update 2.0 branch from master (#3207)

Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
Co-authored-by: Alessio Gravili <alessio@gravili.de>
Co-authored-by: PatrikKozak <patrik@trbl.design>
Co-authored-by: Lucas Blancas <lablancas@gmail.com>
Co-authored-by: Stef Gootzen <37367280+stefgootzen@users.noreply.github.com>
Co-authored-by: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com>
Co-authored-by: Jessica Chowdhury <67977755+JessChowdhury@users.noreply.github.com>
Co-authored-by: PatrikKozak <35232443+PatrikKozak@users.noreply.github.com>
Co-authored-by: Greg Willard <Wickett06@gmail.com>
Co-authored-by: James Mikrut <james@payloadcms.com>
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
fix: WhereBuilder component does not accept all valid Where queries (#3087)
fix: passes in height to resizeOptions upload option to allow height resize (#3171)
This commit is contained in:
Alessio Gravili
2023-08-22 22:04:50 +02:00
committed by GitHub
parent f911257cd9
commit 9467074fb9
174 changed files with 3875 additions and 2791 deletions

View File

@@ -48,6 +48,15 @@ describe('Fields', () => {
expect(doc.defaultFunction).toEqual(defaultText);
expect(doc.defaultAsync).toEqual(defaultText);
});
it('should populate default values in beforeValidate hook', async () => {
const { fieldWithDefaultValue, dependentOnFieldWithDefaultValue } = await payload.create({
collection: 'text-fields',
data: { text },
});
await expect(fieldWithDefaultValue).toEqual(dependentOnFieldWithDefaultValue);
});
});
describe('timestamps', () => {