Files
payload/test/bulk-edit/collections/Posts/index.ts
Jacob Fletcher a44a252f31 test: dedicated bulk edit test suite (#11756)
Consolidates all bulk edit related tests into a single, dedicated suite.

Currently, bulk edit tests are dispersed throughout the Admin > General
and the Versions test suites, which are considerably bloated for their
own purposes. This made them very hard to locate, mentally digest, and
add on new tests. Going forward, many more tests specifically for bulk
edit will need to be written. This gives us a simple, isolated place for
that.

With this change are also a few improvements to the tests themselves to
make them more predictable and efficient.
2025-03-18 13:31:51 -04:00

87 lines
1.6 KiB
TypeScript

import type { CollectionConfig } from 'payload'
import { postsSlug } from '../../shared.js'
export const PostsCollection: CollectionConfig = {
slug: postsSlug,
versions: {
drafts: true,
},
admin: {
useAsTitle: 'title',
defaultColumns: ['id', 'title', 'description', '_status'],
pagination: {
defaultLimit: 5,
limits: [5, 10, 15],
},
},
fields: [
{
name: 'title',
type: 'text',
},
{
name: 'description',
type: 'textarea',
},
{
name: 'defaultValueField',
type: 'text',
defaultValue: 'This is a default value',
},
{
name: 'group',
type: 'group',
fields: [
{
name: 'defaultValueField',
type: 'text',
defaultValue: 'This is a default value',
},
{
name: 'title',
type: 'text',
},
],
},
{
name: 'array',
type: 'array',
admin: {
initCollapsed: true,
},
fields: [
{
name: 'optional',
type: 'text',
},
{
name: 'innerArrayOfFields',
type: 'array',
fields: [
{
name: 'innerOptional',
type: 'text',
},
],
},
],
},
{
name: 'blocks',
type: 'blocks',
blocks: [
{
slug: 'textBlock',
fields: [
{
name: 'textFieldForBlock',
type: 'text',
},
],
},
],
},
],
}