Fix/postgres relation names (#5976)

This commit is contained in:
James Mikrut
2024-04-23 14:56:43 -04:00
committed by GitHub
6 changed files with 160 additions and 85 deletions

View File

@@ -3,6 +3,8 @@ import type { IndexDirection, IndexOptions } from 'mongoose'
import type { Payload } from 'payload'
import type { PaginatedDocs } from 'payload/database'
import { reload } from '@payloadcms/next/utilities'
import type { NextRESTClient } from '../helpers/NextRESTClient.js'
import type { GroupField, RichTextField } from './payload-types.js'
@@ -916,6 +918,22 @@ describe('Fields', () => {
})
})
it('should hot module reload and still be able to create', async () => {
const testDoc1 = await payload.findByID({
collection: tabsFieldsSlug,
id: document.id,
})
await reload(payload.config, payload)
const testDoc2 = await payload.findByID({
collection: tabsFieldsSlug,
id: document.id,
})
expect(testDoc1.id).toStrictEqual(testDoc2.id)
})
it('should create with fields inside a named tab', () => {
expect(document.tab.text).toStrictEqual(namedTabText)
})