You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Scripts
### `script:setup-figma`
Sets up the local development environment for testing with content-api:
- Clones `enterprise-plugins` repo if not present (sibling directory)
- Runs `pnpm install` in enterprise-plugins
- Removes `@payloadcms/figma` from `test/package.json` to rely on vitest
alias instead
### `test:int:summary`
Shows less noisy output for integration tests - reports how many tests
failed without detailed error messages. The test suites to run can be
easily modified via a hardcoded array. This script is particularly
useful when many tests fail (e.g., when starting to develop a new
db-adapter). To run it for a specific adapter, prefix with
`PAYLOAD_DATABASE` env var. Can be removed once content-api is complete
if desired.
## Bug Fixes
### Fixed `isValidID` validation
- Now properly checks that value type matches the expected ID type
- Rejects numbers when `type === 'text'` (fixes content-api adapter
validation)
- Only accepts numbers when `type === 'number'`
- Added explicit `return false` for invalid cases
## Test Improvements
### Refactored "Schema generation" tests
Moved conditional logic inside `it()` blocks instead of wrapping them,
preventing "no tests found" errors with new db-adapters.
### Added type casting tests
Tests for automatic type coercion in database adapters:
- String-to-number conversion in `hasMany` number fields
- Date field storage and retrieval as ISO strings
- Unix timestamp to ISO string conversion
See rationale in the comments of [this
PR](payloadcms/enterprise-plugins#300).
### Configured Vitest to run tests from `src/` instead of `dist/`
This was very difficult with Jest and eliminates the need to build in
watch mode during development.
---
**Note:** Current setup is designed for local content-api and db-adapter
development. Small modifications will be made in the future to run these
tests in CI against a deployed staging content-api URL.
0 commit comments