Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update tests #7450

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update tests
  • Loading branch information
paulpopus committed Jul 31, 2024
commit f054596cde29c825acd19e16aaa1016e0569ecdd
2 changes: 1 addition & 1 deletion test/access-control/collections/Disabled/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CollectionConfig, Field } from 'payload/types'
import type { CollectionConfig, Field } from 'payload'

import { disabledSlug } from '../../shared.js'

3 changes: 1 addition & 2 deletions test/access-control/config.ts
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ import type { Config, User } from './payload-types.js'

import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
import { devUser } from '../credentials.js'
import { TestButton } from './TestButton.js'
import { Disabled } from './collections/Disabled/index.js'
import {
createNotUpdateCollectionSlug,
@@ -485,7 +484,7 @@ export default buildConfigWithDefaults({
admin: {
components: {
elements: {
SaveButton: TestButton,
SaveButton: '/TestButton.js#TestButton',
},
},
},
6 changes: 4 additions & 2 deletions test/auth/config.ts
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@ import { v4 as uuid } from 'uuid'

import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
import { devUser } from '../credentials.js'
import { AuthDebug } from './AuthDebug.js'
import { apiKeysSlug, namedSaveToJWTValue, saveToJWTKey, slug } from './shared.js'

export default buildConfigWithDefaults({
@@ -16,6 +15,9 @@ export default buildConfigWithDefaults({
password: devUser.password,
prefillOnly: true,
},
importMap: {
baseDir: path.resolve(dirname),
},
user: 'users',
importMap: {
baseDir: path.resolve(dirname),
@@ -168,7 +170,7 @@ export default buildConfigWithDefaults({
type: 'ui',
admin: {
components: {
Field: AuthDebug,
Field: '/AuthDebug.js#AuthDebug',
},
},
label: 'Auth Debug',
27 changes: 12 additions & 15 deletions test/fields-relationship/config.ts
Original file line number Diff line number Diff line change
@@ -4,11 +4,8 @@ const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
import type { CollectionConfig, FilterOptionsProps } from 'payload'

import { withMergedProps } from '@payloadcms/ui/shared'

import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
import { devUser } from '../credentials.js'
import { PrePopulateFieldUI } from './PrePopulateFieldUI/index.js'
import {
collection1Slug,
collection2Slug,
@@ -240,13 +237,13 @@ export default buildConfigWithDefaults({
name: 'prePopulate',
admin: {
components: {
Field: withMergedProps({
Component: PrePopulateFieldUI,
toMergeIntoProps: {
Field: {
path: '/PrePopulateFieldUI/index.js#PrePopulateFieldUI',
clientProps: {
hasMultipleRelations: false,
path: 'relationPrePopulate',
},
}),
},
},
width: '25%',
},
@@ -270,13 +267,13 @@ export default buildConfigWithDefaults({
name: 'prePopulateRelationHasMany',
admin: {
components: {
Field: withMergedProps({
Component: PrePopulateFieldUI,
toMergeIntoProps: {
Field: {
path: '/PrePopulateFieldUI/index.js#PrePopulateFieldUI',
clientProps: {
hasMultipleRelations: false,
path: 'relationHasMany',
},
}),
},
},
width: '25%',
},
@@ -300,13 +297,13 @@ export default buildConfigWithDefaults({
name: 'prePopulateToMany',
admin: {
components: {
Field: withMergedProps({
Component: PrePopulateFieldUI,
toMergeIntoProps: {
Field: {
path: '/PrePopulateFieldUI/index.js#PrePopulateFieldUI',
clientProps: {
hasMultipleRelations: true,
path: 'relationToManyHasMany',
},
}),
},
},
width: '25%',
},
32 changes: 20 additions & 12 deletions test/fields/collections/Collapsible/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { CollectionConfig } from 'payload'

import { collapsibleFieldsSlug } from '../../slugs.js'
import { getCustomLabel } from './CustomLabel/getCustomLabel.js'

const CollapsibleFields: CollectionConfig = {
slug: collapsibleFieldsSlug,
@@ -82,11 +81,13 @@ const CollapsibleFields: CollectionConfig = {
description: 'Collapsible label rendered from a function.',
initCollapsed: true,
components: {
RowLabel: getCustomLabel({
path: 'functionTitleField',
fallback: 'Custom Collapsible Label',
style: {},
}),
RowLabel: {
clientProps: {
path: 'functionTitleField',
fallback: 'Custom Collapsible Label',
},
path: '/collections/Collapsible/NestedCustomLabel/index.js#NestedCustomLabel',
},
},
},
fields: [
@@ -101,7 +102,12 @@ const CollapsibleFields: CollectionConfig = {
admin: {
description: 'Collapsible label rendered as a react component.',
components: {
RowLabel: getCustomLabel({ path: 'componentTitleField', style: {} }),
RowLabel: {
clientProps: {
path: 'componentTitleField',
},
path: '/collections/Collapsible/NestedCustomLabel/index.js#NestedCustomLabel',
},
},
},
fields: [
@@ -113,11 +119,13 @@ const CollapsibleFields: CollectionConfig = {
type: 'collapsible',
admin: {
components: {
RowLabel: getCustomLabel({
path: 'nestedTitle',
fallback: 'Nested Collapsible',
style: {},
}),
RowLabel: {
clientProps: {
path: 'nestedTitle',
fallback: 'Nested Collapsible',
},
path: '/collections/Collapsible/NestedCustomLabel/index.js#NestedCustomLabel',
},
},
},
fields: [
3 changes: 3 additions & 0 deletions test/fields/config.ts
Original file line number Diff line number Diff line change
@@ -102,6 +102,9 @@ export default buildConfigWithDefaults({
'new-value': 'client available',
},
},
importMap: {
baseDir: path.resolve(dirname),
},
},
localization: {
defaultLocale: 'en',
4 changes: 1 addition & 3 deletions test/plugin-stripe/collections/Customers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type { CollectionConfig } from 'payload'

import { LinkToDoc } from '@payloadcms/plugin-stripe'

import { customersSlug } from '../shared.js'

export const Customers: CollectionConfig = {
@@ -32,7 +30,7 @@ export const Customers: CollectionConfig = {
type: 'ui',
admin: {
components: {
Field: LinkToDoc,
Field: '@payloadcms/plugin-stripe/client#LinkToDoc',
},
custom: {
isTestKey: process.env.PAYLOAD_PUBLIC_IS_STRIPE_TEST_KEY === 'true',