Files
payload/test/admin/config.ts
Alessio Gravili 17f7b94555 chore: improve test suites, upgrade jest and playwright, add debug utilities for lexical (#4011)
* feat(richtext-lexical): 'bottom' position value for plugins

* feat: TestRecorderFeature

* chore: restructuring to seed and clear db before each test

* chore: make sure all tests pass

* chore: make sure indexes are created in seed.ts - this fixes one erroring test

* chore: speed up test runs through db snapshots

* chore: support drizzle when resetting db

* chore: simplify seeding process, by moving boilerplate db reset / snapshot logic into a wrapper function

* chore: add new seeding process to admin test suite

* chore(deps): upgrade jest and playwright

* chore: make sure mongoose-specific tests are not skipped

* chore: fix point test, which was depending on another test (that's bad!)

* chore: fix incorrect import

* chore: remove unnecessary comments

* chore: clearly label lexicalE2E test file as todo

* chore: simplify seed logic

* chore: move versions test suite to new seed system
2023-11-06 16:38:40 +01:00

116 lines
3.4 KiB
TypeScript

import path from 'path'
import { buildConfigWithDefaults } from '../buildConfigWithDefaults'
import { CustomViews1 } from './collections/CustomViews1'
import { CustomViews2 } from './collections/CustomViews2'
import { Geo } from './collections/Geo'
import { CollectionGroup1A } from './collections/Group1A'
import { CollectionGroup1B } from './collections/Group1B'
import { CollectionGroup2A } from './collections/Group2A'
import { CollectionGroup2B } from './collections/Group2B'
import { CollectionHidden } from './collections/Hidden'
import { CollectionNoApiView } from './collections/NoApiView'
import { Posts } from './collections/Posts'
import { Users } from './collections/Users'
import AfterDashboard from './components/AfterDashboard'
import AfterNavLinks from './components/AfterNavLinks'
import BeforeLogin from './components/BeforeLogin'
import Logout from './components/Logout'
import CustomDefaultView from './components/views/CustomDefault'
import CustomMinimalRoute from './components/views/CustomMinimal'
import CustomView from './components/views/CustomView'
import CustomNestedView from './components/views/CustomViewNested'
import { CustomGlobalViews1 } from './globals/CustomViews1'
import { CustomGlobalViews2 } from './globals/CustomViews2'
import { Global } from './globals/Global'
import { GlobalGroup1A } from './globals/Group1A'
import { GlobalGroup1B } from './globals/Group1B'
import { GlobalHidden } from './globals/Hidden'
import { GlobalNoApiView } from './globals/NoApiView'
import { clearAndSeedEverything } from './seed'
import { customNestedViewPath, customViewPath } from './shared'
export default buildConfigWithDefaults({
admin: {
css: path.resolve(__dirname, 'styles.scss'),
components: {
// providers: [CustomProvider, CustomProvider],
afterDashboard: [AfterDashboard],
beforeLogin: [BeforeLogin],
logout: {
Button: Logout,
},
afterNavLinks: [AfterNavLinks],
views: {
// Dashboard: CustomDashboardView,
// Account: CustomAccountView,
CustomMinimalView: {
path: '/custom-minimal-view',
Component: CustomMinimalRoute,
},
CustomDefaultView: {
path: '/custom-default-view',
Component: CustomDefaultView,
},
CustomView: {
path: customViewPath,
exact: true,
Component: CustomView,
},
CustomNestedView: {
path: customNestedViewPath,
Component: CustomNestedView,
},
},
},
webpack: (config) => ({
...config,
resolve: {
...config.resolve,
alias: {
...config?.resolve?.alias,
fs: path.resolve(__dirname, './mocks/emptyModule.js'),
},
},
}),
},
i18n: {
resources: {
en: {
general: {
dashboard: 'Home',
},
},
},
},
localization: {
defaultLocale: 'en',
locales: ['en', 'es'],
},
collections: [
Posts,
Users,
CollectionHidden,
CollectionNoApiView,
CustomViews1,
CustomViews2,
CollectionGroup1A,
CollectionGroup1B,
CollectionGroup2A,
CollectionGroup2B,
Geo,
],
globals: [
GlobalHidden,
GlobalNoApiView,
Global,
CustomGlobalViews1,
CustomGlobalViews2,
GlobalGroup1A,
GlobalGroup1B,
],
onInit: async (payload) => {
await clearAndSeedEverything(payload)
},
})