mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 14:54:55 +00:00
fix: resolve 273 module import errors in frontend build
- Create backward-compatible UI component re-exports (button.ts, card.ts, etc.) - Add ScrollArea component using MUI Box with custom scrollbar styling - Add Sonner-compatible toast API using MUI Snackbar/Alert - Fix schema-types imports to use @/lib/schema-types alias - Fix incorrect relative import paths in auth, packages, password modules - Fix page-renderer imports for database and lua-engine - Remove tailwind-merge dependency (project uses MUI) - Install missing @phosphor-icons/react package - Create accordion.ts re-export shim Reduced TypeScript errors from 409 to 136 - remaining errors are MUI component prop type mismatches requiring API adjustments.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { validatePackageCreate } from '../../../src/core/validation/validate-package-create'
|
||||
|
||||
describe('validatePackageCreate', () => {
|
||||
const base = {
|
||||
name: 'forum',
|
||||
version: '1.0.0',
|
||||
author: 'MetaBuilder',
|
||||
manifest: { dependencies: [] },
|
||||
isInstalled: false,
|
||||
}
|
||||
|
||||
it.each([
|
||||
{ data: base, expected: [] },
|
||||
{ data: { ...base, installedAt: '2024-01-01T00:00:00Z' }, expected: [] },
|
||||
])('returns $expected for valid case', ({ data, expected }) => {
|
||||
expect(validatePackageCreate(data)).toEqual(expected)
|
||||
})
|
||||
|
||||
it.each([
|
||||
{ data: { ...base, version: '1.0' }, message: 'version must be semantic (x.y.z)' },
|
||||
{ data: { ...base, manifest: [] }, message: 'manifest must be an object' },
|
||||
{ data: { ...base, isInstalled: 'no' as unknown as boolean }, message: 'isInstalled must be a boolean' },
|
||||
{ data: { ...base, installedBy: 'invalid' }, message: 'installedBy must be a valid UUID' },
|
||||
])('rejects invalid case', ({ data, message }) => {
|
||||
expect(validatePackageCreate(data)).toContain(message)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user