chore: e2e improvements
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { CollectionConfig } from '../../../packages/payload/src/collections/config/types'
|
||||
|
||||
import CustomEditView from '../components/views/CustomEdit'
|
||||
import { CustomEditView } from '../components/views/CustomEdit'
|
||||
import { customViews1CollectionSlug } from '../slugs'
|
||||
|
||||
export const CustomViews1: CollectionConfig = {
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { AdminViewComponent } from '../../../../../packages/payload/src/adm
|
||||
import { useStepNav } from '../../../../../packages/ui/src/elements/StepNav'
|
||||
import { useConfig } from '../../../../../packages/ui/src/providers/Config'
|
||||
|
||||
const CustomEditView: AdminViewComponent = ({
|
||||
export const CustomEditView: AdminViewComponent = ({
|
||||
canAccessAdmin,
|
||||
// collection,
|
||||
// global,
|
||||
@@ -58,5 +58,3 @@ const CustomEditView: AdminViewComponent = ({
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
export default CustomEditView
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import path from 'path'
|
||||
|
||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
||||
import { CustomIdRow } from './collections/CustomIdRow'
|
||||
import { CustomIdTab } from './collections/CustomIdTab'
|
||||
import { CustomViews1 } from './collections/CustomViews1'
|
||||
import { CustomViews2 } from './collections/CustomViews2'
|
||||
import { Geo } from './collections/Geo'
|
||||
@@ -9,8 +11,6 @@ import { CollectionGroup1B } from './collections/Group1B'
|
||||
import { CollectionGroup2A } from './collections/Group2A'
|
||||
import { CollectionGroup2B } from './collections/Group2B'
|
||||
import { CollectionHidden } from './collections/Hidden'
|
||||
import { CustomIdTab } from './collections/CustomIdTab'
|
||||
import { CustomIdRow } from './collections/CustomIdRow'
|
||||
import { CollectionNoApiView } from './collections/NoApiView'
|
||||
import { Posts } from './collections/Posts'
|
||||
import { Users } from './collections/Users'
|
||||
@@ -35,7 +35,6 @@ import { customNestedViewPath, customViewPath } from './shared'
|
||||
|
||||
export default buildConfigWithDefaults({
|
||||
admin: {
|
||||
css: path.resolve(__dirname, 'styles.scss'),
|
||||
components: {
|
||||
// providers: [CustomProvider, CustomProvider],
|
||||
actions: [AdminButton],
|
||||
@@ -67,19 +66,9 @@ export default buildConfigWithDefaults({
|
||||
},
|
||||
},
|
||||
},
|
||||
webpack: (config) => ({
|
||||
...config,
|
||||
resolve: {
|
||||
...config.resolve,
|
||||
alias: {
|
||||
...config?.resolve?.alias,
|
||||
fs: path.resolve(__dirname, './mocks/emptyModule.js'),
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
i18n: {
|
||||
resources: {
|
||||
translations: {
|
||||
en: {
|
||||
general: {
|
||||
dashboard: 'Home',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { GlobalConfig } from '../../../packages/payload/src/globals/config/types'
|
||||
|
||||
import CustomEditView from '../components/views/CustomEdit'
|
||||
import { CustomEditView } from '../components/views/CustomEdit'
|
||||
import { customGlobalViews1GlobalSlug } from '../slugs'
|
||||
|
||||
export const CustomGlobalViews1: GlobalConfig = {
|
||||
|
||||
@@ -17,7 +17,7 @@ export const AuthDebug: React.FC<UIField> = () => {
|
||||
setState(userRes)
|
||||
}
|
||||
|
||||
fetchUser()
|
||||
void fetchUser()
|
||||
}, [user])
|
||||
|
||||
return (
|
||||
|
||||
@@ -3,6 +3,7 @@ import { v4 as uuid } from 'uuid'
|
||||
import { mapAsync } from '../../packages/payload/src/utilities/mapAsync'
|
||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
|
||||
import { devUser } from '../credentials'
|
||||
import { AuthDebug } from './AuthDebug'
|
||||
import { apiKeysSlug, namedSaveToJWTValue, saveToJWTKey, slug } from './shared'
|
||||
|
||||
export default buildConfigWithDefaults({
|
||||
@@ -153,16 +154,16 @@ export default buildConfigWithDefaults({
|
||||
label: 'Custom',
|
||||
type: 'text',
|
||||
},
|
||||
// {
|
||||
// name: 'authDebug',
|
||||
// label: 'Auth Debug',
|
||||
// type: 'ui',
|
||||
// admin: {
|
||||
// components: {
|
||||
// Field: AuthDebug,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
{
|
||||
name: 'authDebug',
|
||||
label: 'Auth Debug',
|
||||
type: 'ui',
|
||||
admin: {
|
||||
components: {
|
||||
Field: AuthDebug,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('auth', () => {
|
||||
let apiURL: string
|
||||
|
||||
beforeAll(async ({ browser }) => {
|
||||
const { serverURL } = await initPayloadE2E({ config, dirname: __dirname })
|
||||
;({ serverURL } = await initPayloadE2E({ config, dirname: __dirname }))
|
||||
url = new AdminUrlUtil(serverURL, slug)
|
||||
|
||||
const context = await browser.newContext()
|
||||
|
||||
@@ -39,5 +39,5 @@ async function main() {
|
||||
const PAYLOAD_CONFIG_PATH = path.resolve(testSuite, 'config')
|
||||
process.env.PAYLOAD_CONFIG_PATH = PAYLOAD_CONFIG_PATH
|
||||
|
||||
nextDev({ _: [path.resolve(__dirname, '..')] })
|
||||
nextDev({ _: [path.resolve(__dirname, '..')], port: process.env.PORT || 3000 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user