chore: separate Lexical tests into dedicated suite (#12047)
Lexical tests comprise almost half of the collections in the fields suite, and are starting to become complex to manage. They are sometimes related to other auxiliary collections, so refactoring one test sometimes breaks another, seemingly unrelated one. In addition, the fields suite is very large, taking a long time to compile. This will make it faster. Some ideas for future refactorings: - 3 main collections: defaultFeatures, fully featured, and legacy. Legacy is the current one that has multiple editors and could later be migrated to the first two. - Avoid collections with more than 1 editor. - Create reseed buttons to restore the editor to certain states, to avoid a proliferation of collections and documents. - Reduce the complexity of the three auxiliary collections (text, array, upload), which are rarely or never used and have many fields designed for tests in the fields suite.
This commit is contained in:
@@ -20,22 +20,10 @@ import EmailFields from './collections/Email/index.js'
|
||||
import GroupFields from './collections/Group/index.js'
|
||||
import IndexedFields from './collections/Indexed/index.js'
|
||||
import JSONFields from './collections/JSON/index.js'
|
||||
import {
|
||||
getLexicalFieldsCollection,
|
||||
lexicalBlocks,
|
||||
lexicalInlineBlocks,
|
||||
} from './collections/Lexical/index.js'
|
||||
import { LexicalAccessControl } from './collections/LexicalAccessControl/index.js'
|
||||
import { LexicalInBlock } from './collections/LexicalInBlock/index.js'
|
||||
import { LexicalLocalizedFields } from './collections/LexicalLocalized/index.js'
|
||||
import { LexicalMigrateFields } from './collections/LexicalMigrate/index.js'
|
||||
import { LexicalObjectReferenceBugCollection } from './collections/LexicalObjectReferenceBug/index.js'
|
||||
import { LexicalRelationshipsFields } from './collections/LexicalRelationships/index.js'
|
||||
import NumberFields from './collections/Number/index.js'
|
||||
import PointFields from './collections/Point/index.js'
|
||||
import RadioFields from './collections/Radio/index.js'
|
||||
import RelationshipFields from './collections/Relationship/index.js'
|
||||
import RichTextFields from './collections/RichText/index.js'
|
||||
import RowFields from './collections/Row/index.js'
|
||||
import SelectFields from './collections/Select/index.js'
|
||||
import SelectVersionsFields from './collections/SelectVersions/index.js'
|
||||
@@ -50,17 +38,9 @@ import UploadsMultiPoly from './collections/UploadMultiPoly/index.js'
|
||||
import UploadsPoly from './collections/UploadPoly/index.js'
|
||||
import UploadRestricted from './collections/UploadRestricted/index.js'
|
||||
import Uploads3 from './collections/Uploads3/index.js'
|
||||
import TabsWithRichText from './globals/TabsWithRichText.js'
|
||||
import { clearAndSeedEverything } from './seed.js'
|
||||
|
||||
export const collectionSlugs: CollectionConfig[] = [
|
||||
getLexicalFieldsCollection({
|
||||
blocks: lexicalBlocks,
|
||||
inlineBlocks: lexicalInlineBlocks,
|
||||
}),
|
||||
LexicalMigrateFields,
|
||||
LexicalLocalizedFields,
|
||||
LexicalObjectReferenceBugCollection,
|
||||
{
|
||||
slug: 'users',
|
||||
admin: {
|
||||
@@ -75,8 +55,6 @@ export const collectionSlugs: CollectionConfig[] = [
|
||||
},
|
||||
],
|
||||
},
|
||||
LexicalInBlock,
|
||||
LexicalAccessControl,
|
||||
SelectVersionsFields,
|
||||
ArrayFields,
|
||||
BlockFields,
|
||||
@@ -97,8 +75,6 @@ export const collectionSlugs: CollectionConfig[] = [
|
||||
NumberFields,
|
||||
PointFields,
|
||||
RelationshipFields,
|
||||
LexicalRelationshipsFields,
|
||||
RichTextFields,
|
||||
SelectFields,
|
||||
TabsFields2,
|
||||
TabsFields,
|
||||
@@ -115,7 +91,6 @@ export const collectionSlugs: CollectionConfig[] = [
|
||||
|
||||
export const baseConfig: Partial<Config> = {
|
||||
collections: collectionSlugs,
|
||||
globals: [TabsWithRichText],
|
||||
blocks: [
|
||||
{
|
||||
slug: 'ConfigBlockTest',
|
||||
|
||||
Reference in New Issue
Block a user