chore: add test/ to workspace, update most references

This commit is contained in:
Elliot DeNolf
2024-03-19 00:59:56 -04:00
parent 1e10f021b5
commit c5ecf48d94
242 changed files with 641 additions and 481 deletions

View File

@@ -1,4 +1,5 @@
import { slateEditor } from '../../packages/richtext-slate/src/index.js'
import { slateEditor } from '@payloadcms/richtext-slate'
import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
import { devUser } from '../credentials.js'

View File

@@ -1,4 +1,5 @@
import type { Payload } from '../../packages/payload/src/index.js'
import type { Payload } from 'payload'
import type { NextRESTClient } from '../helpers/NextRESTClient.js'
import { devUser } from '../credentials.js'
@@ -92,8 +93,8 @@ describe('dataloader', () => {
expect(relationB.id).toBeDefined()
await payload.update({
collection: 'relation-a',
id: relationA.id,
collection: 'relation-a',
data: {
relationship: relationB.id,
richText: [
@@ -105,32 +106,32 @@ describe('dataloader', () => {
],
},
{
type: 'relationship',
children: [
{
text: '',
},
],
type: 'relationship',
relationTo: 'relation-b',
value: {
id: relationB.id,
},
relationTo: 'relation-b',
},
],
},
})
const relationANoDepth = await payload.findByID({
collection: 'relation-a',
id: relationA.id,
collection: 'relation-a',
depth: 0,
})
expect(relationANoDepth.relationship).toStrictEqual(relationB.id)
const relationAWithDepth = await payload.findByID({
collection: 'relation-a',
id: relationA.id,
collection: 'relation-a',
depth: 4,
})