diff --git a/test/_community/collections/Posts/index.ts b/test/_community/collections/Posts/index.ts index 74bd7566cf..3f75852e81 100644 --- a/test/_community/collections/Posts/index.ts +++ b/test/_community/collections/Posts/index.ts @@ -1,6 +1,6 @@ -import type { CollectionConfig } from '../../../../packages/payload/src/collections/config/types' +import type { CollectionConfig } from '../../../../packages/payload/src/collections/config/types.d.ts' -import { mediaSlug } from '../Media' +import { mediaSlug } from '../Media/index.js' export const postsSlug = 'posts' @@ -8,6 +8,9 @@ export const PostsCollection: CollectionConfig = { admin: { useAsTitle: 'text', }, + versions: { + drafts: true, + }, fields: [ { name: 'text', diff --git a/test/_community/config.ts b/test/_community/config.ts index a326514cf4..f335261eef 100644 --- a/test/_community/config.ts +++ b/test/_community/config.ts @@ -1,11 +1,11 @@ import path from 'path' -import getFileByPath from '../../packages/payload/src/uploads/getFileByPath' -import { buildConfigWithDefaults } from '../buildConfigWithDefaults' -import { devUser } from '../credentials' -import { MediaCollection } from './collections/Media' -import { PostsCollection, postsSlug } from './collections/Posts' -import { MenuGlobal } from './globals/Menu' +import getFileByPath from '../../packages/payload/src/uploads/getFileByPath.js' +import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js' +import { devUser } from '../credentials.js' +import { MediaCollection } from './collections/Media/index.js' +import { PostsCollection, postsSlug } from './collections/Posts/index.js' +import { MenuGlobal } from './globals/Menu/index.js' export default buildConfigWithDefaults({ // ...extend config here diff --git a/test/buildConfigWithDefaults.ts b/test/buildConfigWithDefaults.ts index 28df0a055f..f07bdb80c8 100644 --- a/test/buildConfigWithDefaults.ts +++ b/test/buildConfigWithDefaults.ts @@ -6,30 +6,30 @@ import type { Config, SanitizedConfig } from '../packages/payload/src/config/typ import { mongooseAdapter } from '../packages/db-mongodb/src/index.js' import { postgresAdapter } from '../packages/db-postgres/src/index.js' import { buildConfig as buildPayloadConfig } from '../packages/payload/src/config/build.js' -// import { -// AlignFeature, -// BlockQuoteFeature, -// BlocksFeature, -// BoldFeature, -// CheckListFeature, -// HeadingFeature, -// IndentFeature, -// InlineCodeFeature, -// ItalicFeature, -// LinkFeature, -// OrderedListFeature, -// ParagraphFeature, -// RelationshipFeature, -// StrikethroughFeature, -// SubscriptFeature, -// SuperscriptFeature, -// TreeViewFeature, -// UnderlineFeature, -// UnorderedListFeature, -// UploadFeature, -// lexicalEditor, -// } from '../packages/richtext-lexical/src' -import { slateEditor } from '../packages/richtext-slate/src/index.js' +import { + AlignFeature, + BlockQuoteFeature, + BlocksFeature, + BoldFeature, + CheckListFeature, + HeadingFeature, + IndentFeature, + InlineCodeFeature, + ItalicFeature, + LinkFeature, + OrderedListFeature, + ParagraphFeature, + RelationshipFeature, + StrikethroughFeature, + SubscriptFeature, + SuperscriptFeature, + TreeViewFeature, + UnderlineFeature, + UnorderedListFeature, + UploadFeature, + lexicalEditor, +} from '../packages/richtext-lexical/src/index.js' +// import { slateEditor } from '../packages/richtext-slate/src/index.js' import { CustomDashboard } from './CustomDashboard.js' // process.env.PAYLOAD_DATABASE = 'postgres' @@ -74,42 +74,9 @@ export function buildConfigWithDefaults(testConfig?: Partial): Promise): Promise { - // return value !== 'option2' ? true : 'Cannot be option2' - // }, - // }, - // ], - // }, - // ], - // }), - // ], + // }, + // }, // }), + editor: lexicalEditor({ + features: [ + ParagraphFeature(), + RelationshipFeature(), + LinkFeature({ + fields: [ + { + name: 'description', + type: 'text', + }, + ], + }), + CheckListFeature(), + UnorderedListFeature(), + OrderedListFeature(), + AlignFeature(), + BlockQuoteFeature(), + BoldFeature(), + ItalicFeature(), + UploadFeature({ + collections: { + media: { + fields: [ + { + name: 'alt', + type: 'text', + }, + ], + }, + }, + }), + UnderlineFeature(), + StrikethroughFeature(), + SubscriptFeature(), + SuperscriptFeature(), + InlineCodeFeature(), + TreeViewFeature(), + HeadingFeature(), + IndentFeature(), + BlocksFeature({ + blocks: [ + { + slug: 'myBlock', + fields: [ + { + name: 'someText', + type: 'text', + }, + { + name: 'someTextRequired', + type: 'text', + required: true, + }, + { + name: 'radios', + type: 'radio', + options: [ + { + label: 'Option 1', + value: 'option1', + }, + { + label: 'Option 2', + value: 'option2', + }, + { + label: 'Option 3', + value: 'option3', + }, + ], + validate: (value) => { + return value !== 'option2' ? true : 'Cannot be option2' + }, + }, + ], + }, + ], + }), + ], + }), sharp, telemetry: false, ...testConfig,