From 725aa3183da468f1956fb48fcf2c6208b068c7e6 Mon Sep 17 00:00:00 2001 From: Jarrod Flesch Date: Fri, 9 Jun 2023 11:27:18 -0400 Subject: [PATCH] chore: stubs out config for field perf testing --- test/field-perf/config.ts | 96 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 test/field-perf/config.ts diff --git a/test/field-perf/config.ts b/test/field-perf/config.ts new file mode 100644 index 000000000..e37d8c253 --- /dev/null +++ b/test/field-perf/config.ts @@ -0,0 +1,96 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import { buildConfig } from '../buildConfig'; +import { devUser } from '../credentials'; + +export default buildConfig({ + collections: [ + { + slug: 'blocks-collection', + fields: [ + { + name: 'layout', + type: 'blocks', + blocks: [ + { + slug: 'content', + fields: [ + { + name: 'richText', + type: 'richText', + }, + { + name: 'field1', + type: 'text', + }, + { + name: 'field2', + type: 'text', + }, + { + name: 'field3', + type: 'text', + }, + { + name: 'field4', + type: 'text', + }, + { + name: 'field5', + type: 'text', + }, + { + name: 'field6', + type: 'text', + }, + { + name: 'field7', + type: 'text', + }, + { + name: 'field8', + type: 'text', + }, + { + name: 'field9', + type: 'text', + }, + ], + }, + ], + }, + ], + }, + ], + onInit: async (payload) => { + await payload.create({ + collection: 'users', + data: { + email: devUser.email, + password: devUser.password, + }, + }); + + await payload.create({ + collection: 'blocks-collection', + data: { + layout: + [...Array(100)].map((row, i) => ({ + blockName: `Block ${i}`, + blockType: 'content', + richText: [{ + children: [{ text: '' }], + }], + field1: 'text field 1', + field2: 'text field 2', + field3: 'text field 3', + field4: 'text field 4', + field5: 'text field 5', + field6: 'text field 6', + field7: 'text field 7', + field8: 'text field 8', + field9: 'text field 9', + })), + }, + }); + }, +});